Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with this java code Programming Project Two: Sales Report Creating the solution to a Programming Project is not an exercise in finding an

image text in transcribedimage text in transcribedPlease help with this java code

Programming Project Two: Sales Report Creating the solution to a Programming Project is not an exercise in finding an answer on the Internet and submitting it as your own work. Submitting someone else's work as your own is plagiarism. Plagiarism is an example of Scholastic Dishonesty. Copying all or part of a solution from a site like Chegg is plagiarism. Your assignment is to create a Java program that keeps track of sales activity using a two-dimensional array. Your array will have three (3) rows, one for each of three salespeople. The array will have four (4) columns, one for each of the four different products being sold. Your program will accept input from the keyboard and produce record counts and a report that are displayed on the screen. This assignment is your opportunity to show us what you know about creating a two-dimensional array, accumulating values within the array, and using the contents of the array to produce a report. Input will come in the form of your user entering three integers separated from each other by one or more blanks on a single line. The three values represent: Salesperson [1, 2, or 3] Product (1, 2, 3, or 4] Quantity, a positive integer Your program will keep track of the total number of entries (lines of input) made by the user. Your program will skip over and keep track of the number of lines of input that are not valid. An entry is considered not valid if any of the following conditions exist: The value for the salesperson is out of the range from 1 through 3, inclusive. The value for the product is out of the range from 1 through 4, inclusive. The quantity value is less than or equal to zero (0). If any of these values are invalid, increment the count of records skipped, display an appropriate warning message, and continue to prompt the user to make additional entries. For a sales transaction where salesperson 2 sold 50 units of product 3, the user would enter 2 3 50. It is possible for a salesperson to have multiple transactions involving the same product. The values in your two- dimensional array will accumulate these quantities as running totals. Prompt the user to enter a value of zero (0) for the salesperson to stop processing input and have the program produce the sales report. To produce the sales report, your program will pass the two-dimensional array containing sales totals to a function named displayReport, whose only task is to display the report. The displayReport function will receive a single parameter variable, the two-dimensional array. You will determine how many rows there are in the array and how many columns there are in the array within the displayReport function. You can use the length attribute associated with Java arrays. An array's size is available as an instance variable named length. You will not pass the number of rows or columns to the displayReport function as additional parameter variables. You will not declare the number of rows and columns in the array as global variables. Your program does not magically know there are 3 rows and 4 columns in the array. Do not explicitly use 3 for the number of rows or 4 for the number of columns. Use variables. Our textbook contains examples of how to compute row totals and column totals for a two-dimensional array. Feel free to use the textbook. Stay away from the Internet. Solve this problem using your own best efforts. Your displayReport function will display the individual and total sales for each product and salesperson. After displaying this information, your program will identify the salesperson with the highest total sales. The initial output from your program will consist of any warnings identifying bad entry values and a line displaying the total number of user entries processed and the number of entries skipped for one reason or another. Model your output, sales report display, and identification of the most successful salesperson after the following example: Typical screen display: Warning: Product must be a number from 1 to 4. Warning: Salesperson must be a number from 1 to 3. Warning: Quantity must be a positive number. Of the 19 records processed, 3 were skipped. SALES REPORT Product 2 Product 3 Product 4 Totals: Salesperson 1 Salesperson 2 200 175 50 450 Sale son 3 200 295 Product 1 50 125 75 400 150 25 120 570 100 350 150 450 Totals: 325 Salesperson 3 had the highest total sales

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

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Discuss the prerequisites of TQM.

Answered: 1 week ago