LAB 6 - CREATING AND USING ARRAYS IN JAVA (3%) The manager wants to know how...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
LAB 6 - CREATING AND USING ARRAYS IN JAVA (3%) The manager wants to know how much each employee is contributing to the total sales of the company. Create Lab6-Arrays project with classes Sales Report and Sales ReportTest. The program gets the following input: o the number of sales people the name of each salesperson his/her sales for the past month Sales Report class: Use an array to store the names and another array to store the sales for each person. Add a method to get names and sales figures for each person and then add them into respective arrays. Add a private method to calculate and return the total sales. Add a private method to calculate and return the percentage of total sales contributed by a particular employee. Add an overrided toString() method to return a string that prints all sales people with their names, percent sales formatted to one decimal and total sales. Sales ReportTester class: Ask for number of sales people. Call required methods to take and process inputs. Print % sales for each sales person. Here is the sample output: How many sales people are there? 4 Enter name [1] : Terry Bill Enter sales [1]:256.78 Enter name [2] : Steve Brandon Enter sales [2]:102 Enter name [3]: Bob Wright Enter sales [3]:300 Enter name [4] : Gurpreet Gill Enter sales [4]:212.56 Percentage of Total Sales Terry Bill 29.5 % Steve Brandon 11.7 % Bob Wright 34.4% Gurpreet Gill Total sales were $871.34 24.48 LAB 6 - CREATING AND USING ARRAYS IN JAVA (3%) The manager wants to know how much each employee is contributing to the total sales of the company. Create Lab6-Arrays project with classes Sales Report and Sales ReportTest. The program gets the following input: o the number of sales people the name of each salesperson his/her sales for the past month Sales Report class: Use an array to store the names and another array to store the sales for each person. Add a method to get names and sales figures for each person and then add them into respective arrays. Add a private method to calculate and return the total sales. Add a private method to calculate and return the percentage of total sales contributed by a particular employee. Add an overrided toString() method to return a string that prints all sales people with their names, percent sales formatted to one decimal and total sales. Sales ReportTester class: Ask for number of sales people. Call required methods to take and process inputs. Print % sales for each sales person. Here is the sample output: How many sales people are there? 4 Enter name [1] : Terry Bill Enter sales [1]:256.78 Enter name [2] : Steve Brandon Enter sales [2]:102 Enter name [3]: Bob Wright Enter sales [3]:300 Enter name [4] : Gurpreet Gill Enter sales [4]:212.56 Percentage of Total Sales Terry Bill 29.5 % Steve Brandon 11.7 % Bob Wright 34.4% Gurpreet Gill Total sales were $871.34 24.48
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Northern Virginia Community College HOW MUCH FINANCIAL RISK SHOULD YOU TAKE? Mark D. D'Antonio Nova Southeastern University FORT LAUDERDALE, FLORIDA, U.S.A. Abstract A successful retirement...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Westile Company buys plain ceramic tiles and prints different designs on them for souvenir and gift stores. It buys the tiles from a small company in Europe, so at all times it keeps on hand a stock...
-
Hydrazine (N2H4) and dinitrogen tetroxide (N2O4) form a self-igniting mixture that has been used as a rocket propellant. The reaction products are N2 and H2O. (a) Write a balanced chemical equation...
-
(a) (b) In a liberalised economy, market forces of demand and supply dictate the interest rates and exchange rates in the market. With reference to the above statement, analyse two justifications why...
-
Assume you work for an accounting firm and you are part of a team that does work for two clients that are competitors. Describe some ways in which ethical considerations might be an important part of...
-
Mondale Winery depreciates its equipment using the group method. The cost of equipment purchased in 2011 totaled $425,000. The estimated residual value of the equipment was $40,000 and the group...
-
Accounts receivable is $ 6 , 0 7 6 in 2 0 2 0 and $ 5 , 6 2 4 in 2 0 2 1 The acquisition cost of plant, property and equipment is $ 2 0 , 5 8 0 in 2 0 2 0 and $ 2 6 , 4 0 4 in 2 0 2 1 Accumulated...
-
Which of the following is FALSE? A revenue variance is unfavorable if the revenue in the static planning budget is less than the revenue in the flexible budget. A revenue variance is the difference...
-
A sample of 100 students in a high school has a sample mean score of 550 on the math portion of the SAT. Assuming that the sample standard deviation is 75, test, at the .05 level of significance, the...
-
A sample of 20 students in a high school has a sample mean score of 520 on the English portion of the SAT. If the sample standard deviation is 65, test, at the .01 level of significance, the...
-
A popular commercial states that 4 out of 5 dentists who chew gum prefer sugarless gum. Suppose a random sample of 100 gum-chewing dentists is taken and 75 are found to prefer sugarless gum. Test, at...
-
A manufacturer claims that 95 % of its parts are free of defects. A random sample of 100 parts finds that 92 are free of defects. Test the manufacturers claim at the 1 % level of significance.
-
An investment advisor claims that 70 % of the stocks she recommends will increase in price. Suppose testing a random sample of 125 stocks she recommends reveals that 75 have increased in price. Test...
-
You plan to develop a regression model to investigate how various factors influence academic salaries. Before you conduct any regression analysis, you use Excel to construct a correlation matrix of...
-
Three forces with magnitudes of 70pounds, 40 pounds, and 60 pounds act on an object at angles of 30, 45, and 135, respectively, with the positive x-axis. Find the direction and magnitude of the...
-
A football is thrown on a long pass. Compared to the balls initial horizontal velocity component, the velocity at the highest point is (a) greater, (b) less, (c) the same.
-
What process do you follow to make decisions for these different circumstances, and are you satisfied with the results?
-
A football is thrown on a long pass. Compared to the balls initial vertical velocity, the vertical component of its velocity at the highest point is (a) greater, (b) less, (c) the same.
Study smarter with the SolutionInn App