Develop a C# application that inputs one salesperson’s items sold for the last week, then calculates and displays that salesperson’s total sales. There’s no limit to the number of items that can be sold by a salesperson. You do not have to implement this with classes and objects. Technical Requirements: Prompt the user to enter the salesperson’s name, and store this name in a variable. Prompt the user to enter an item number and a quantity sold of that item. Store these two entries in two separate variables called “intItem” and “intQuantity”. Using a DO-WHILE or WHILE control structure, loop until the user enters -1 for the item number. Calculate the amount of sales for an item and store the result in a variable called dblItemSales. After the user enters an item number and a quantity, print to the screen:   the salesperson’s name “has sold “ [intQuantity] “of item # [intItem]. Accumulate the total sales in a variable called dblTotalSales by using a SWITCH statement to select the correct value to be multiplied by the quantity sold and adding this result to a running total, which is stored in the variable dblTotalSales. If the user enters a number other than 1, 2, 3, or 4, display the message “Invalid Entry” and re-prompt the user to enter an Item Number. Make sure you do not perform any calculations or prompt the user to enter a quantity if the item number is incorrect. After accumulating the total sales for an employee (that is, after the user has entered a -1 to quit), print to the screen Salesperson [Salesperson’s name] sold a total of [ total sales ]. See below for examples of the required output.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C#

A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5,000 worth of merchandise in a week receives $200 plus 9% of $5,000, or a total of $650. You’ve been supplied with a list of the items sold by each salesperson. The values of these items are as follows:

Item      Value

  1. 239.99
  2. 19.75
  3.   99.95
  4. 350.89

Develop a C# application that inputs one salesperson’s items sold for the last week, then calculates and displays that salesperson’s total sales. There’s no limit to the number of items that can be sold by a salesperson. You do not have to implement this with classes and objects.

Technical Requirements:

Prompt the user to enter the salesperson’s name, and store this name in a variable.

Prompt the user to enter an item number and a quantity sold of that item. Store these two entries in two separate variables called “intItem” and “intQuantity”.

Using a DO-WHILE or WHILE control structure, loop until the user enters -1 for the item number.

Calculate the amount of sales for an item and store the result in a variable called dblItemSales.

After the user enters an item number and a quantity, print to the screen:   the salesperson’s name “has sold “ [intQuantity] “of item # [intItem].

Accumulate the total sales in a variable called dblTotalSales by using a SWITCH statement to select the correct value to be multiplied by the quantity sold and adding this result to a running total, which is stored in the variable dblTotalSales.

If the user enters a number other than 1, 2, 3, or 4, display the message “Invalid Entry” and re-prompt the user to enter an Item Number. Make sure you do not perform any calculations or prompt the user to enter a quantity if the item number is incorrect.

After accumulating the total sales for an employee (that is, after the user has entered a -1 to quit), print to the screen Salesperson [Salesperson’s name] sold a total of [ total sales ].

See below for examples of the required output.

. file:///C:/209 C# Programming/Programming Assignments/Module 2/Assignment_2_Solution/Assignment_.
Enter a salesperson's nane:
John Doe
Enter an iten number between 1 and 4 or -1 to quit: -1
Salesperson John Doe sold a total of $0.00
Press the [enter] key to continue...
Transcribed Image Text:. file:///C:/209 C# Programming/Programming Assignments/Module 2/Assignment_2_Solution/Assignment_. Enter a salesperson's nane: John Doe Enter an iten number between 1 and 4 or -1 to quit: -1 Salesperson John Doe sold a total of $0.00 Press the [enter] key to continue...
C. file:///C:/209 C# Programming/Programming Assignments/Module 2/Assignment_2_Solution/Assignment_.
Enter a salesperson's name :
Jim Snith
Enter an item number between 1 and 4 or -1 to quit: 1
Enter the quantity so ld:
Salesperson Jim Snith sold 10 of item #1 at $2,399.90
10
Enter an item number between 1 and 4 or -1 to quit:
Enter the quantity so ld:
Salesperson Jim Snith sold 50 of iten #2 at $6,487.50
2
50
Enter an iten number between 1 and 4 or -1 to quit: 4
Enter the quantity sold:
Salesperson Jim Smith sold 100 of item #4 at $35,089.00
100
Enter an item number between 1 and 4 or -1 to quit:
Invalid entry.
Enter an iten number between 1 and 4 or -1 to quit:
Enter the quantity sold:
Salesperson Jim Smith
8
3
20
sold 20 of
#3 at $1,999.00
en
Enter an item number between 1 and 4 or -1 to quit:
Salesperson Jim Smith sold a total of $45,975.40
-1
Press the [enter] key to continue...
Transcribed Image Text:C. file:///C:/209 C# Programming/Programming Assignments/Module 2/Assignment_2_Solution/Assignment_. Enter a salesperson's name : Jim Snith Enter an item number between 1 and 4 or -1 to quit: 1 Enter the quantity so ld: Salesperson Jim Snith sold 10 of item #1 at $2,399.90 10 Enter an item number between 1 and 4 or -1 to quit: Enter the quantity so ld: Salesperson Jim Snith sold 50 of iten #2 at $6,487.50 2 50 Enter an iten number between 1 and 4 or -1 to quit: 4 Enter the quantity sold: Salesperson Jim Smith sold 100 of item #4 at $35,089.00 100 Enter an item number between 1 and 4 or -1 to quit: Invalid entry. Enter an iten number between 1 and 4 or -1 to quit: Enter the quantity sold: Salesperson Jim Smith 8 3 20 sold 20 of #3 at $1,999.00 en Enter an item number between 1 and 4 or -1 to quit: Salesperson Jim Smith sold a total of $45,975.40 -1 Press the [enter] key to continue...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education