This section will count for 70% of Test 3's grade. a. (100pts) Write a program to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3. This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3. This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3. This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3. This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3. This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3. This section will count for 70% of Test 3's grade. a. (100pts) Write a program to define a class Car according to the following UML. Please note that this is only a definition class, so there is no main method in the class. name: String mileage: int - isManual: boolean Car - carAmount: int //Increments by 1 when a new Car is created + Car (name: String, mileage: int, isManual: boolean) + getName(): String + setName (name: String): void + getMileage (): int + setMileage (mileage: int): void + isManual (): boolean + setIsManual (is: boolean): void + getCarAmount(): int b. (100pts) Based on the Car class, write a program named CarTest that completes the following tasks. Create an array with 3 Car objects. Use a for loop to initialize the array using user's inputs for name, mileage and whether the car has a manual transmission for each car. (Hint: use input.nextLine () to receive user's input for car name because car names could consist of more than one word.) Use a for loop to display the cars' names and their mileages in a table format. Use a for loop to calculate the average mileage of all cars. Display the average mileage of the cars. Display how many cars there exists using the getCarAmount () method. A sample execution of the CarTest program is given below: Please enter the car's name: Honda Civic Please enter the car's mileage: 61000 Please enter whether the car is manual (true/false): false Please enter the car's name: Ford Bronco Please enter the car's mileage: 11000 Please enter whether the car is manual (true/false): true Please enter the car's name: Toyota Corolla Please enter the car's mileage: 39000 Please enter whether the car is manual (true/false): false Car Mileage Honda Civic | 61000 Ford Bronco | 11000 Toyota Corolla | 39000 The average mileage of all cars is 37000.0 The amount of cars that exist is 3.
Expert Answer:
Related Book For
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg
Posted Date:
Students also viewed these programming questions
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
State SQL query to satisfy the requirements below: Include the following columns: First Name Last Name Return all rows from the people table where the person's last name is between B and H. Use the...
-
Nation Financial Services is considering two plans for raising $600,000 to expand operations. Plan A is to borrow at 5%, and plan B is to issue 100,000 shares of common stock at $6.00 per share....
-
Select a firm such as The Agricultural Development Association. Answer the following questions * A brief description of the firm's background, such as products, environment and services it provides,...
-
How to draft an answer to a complaint?
-
Water flowing at 2 kg/s through a 40-mm-diameter tube is to be heated from 25 to 75C by maintaining the tube surface temperature at 100C. (a) What is the required tube length for these conditions?...
-
On July 1, 2015, X Co. purchased inventory from its main foreign supplier, Big Bird Systems, at a cost of FC 12,000. X Co's year end is on July 31. Payment of FC 12,000 for the inventory is due on...
-
(a) The steps in the accounting cycle for a merchandising company differ from the steps in the accounting cycle for a service company. Do you agree or disagree? (b) Is the measurement of net income...
-
1. Write a function that draws a grid like the following: FA + Hint: to print more than one value on a line, you can print a comma- separated sequence of values: print('+', '-') By default, print...
-
Suppose f is a one-to-one, differentiable function and its inverse function f-1 is also differentiable. One can show, using implicit differentiation (do it!), that Find (f)'(-4) if f(1) = -4 and...
-
Consider the impact of framing devices on the structure of a narrative. How do authors like Mary Shelley in "Frankenstein" or Joseph Conrad in "Heart of Darkness" utilize framing techniques to...
-
Scenario: In light of the growing success of developments in supersonic flight, you have joined a startup company in the aerospace industry. You are responsible for designing the rocket system for...
-
Provide analysis on the concept of event marketing and its importance of customer engagement and brand development.? Explain the importance of an event marketing plan.
-
Examine the significance of temporal shifts and flashbacks in narrative structure. How do authors like Toni Morrison in "Beloved" or Kurt Vonnegut in "Slaughterhouse-Five" utilize these techniques to...
-
a. Calculate the gravimetric water content of a soil that has anoven-dry weight of 87 g and an air-dry weight of 100 g. b. Calculate the oven-dry weight of 120 g of air-dry soil thathas a gravimetric...
-
The following items were displayed in the statement of affairs for Lubbock Company: Fully secured liabilities ......... $90,000 Partially secured liabilities ....... 12,000 Unsecured liabilities...
-
Use the data of Problem 3 in Chapter 5 to answer the following questions. In Problem 3 Chapter 5 a.-b. Answer the same questions as in parts (a) and (b) of Problem 1 for the regression of TIME (Y) on...
-
This question refers to the U.S. News & World Report mutual fund data presented in Problem 19 in Chapter 17. The variables described in that question were: CAT (fund category): 1 = Aggressive growth;...
-
In the problems below, assume that a significance level, a, of 0.05 and a power, (1 /3), of 0.8 are desired unless otherwise stated. A clinical trial is to be conducted to investigate and compare...
-
True or False. The Euler-Bernoulli beam theory is more accurate than the Timoshenko theory.
-
Find the free-vibration solution of a cord fixed at both ends when its initial conditions are given by \[w(x, 0)=0, \quad \frac{\partial w}{\partial t}(x, 0)=\frac{2 a x}{l} \quad \text { for } \quad...
-
What is the main difference in the nature of the frequency equations of a discrete system and a continuous system?
Study smarter with the SolutionInn App