C# programming code

Get your Assignment in a Minimum of 3 hours

Our academic experts are ready and waiting to assist with any writing project you may have. From simple essay plans, through to full dissertations, you can guarantee we have a service perfectly matched to your needs.

Free Inquiry Order A Paper Now Cost Estimate

Help me study for my C Programming class. I’m stuck and don’t understand.

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

This lab relates to the following Skill Outcomes:

  • Students will apply the steps in the program development process
  • Students will implement object-oriented programming through predefined classes
  • Students will develop graphical user interface applications using appropriate controls
  • Students will implement primitive data types for variables, fields, and constants
  • Students will implement the selection structure
  • Students will select appropriate arithmetic, logical, and relational operators
  • Students will analyze, design, implement, test, and debug domain-specific applications which demonstrate basic computation, input/output, control structures, and operators

This lab covers the material in Chapter 4 as well as concepts from previous chapters. The purpose of this lab is to demonstrate the use of the appropriate selection structure and to prevent data conversion exceptions using the TryParse method as well as input validation using if statements.

1. Complete Programming Problem #7, Software Sales, on page 267 of the textbook.

The ADDITIONAL REQUIREMENTS described below MUST also be implemented:

  • Apply the percent format string for displaying percentage output with one decimal place (i.e., the precision must be specified)
  • Apply the currency format string for displaying monetary output (i.e., displays a leading currency symbol, digits, comma separators, and a decimal point)
  • Apply the number format string for displaying non-monetary output with no decimal places (i.e., the precision must be specified)
  • Prevent data conversion exceptions for the number of package(s) purchased text box by using the TryParse method. If a data conversion exception occurs be sure and display an appropriate error message to the user, set the focus back to the text box, and either clear the text box or select all the data entered into it.
  • Validate the input for the number of package(s) purchased text box to make sure the data entered is greater than zero. If not, be sure and display an appropriate error message to the user, set the focus back to the text box, and either clear the text box or select all the data entered into it. Placed in a separate selection structure than the data conversion validation (Hint: nested if statement)
  • Implement named constant where applicable (i.e., the retail cost of the software package)
  • Implement the following fields:
    • Sum of amount of discount which accumulates the amount of discount (i.e., running sum of Amount of Discount)
    • Sum of packages purchased which accumulates the number of packages purchased (i.e., running sum of Number of Package(s) Purchased
    • Sum of orders which counts the number of individual orders placed (i.e., each time the user clicks the calculate button)
  • Calculate and display the average discount which is the sum of the amount of discount divided by the sum orders
  • The design of the form is up to you, but should include appropriate controls for the input of data and display of results. Add the following Label controls to the form (Note: A GroupBox control is placed around the Summary information). A revised form based upon the Additional Requirements is provided under #6 below.
    • Discount percent formatted as a percent with one decimal place
    • Total Amount Before the Discount formatted as currency
    • Amount of the Discount (even if it is 0) formatted as currency
    • Total Amount After the Discount formatted as currency
    • Sum of Amount of Discount formatted as currency
    • Sum of Packages Purchased formatted as a number with zero decimal places
    • Sum of Orders formatted as a number with zero decimal places
    • Average Discount formatted as currency

The program MUST also include standard features of a Windows application including:

  • Change the default Text property of the form to something descriptive
  • Appropriate naming conventions for all controls (i.e., buttons, labels, text boxes). The required naming convention is descriptive name including control type using camelCase notation. For example: packagesPurchasedTextBox, discountPercentLabel, exitButton. The exception is controls not referenced in the code-behind of the Form1. For example, Label controls used for descriptive purposes only or PictureBox controls used for aesthetic purposes only.
  • Calculate, Clear, and Exit buttons with appropriate name and standard access key
  • When the Clear button is clicked the controls outside the Summary GroupBox control should be cleared and the focus set back to the TextBox control for entering number of packages purchased. The controls inside the Summary GroupBox control should NOT be cleared. Do NOT reset the values of the fields.
  • AcceptButton and CancelButton properties should be appropriately assigned to the Calculate button and Clear button, respectively
  • Ensure tab order for form is logical
  • Appropriate naming conventions and data type declarations for variables and named constants
  • Remove all unused event handlers from the program code

2. Name your project using the naming convention provided in the syllabus: CourseNumber_LastNameFirstInitial_LabXX (e.g., 3333_SharpJ_Lab04)

3. Include the appropriate identification information per the course syllabus using comment statements above the using statements in the code-behind of Form1 (see p. 102, 2.8 Comments, Blank Lines, and Indentation): Name, 9-Digit ID, Due Date, Date Submitted, and Brief Description of Program.

4. You will need to zip/compress the project folder using an appropriate zip/compression utility such as the one found in the Windows or WinZip, etc. Please DO NOT submit .rar (archive) files.

5. Attach and submit the zipped/compressed project folder file under the Lab 04 link under Assessments in the Chapter 4 Module.

6. See Revised Form based on Additional Requirements below. A PDF document with sample input-output is attached:

"Is this question part of your assignment? We Can Help!"

"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"

Get Started