Design "getter" methods for make and color

Assignment Help Computer Engineering
Reference no: EM1335167

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: EM1335167

Questions Cloud

Examine the contribution that automatic stabilizer : Examine the contribution that automatic stabilizers play in creating a stable economy.
Speculating the deliverables of the project : Also, speculate the deliverables you would provide if you are working on the project.
Evaluate discipline processes and grievances procedures : What techniques are best suited to investigate and resolve employee grievances and complaints and What criteria will you use to evaluate discipline processes and grievances procedures?
Explain economic transition- comparison of two countries : Explain Economic Transition- Comparison of two countries and Corporations entering new countries find different political and economic systems
Design "getter" methods for make and color : make 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.
Elulcidate briefly the fundamental determinants of economic : Elulcidate briefly the fundamental determinants of economic growth and development.
Case of promotion : Supervisors need to understand the computerized inventory system and Aaron did not, despite his attempts to understand it.
Combating terrorism : What is PL 107-56 and is it the right approach to combating terrorism?
What makes an effective leader : To what extent, if at all, should leaders change their style to adapt to the characteristics and needs of their followers?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Potential vulnerabilities in purchasing with a debit card

Recognize any potential vulnerabilities in the act of forming a purchase along with a debit card.

  Program is re-written so it requires less memory

Cache misses are classified into one of three categories - compulsory, capacity, or conflict.

  Define the criteria for go vs. nogo

The final phase of a project is the close-out also known as the post mortem. When the project reaches this phase, the project has been successfully delivered and all tasks are complete. What do you think detail tasks in this phase must be.

  Write a research report on design of a cisco router

Systems research and investigate novel ideas and applications.

  Designing a solution to the problem

Designing a solution to the problem and implementing the design using principles of correct syntax

  Explain the averaging algorithm

Explain the averaging algorithm

  Write down a program to test class rectangle

make a class Rectangle. The class has attributes length and width, each of which defaults to 1. It has methods that calculate the perimeter and the area of the rectangle

  How important is it to keep the site current

How important is it to keep the site current.According to "Putting Business Online Isn't Always Easy" (2005), "the biggest mistake people make is failing to know the commitment a Web site demands."

  Program on strings s1 and s2

Program on strings s1 and s2.

  Write a function that creates a cell and structure array

Write a function that creates a cell and structure array.

  How dedicated technician to maintain your wan interfaces

When there is a network outage, how do companies find out the network boundary.

  In-house development of software

Discuss the innovative and creative ways in order to use patient ID bracelet consisting of a bar-code representation of patient's ID.

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