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
-
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?
-
At the end of the current year, Accounts Receivable has a balance of $3,460,000, Allowance for Doubtful Accounts has a debit balance of $12,500, and sales for the year total $46,300,000. Bad debt...
-
The management of Wheeler Company has decided to develop cost formulas for its major overhead activities. Wheeler uses a highly automated manufacturing process, and power costs are a significant...
-
Suppose that when you lie on your bed, your body is supported by 30 of the springs in the mattress. Assuming that all the springs are identical and that your body presses on each spring equally,...
-
Gansac Publishing Company signed a contract with an author to publish her book. The signing took place on January 1, 2016, and a payment of $20,000 was made to obtain a copyright. Gansac expects to...
-
Consider the following information about a mobile car wash business Joel opened last year: Price = $20 per unit Quantity sold = 39,196 Implicit cost = $61,977 Average material cost = $9 per unit...
-
Read the article About Global Leadership and Global Ethics, and a Possible Moral Compass: an Introduction to the Special Issue and write a summary about it
-
A four person family applies for a two-bedroom apartment at a tax credit property. The two person income limit is $24,840. The three person income limit is $27,600. The four person income limit is...
-
You learned that price elasticities of demand and supply are important for understanding the response of consumers and producers to changing demand and supply conditions. If any producer faces a...
-
Consider the expression for the consumption of Type A individuals and Type B individuals that was provided in the lecture notes. In class and in the notes we asserted that Type A individuals receive...
-
Given sin x= 4/7 and cos x= -(square root of 33) divided by 7,find cot x. On the square root only square root the 33 so -/33.
-
An economy is based on three sectors-agriculture, manufacturing, and services. For each unit of output, agriculture requires inputs of 0.30 unit from agriculture, 030 unit from manufacturing, and...
-
The management of Penfold Corporation is considering the purchase of a machine that would cost $340,000, would last for 4 years, and would have no salvage value. The machine would reduce labor and...
-
Presented below are income statements prepared on a LIFO and FIFO basis for Kenseth Company, which started operations on January 1, 2024. The company presently uses the LIFO method of pricing its...
-
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...
-
A running mountain lion can make a leap 10.0 m long, reaching a maximum height of 3.0 m. a. What is the speed of the mountain lion just as it leaves the ground? b. At what angle does it leave the...
-
In punting a football, the kicker tries to maximize both the distance of the kick and its hang timethe time that the ball is in the air. A kicker gets off a great punt with a hang time of 5.0 s that...
-
Emily throws a soccer ball out of her dorm window to Allison, who is waiting below to catch it. If Emily throws the ball at an angle of 30 below horizontal with a speed of 12 m/s, how far from the...
Study smarter with the SolutionInn App