Perodua is a car manufacturer, offers a broad range of vehicles. Among the best perodua models...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Perodua is a car manufacturer, offers a broad range of vehicles. Among the best perodua models are Myvi, Bezza, Aruz, Ativa and Axia. The company records each of the model sales in a quarterly basis. As a programmer, you are required to design a Sales class that has fields model's name, an integer array that stores sales for first, second, third, and fourth quarter. The Sales class also contain: A constructor that accepts model name and an array sales. A method that calculate the total sales of all quarters. The method returns the total sales. A method that display model's name, sales of all quarters, and its total sales. For DemoSales class, you should : Ask the user to enter number of models he/she wants to input. Ask the user to enter car model name, read as modelName. Create an integer array name quarters with 4 number of elements that will hold values when the user enter the sales value for each quarter. Use ArrayList to insert Sales objects. Below is an example of inserting a sales object to ArrayList: sales.add(new Sales (modelName, quarters)); Output example: Please enter number of models :3 1) Please enter model name 1 :Bezza Please enter sales for quarter 1:10000 Please enter sales for quarter 2:10500 Please enter sales for quarter 3:11000 Please enter sales for quarter 4:9500 2) Please enter model name 2 : Myvi Please enter sales for quarter 1:12000 Please enter sales for quarter 2:13000 Please enter sales for quarter 3:11000 Please enter sales for quarter 4:10000 3) Please enter model name 3 :Axia Please enter sales for quarter 1:9000 Please enter sales for quarter 2:8000 Please enter sales for quarter 3:8500 Please enter sales for quarter 4:7500 Model: Bezza Quarter 1: 10000 Quarter 2: 10500 Quarter 3: 11000 Quarter 4: 9500 Total sales: 41000 Model: Myvi Quarter 1: 12000 Quarter 2: 13000 Quarter 3: 11000 Quarter 4: 10000 Total sales: 46000 Model: Axia Quarter 1: 9000 Quarter 2: 8000 Quarter 3: 8500 Quarter 4: 7500 Total sales: 33000 Perodua is a car manufacturer, offers a broad range of vehicles. Among the best perodua models are Myvi, Bezza, Aruz, Ativa and Axia. The company records each of the model sales in a quarterly basis. As a programmer, you are required to design a Sales class that has fields model's name, an integer array that stores sales for first, second, third, and fourth quarter. The Sales class also contain: A constructor that accepts model name and an array sales. A method that calculate the total sales of all quarters. The method returns the total sales. A method that display model's name, sales of all quarters, and its total sales. For DemoSales class, you should : Ask the user to enter number of models he/she wants to input. Ask the user to enter car model name, read as modelName. Create an integer array name quarters with 4 number of elements that will hold values when the user enter the sales value for each quarter. Use ArrayList to insert Sales objects. Below is an example of inserting a sales object to ArrayList: sales.add(new Sales (modelName, quarters)); Output example: Please enter number of models :3 1) Please enter model name 1 :Bezza Please enter sales for quarter 1:10000 Please enter sales for quarter 2:10500 Please enter sales for quarter 3:11000 Please enter sales for quarter 4:9500 2) Please enter model name 2 : Myvi Please enter sales for quarter 1:12000 Please enter sales for quarter 2:13000 Please enter sales for quarter 3:11000 Please enter sales for quarter 4:10000 3) Please enter model name 3 :Axia Please enter sales for quarter 1:9000 Please enter sales for quarter 2:8000 Please enter sales for quarter 3:8500 Please enter sales for quarter 4:7500 Model: Bezza Quarter 1: 10000 Quarter 2: 10500 Quarter 3: 11000 Quarter 4: 9500 Total sales: 41000 Model: Myvi Quarter 1: 12000 Quarter 2: 13000 Quarter 3: 11000 Quarter 4: 10000 Total sales: 46000 Model: Axia Quarter 1: 9000 Quarter 2: 8000 Quarter 3: 8500 Quarter 4: 7500 Total sales: 33000
Expert Answer:
Answer rating: 100% (QA)
java public class Sales private String modelName private int quarters public SalesString modelName int quarters thismodelName modelName thisquarters q... View the full answer
Related Book For
Organizational Behaviour Concepts Controversies Applications
ISBN: 978-0132310314
6th Canadian Edition
Authors: Nancy Langton, Stephen P. Robbins, Timothy A. Judge, Katherine Breward
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
The slurry of Prob. 29.3 is to be filtered in a press having a total area of 8 m 2 and operated at a constant pressure drop of 2 atm. The frames are 36 mm thick. Assume that the filter medium...
-
Suppose we have a binomial experiment with 50 trials, and the probability of success on a single trial is 0.02. Is it appropriate to use the Poisson distribution to approximate the probability of two...
-
Find the slopes of the lines with the given inclinations. 93.5
-
1. Read the text materials on feedforward, concurrent, and feedback control. 2. Read the Control Problem Situation and be prepared to resolve those control problems in a group setting. 3. Your...
-
Blythe Industries Inc. expects to maintain the same inventories at the end of 2012 as at the beginning of the year. The total of all production costs for the year is therefore as, summed to be equal...
-
Why are both ER Diagrams and Relational Modeling needed when a database system is developed?
-
Merchant Company had the following foreign currency transactions: 1. On November 1, 20X6, Merchant sold goods to a company located in Munich, Germany. The receivable was to be settled in European...
-
Using the case below, answer the following questions. 1. What is the ethical issue? 2. Who are the stakeholders? 3. How would you apply each of the 5 moral principles when attempting to assess the...
-
ABC Ltd have purchased a new piece of equipment for their business to increase their operating capacity. The amount that was paid to the supplier is $100,000. Delivery fees to get the equipment to...
-
What evidence did Broadwind management provide to the auditors to support that a decline in sales was temporary? . What evidence would have been sufficient for GT to conclude that the decline in...
-
The band is breaking up and Rob, Sue, Tim, and Vito each want the tour bus. Using the method of sealed bids, Rob bids $3600, Sue bids $4700, Tim bids $3700, and Vito bids $8000 for the bus. Since...
-
) Portfolio (Narrative) Students are required to create a children's story centered around a narrative from the visual, aural, haptic and kinaesthetic perspective of a child. The narrative should be...
-
Learn with an If T=[[-4,-7]] and U=[[1,1],[-1,-4]], what is TU? If the matrix exists, select its size before entering you select undefined.
-
15. If the system of equations x + ay = 0, az + y = 0, ax + z = 0 has infinite number of solutions, then a = ? 16. Find the product: -7 -4 1 1 -4
-
Why are stocks usually more risky than bonds?
-
What might explain low levels of employee satisfaction in recent years?
-
What are the advantages of flextime from an employees perspective? From managements perspective?
-
Describe the four types of intermittent reinforcers.
-
Smart Manufacturing Systems Pty Ltds accountant recently prepared the following data from the companys accounting records for the year ended 30 June 2019. Factory overhead is applied at the rate of...
-
During the year ended 30 June 2019, Beautiful Bottles Pty Ltd incurred the following costs in connection with its production activities. Required (a) Calculate the relationship between factory...
-
Telecommunications company Toronto Ltd signed a 15year deal to sell capacity on its cable network to a rival company for $200 million. The deal was completed on the last day of Toronto Ltds financial...
Study smarter with the SolutionInn App