Description
Write a Java application that keeps track of mal-formed or defective items manufactured by several workers in a manufacturing company.
Your program asks user to record the number of defective items in various batches created by different workers for one week, summarize the data, and then display some statistics about that data, such as the average number of rejected items per day.
Sample user interaction for this part of the program:
Your program records the number of defective items each day for 6 days of the week (Monday to Saturday), the factory is closed one day per week. Every day, the number of rejected items created by a worker are added to a total.
For example:
Totals for Monday:
Worker 1: 5 items
Worker 2: 3 items
Worker 3: 7 items
Worker 4: 5 items
Total for Monday: 20 items defective/rejected
Totals for Tuesday:
Worker 1: 2 items
Worker 1: 1 item
Worker 1: 5 items
Total for Tuesday: 8 items defective/rejected
Etc. Notice that there may not be the same number of workers every day (for example, a person might get a day off, work part time, whatever).
Your program should accumulate the number of defective items for each day. Each day's total is stored in an array.
Test Cases:
Below is an example showing the complete user interaction and output in case you want some values to test your logic and math:
Day 1
Number of Rejected Items for Worker 1: 5 Another? (Y/N) y
Number of Rejected Items for Worker 2: 3 Another? (Y/N) Y
Number of Rejected Items for Worker 3: 7 Another? (Y/N) Y
Number of Rejected Items for Worker 4: 5 Another? (Y/N) n
Day 1 Total: 20
Day 2
Number of Rejected Items for Worker 1: 2 Another? (Y/N) Y
Number of Rejected Items for Worker 2: 1 Another? (Y/N) y
Number of Rejected Items: 5 Another? (Y/N) N
Day 2 Total: 8
Day 3
Number of Rejected Items for Worker 1: 1 Another? (Y/N) Y
Number of Rejected Items for Worker 2: 0 Another? (Y/N) Y
Number of Rejected Items for Worker 3: 5 Another? (Y/N) y
Number of Rejected Items for Worker 4: 2 Another? (Y/N) Y
Number of Rejected Items for Worker 5: 7 Another? (Y/N) n
Day 3 Total: 15
Day 4
Number of Rejected Items for Worker 1: 3 Another? (Y/N) Y
Number of Rejected Items for Worker 2: 5 Another? (Y/N) N
Day 4 Total: 8
Day 5
Number of Rejected Items: 3
Another? (Y/N) y
Number of Rejected
Another? (Y/N) y Items for Worker 1: 3
Number of Rejected
Another? (Y/N) Y Items for Worker 2: 2
Number of Rejected Items for Worker 3: 4
Another? (Y/N) N
Day 5 Total: 12
Day 6
Number of Rejected Items: 7
Another? (Y/N) y
Number of Rejected
Another? (Y/N) y Items for Worker 1: 2
Number of Rejected
Another? (Y/N) Y Items for Worker 2: 5
Number of Rejected Items for Worker 3: 5
Another? (Y/N) n
Day 6 Total: 19
Statistics:
Total for Monday: 20 items defective/rejected Total for Tuesday: 8 items defective/rejected Total for Wednesday: 15 items defective/rejected Total for Thursday: 8 items defective/rejected Total for Friday: 12 items defective/rejected Total for Saturday: 19 items defective/rejected
Day with highest # rejects: Monday Average: 13.7
Tips!!
Note that:
• The total for the day is displayed before retrieving values for the next day.
• The user can enter upper- or lower-case Y/N to continue adding values for a particular day (assume if it starts with a "y" or "Y" it means "Yes", anything else means "No").
• There is also a blank line between the end of one day and the start of the next day.
Once you have accumulated all the data, you need to summarize it and calculate some statistics:
• Calculate the day number with the highest number of defective items.
• Calculate the average total for all 6 days. Average is formatted to 1 decimal place.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of