The Alset Corporation wants to begin marketing electric vehicles (EVS) to customers. Because the company is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The Alset Corporation wants to begin marketing electric vehicles (EVS) to customers. Because the company is brand new, models and options are very limited. But the customer can select from three models, and a few options are available. Your job is to write a program in Java that will allow employees to set the configuration that the customer wishes. Alset EV Models: ● ● ● Alset EV Options: • All cars feature four doors and come with a charging cable. Type 1 vehicles are painted green and have no other options. Type 2 vehicles are painted blue and have GPS navigation. Type 3 vehicles are painted red, have GPS navigation, and also have a sunroof. ● Type 1: Rear wheel drive, small battery pack (short range) Type 2: Rear wheel drive, medium battery pack (medium range) Type 3: All wheel drive, large battery pack (long range) ● After meeting with the client, the design team determined the following custom class requirements for this program: Class "Alset": • A property called numDoors (integer) with a value of 4 ● A property called chargeCable (integer) with a value of 1 • A property called paintColor (String) with a value of Green ● A property called freeCharge (String) with a value of No • A method called displayInfo() that prints each of these properties on screen like this example: "Number of doors: 4" Class "Type1": Inherits from Alset class • This model does not have any additional features Class "Type2": . Inherits from Alset class • A String property called gpsNav with a value of Yes • A method that overrides displayInfo(), adding a line to report the gpsNav property Class "Type3": • Inherits from Alset class • A String property called gps Nav with a value of Yes A String property called sunroof with a value of Yes • A method that overrides displayInfo(), adding lines to report the gpsNav and sunroof properties When the program runs, present the user with the following menu: Please enter 1 for Type 1, 2 for Type 2, or 3 for Type 3 Use the Scanner class to process input and use IF/ELSE IF/ELSE statements to process the user's choice (like you did with the user's restaurant visits in the Unit 1 lab). For each choice, take the following steps: 1. Declare an object from the appropriate class 2. Set the correct paint color (if type 2 or 3) 3. Execute the displayInfo() method to display the properties of the vehicle on screen. Once the information has been displayed, the program should end. (This program does not require a loop.) NOTE: The paint color may not be set within the Type2 or Type3 classes. 1 import java.util.Scanner; 3 public class LabProgram { public static void main (String[] args) { /* Type your code below this line. Create additional lines as needed. */ } // do not delete this line 9} // do not delete this line 1/* Enter your custom classes below. An example is provided. */ 3 class Alset { The Alset Corporation wants to begin marketing electric vehicles (EVS) to customers. Because the company is brand new, models and options are very limited. But the customer can select from three models, and a few options are available. Your job is to write a program in Java that will allow employees to set the configuration that the customer wishes. Alset EV Models: ● ● ● Alset EV Options: • All cars feature four doors and come with a charging cable. Type 1 vehicles are painted green and have no other options. Type 2 vehicles are painted blue and have GPS navigation. Type 3 vehicles are painted red, have GPS navigation, and also have a sunroof. ● Type 1: Rear wheel drive, small battery pack (short range) Type 2: Rear wheel drive, medium battery pack (medium range) Type 3: All wheel drive, large battery pack (long range) ● After meeting with the client, the design team determined the following custom class requirements for this program: Class "Alset": • A property called numDoors (integer) with a value of 4 ● A property called chargeCable (integer) with a value of 1 • A property called paintColor (String) with a value of Green ● A property called freeCharge (String) with a value of No • A method called displayInfo() that prints each of these properties on screen like this example: "Number of doors: 4" Class "Type1": Inherits from Alset class • This model does not have any additional features Class "Type2": . Inherits from Alset class • A String property called gpsNav with a value of Yes • A method that overrides displayInfo(), adding a line to report the gpsNav property Class "Type3": • Inherits from Alset class • A String property called gps Nav with a value of Yes A String property called sunroof with a value of Yes • A method that overrides displayInfo(), adding lines to report the gpsNav and sunroof properties When the program runs, present the user with the following menu: Please enter 1 for Type 1, 2 for Type 2, or 3 for Type 3 Use the Scanner class to process input and use IF/ELSE IF/ELSE statements to process the user's choice (like you did with the user's restaurant visits in the Unit 1 lab). For each choice, take the following steps: 1. Declare an object from the appropriate class 2. Set the correct paint color (if type 2 or 3) 3. Execute the displayInfo() method to display the properties of the vehicle on screen. Once the information has been displayed, the program should end. (This program does not require a loop.) NOTE: The paint color may not be set within the Type2 or Type3 classes. 1 import java.util.Scanner; 3 public class LabProgram { public static void main (String[] args) { /* Type your code below this line. Create additional lines as needed. */ } // do not delete this line 9} // do not delete this line 1/* Enter your custom classes below. An example is provided. */ 3 class Alset {
Expert Answer:
Answer rating: 100% (QA)
The detailed answer for the above question is provided below Certainly Below is a simple Java program that follows the specifications you provided imp... View the full answer
Related Book For
Advanced Financial Accounting
ISBN: 978-0137030385
6th edition
Authors: Thomas Beechy, Umashanker Trivedi, Kenneth MacAulay
Posted Date:
Students also viewed these programming questions
-
Given the formula Q=wc(T2-T1) Find c when Q=15, W=3.0 ,T1= 110 T2 =60
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Read the case study "Southwest Airlines," found in Part 2 of your textbook. Review the "Guide to Case Analysis" found on pp. CA1 - CA11 of your textbook. (This guide follows the last case in the...
-
A firm has $180 million in annual sales; $40 million of inventory and $60 million of accounts receivable. What is the inventory turnover ratio?
-
Describe the movement of powder particles during compaction. What feature is responsible for the fact that powder does not flow and transmit pressure like a liquid?
-
Carbon dioxide, CO 2 , was shown to effuse through a porous plate at the rate of 0.033 mol/min. The same quantity of an unknown gas, 0.033 moles, is found to effuse through the same porous barrier in...
-
What other types of ordinary shares are there?
-
Transfer pricing, goal congruence. The Bosh Corporation makes and sells 20,000 multisystem music players each year. Its assembly division purchases components from other divisions of Bosh or from...
-
While mixed methods studies are valuable When it is done well, it is very informative, but given the additional coordination and analyses, there is more of a risk that it will be underutilized or...
-
In 2019, Andes Corporation purchases $1.5 mil-lion of machinery (7-year property) and places it into service in its business. What are Andes' depreciation deductions for 2019 and 2020 in each of the...
-
Analiza el siguiente caso. La empresa Imprentas Mexicanas Unidas, S.A. de C.V. contrat hace tres aos un seguro dirigido a negocios con actividades comerciales, industriales y de servicios a la...
-
Calculate the drift and simplify the expression a) y=cos(x) / 1sen(x) b)y=3x7 c) y=cos(x)ln(x)3 d) y=3x^37x+8
-
Two chords cross through a circle and intercept one another at a point on the circumference of the circle, forming an inscribed angle. The measure of the intercepted arc of the angle is 142\deg ....
-
Brianna's Boutique has the following transactions related to its top-selling Gucci purse for the month of October. Brianna's Boutique uses a periodic inventory system. Date October 1 October 4...
-
A rhombus with side 5 has an area of 144 . What is the sum of the lengths of the diagonals?
-
An unbalanced system with masses m = Fig. 2. a) Calculate the mass and location of the masses that need to be placed at planes A and B to dynamically balance the system if, r=4 cm, 7 = 2.3 cm, r =...
-
Part 2: Complete the following calculations Quantity Price Total Revenue Marginal Revenue 0 $22 1 $20 2 $18 3 $16 4 $14 5 $12 6 $10 7 $8 8 $6
-
Fill in each blank so that the resulting statement is true. 83 + 103 = ______ .
-
Pinware Wholesalers Inc. (Pinware) imports high quality goods from select European countries. On May 1, 20X3, Pinware purchased Swiss watches from a supplier in Switzerland for 400,000 Swiss francs...
-
What are the nine unique characteristics of government that influence the government reporting model?
-
Investco Ltd. is a Canadian real estate and property developer that decided to hold a parcel of land in downtown Munich, Germany, for speculative purposes. The land, costing 12,000,000 was financed...
-
Fowler Corporation is engaged in the manufacture and distribution of a variety of chemicals. In analyzing the financial statements of this corporation, why would you want to refer to the ratios and...
-
Net sales of the Oneida General Store have been increasing at a reasonable rate, but net income has been declining steadily as a percentage of these sales. What appears to be the problem?
-
Felker, Inc., experiences a considerable seasonal variation in its business. The high point in the year's activity comes in November, the low point in July. During which month would you expect the...
Study smarter with the SolutionInn App