Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Perodua is a car manufacturer, offers a broad range of vehicles. Among the best perodua models are Myvi, Bezza, Aruz, Ativa and Axia. The

imageimage

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

Step by Step Solution

3.26 Rating (170 Votes )

There are 3 Steps involved in it

Step: 1

java public class Sales private String modelName private int quarters public SalesString modelName int quarters thismodelName modelName thisquarters q... 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_2

Step: 3

blur-text-image_3

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

Organizational Behaviour Concepts Controversies Applications

Authors: Nancy Langton, Stephen P. Robbins, Timothy A. Judge, Katherine Breward

6th Canadian Edition

132310317, 978-0132310314

More Books

Students also viewed these Programming questions

Question

Describe the four types of intermittent reinforcers.

Answered: 1 week ago

Question

Evaluate each of the following, accurate to the nearest cent.

Answered: 1 week ago

Question

Evaluate the answers accurate to the cent.

Answered: 1 week ago

Question

Evaluate each of the following, accurate to the nearest cent.

Answered: 1 week ago