Program that asks user how many automobiles are to describe

Assignment Help Programming Languages
Reference no: EM13948946

Write a program that asks the user how many automobiles are to be described, and for each automobile it inputs the user's selection of make and color. Then it outputs color and make. Although you could do this easily using a simple procedural program, do it by using a main method in class AutomobileDriver to instantiate an object called auto from a class Automobile.

In the Automobile class, do the following:

Create a setMake() method. In this method, prompt the user "Input make of auto: ". Store their input into a make variable.
Create a setColor() method. In this method, prompt the user "Input color of auto: ". Store their input into a color variable.
Create "getter" methods for make and color.
Create a printAll() method. In this method, print the color and make of the automobile on one line in accordance to the sample session given below.

In the AutomobileDriver class, do the following:

Create an instance of Automobile.
Call the setMake() method.
Call the setColor() method.
Call the printAll() method.

Be sure your output is similar to the following:

How many autos do you want?: 2
Enter make: Honda
Enter color: Blue

Enter make: Chevy
Enter color: Red

You have a Blue Honda.
You have a Red Chevy.

Reference no: EM13948946

Questions Cloud

What is the significance of the correlations : What is the strength of the correlations between the variables? What measure of quality is impacted most by relationship conflict? Task Conflict? What is the significance of the correlations?
What per-unit inventory cost reported on grehans sheet : What per-unit inventory cost will be reported on Grehan's balance sheet at the end of the year? What will be the reported income?
Most expensive type of external financing of equity : What is the most expensive type of EXTERNAL financing of equity for a company? Why? How can a company use economies of scale when it comes to external raising of capital through equity? Describe the types of fees that are typically included in flotat..
What is the firm weighted average cost of capital : The Imaginary Products Co. currently has debt with a market value of $250 million outstanding. The debt consists of 9 percent coupon bonds (semiannual coupon payments) which have a maturity of 15 years and are currently priced at $983.90 per bond. If..
Program that asks user how many automobiles are to describe : Write a program that asks the user how many automobiles are to be described, and for each automobile it inputs the user's selection of make and color. Then it outputs color and make.
Barter economy versus an economy : Would you be willing to give up your checkbook and instead use an electronic means of payment if it were made available? Why or why not?
What is current cost of common equity for firm-common stock : Underestimated Inc.’s common shares currently sell for $40 each. The firm’s management believes that its shares should really sell for $47 each. What is the current cost of common equity for the firm? what is the cost of common stock for Whitewall?
How you are feeling about your ability to make this change : Describe challenges you anticipate in your journey toward improving your health. Include an explanation of how you plan to overcome those challenges. Describe how you are feeling about your ability to make this change
Review and reflect on the diverse working environments : What were the most compelling points from the interaction with your fellow students - how does understanding leadership and diversity help you lead others through challenges associated with typical discriminatory behaviors in the workforce?

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to print a business travel expenses

Write a program to print a business travel expenses attachment for an income tax return.

  Implement a program that prompts the user for an integer

Implement a program that prompts the user for an integer n and prints the nth Fibonacci number, using the above algorithm.

  Insert a text box after the paragraph and type your name

Create a two column table with a minimum of seven rows. You may add additional rows as needed to hold additional hyperlinks that you feel will be useful to you as you progress through your degree.

  Modify the pseudocode and optimize it.

Provide valid reasons why the pseudocode is now more efficient.

  Write application to use random-number to create sentences

Write an application that uses random-number generation to create sentences. Use four arrays of strings called article, noun, verb and preposition.

  Write a program that reads the coordinates

Write a program that reads the (x,y) coordinates of a point in the Cartesian plane and prints a message telling in which quadrant, or on which axis (or axes) the point lies. The quadrants are labeled as follows:

  Develop a concentration game

Concentration, also known as Shinkei-suijaku, Memory, Pelmanism, Pexeso or simply Pairs, is a card game in which all of the cards are laid face down on a surface and two cards are flipped face up over each turn.

  Design program to asks for number of fat grams

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories are not less than 0.

  Explain the importance of usability when designing a website

Explain the importance of usability when designing a website and develop a set of recommendations for website usability

  Steps in preparing a high level language program

Describe the purpose of each step in preparing a high level language program for execution (editing, compiling, linking, and loading).  Include in your description the types of files created with each of the first three steps.?

  Evaluate the arithmetic expressions

Prepare a Lisp program to evaluate the arithmetic expressions - If the input is legal, your program should output the final result of the expression evaluation, as given in the above case. If the input is illegal, the result is undefined, i.e., you..

  Create and write payroll program to prompt user for input

Create and write a payroll program that will prompt the user to enter employee's hourly pay rate and the number of hours worked.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd