Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 (Marks: 20) Design a Java application that will allow a user to keep track of the sales of an employee. The user should

image text in transcribed

image text in transcribed

image text in transcribed

Question 4 (Marks: 20) Design a Java application that will allow a user to keep track of the sales of an employee. The user should be presented with an option to enter the employee name and the sales amount. Continuously prompt the user to enter in a sales amount for an employee until a sentinel value of zero (O) is entered as a sale amount. Enter the employee name: XOLANI RADEBE Enter the sale 1 amount: 5000 Enter the sale 2 amount: 3580 Enter the sale 3 amount: 8000 Enter the sale 4 amount: 0 Please note that all input must occur in the Console window. Once the sentinel value has been entered display the employee sales report. EMPLOYEE SALES REPORT EMPLOYEE: TOTAL SOLD: XOLANI RADEBE R 16580.0 SALES COUNT: AVERAGE SALES: 3 5,526.667 Make use of a method to get the input from the user, another method to accumulate the sale amounts and a final method to determine the average sale amount. In your solution make provision if a user has entered in an invalid sale amount. Any sale amount entered that is below zero (0) is an invalid entry. Enter the employee name: XOLANI RADEBE Enter the sale 1 amount: -5580 You have entered a sale less than zero. Please enter the sale again. | The Independent Institute of Education (Pty) Ltd 2018 Page 4 of 9 Save the application as EmployeeSales.java Mark Examiner Moderator 4 N 5 Marking Guideline Variables declared and assigned: No variables declared/assigned - O marks Some variables declared/assigned - 2 marks All variables declared/assigned - 4 marks Methods used: Yes - 2 marks No - O marks Input and Output: Some correct - up to a maximum of 3 marks All input and output correct - 5 marks Correct if/switch statements used: No if statement/switch-marks Attempted but not correct - up to maximum of 1 marks Correct - 4 marks Correct controlling loop used: No loop - O marks Attempted but not correct - up to maximum of 1 marks Correct - 4 marks Save file correctly 4 4 1 TOTAL 20

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books