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

  Write down c function that includes the following sequences

Run program and explain the results. Rewrite same code in C++ and Java.

  Creating different volume such as the striped, mirrored

What should you do in order to create a different volume kind such as the striped, mirrored, or Raid 5 volumes? Why utilize the Windows command line when we live within the GUI world?

  Code memory contents of code address instruction

make Use of the nine PAL instructions listed below to solve the problems.

  The hard drive will the original query take

suppose (somewhat artificially) that RAM can hold 200 rows and devotes half of that to reading one table and half to reading the other table and has "other places" to store the subquery/query results.

  Write down one method containing string manipulations

Program should include a method for each element. Write one method containing String manipulations, one that includes if-else statements, and one that includes a switch.

  Modify an instance of the class polygon

suppose you are participating in a big project that deals with points in a two-dimensional plain

  How much of a disadvantage computer scientists have

Philosophy is deeply rooted in the History of Computers starting with Leibniz and his concept of binary. Leibniz's dream imagines Armchair Philosopher to be left alone with his thoughts while machines take care of all the other menial tasks requir..

  Compare and contrast two network operating systems

Why these would be appropriate for a client - in helping them make the best decision for their organization - as they would like to have a networking system which links the systems of all of their locations.

  Define the way for creating work breakdown structure

Define the way for creating work breakdown structure Use a hypothetical project to illustrate your understanding of the WBS.

  Suppose that a unique priority number is associated

find an election algorithm for bidirectional rings that is more efficient than the ring algorithm.

  What is the load balancing

What are your different options (in general and with Apache) for load balancing.

  Organizations attempting to regulate the networking field

define whether there are too many standards organizations attempting to regulate the networking field. Take into consideration whether consultation is necessary, and whether governmental or larger international bodies should be formed to manage st..

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