Program that asks how many automobiles are to be described

Assignment Help JAVA Programming
Reference no: EM13950563

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

Questions Cloud

How much would you need to earn in salary : Given that historical inflation rates have averaged 4% over the past 50 years, how much would you need to earn in salary 25 years from now to equal the 75K that you currently make?
Clearly connect to supportive evidence : Write a 750- to 1,050-word paper describing how ethical principles can address organizational issues. Include the organization you selected and discuss the following with regards to that organization and its
What are the effects of contracts on the income distribution : Prepare the necessary eliminations for the consolidated worksheet on December 31, 20X1. What are the effects of these contracts on the income distribution schedules?
Determine the mass flow rate : If the throat area is 7.6 3 1024 m2, and the exit plane pressure is 2.4 bar, determine the mass flow rate, in kg/s, and the exit area, in m2.
Program that asks how many automobiles are to be described : 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.
What is the most important finding offered in this work : What is the most important finding offered in this work? What is her method for gathering the data that led to this study, and why does she choose these methods
Converging-diverging nozzle : A converging-diverging nozzle operates at steady state. Air as an ideal gas with k 5 1.4 flows through the nozzle, discharging to the atmosphere at 14.7 lbf/in.2 and 5108R. A normal shock stands at the exit plane with px 5 9.714 lbf/in.2 The exit ..
Prepare a partial trial balance using the data from entries : Prepare a partial trial balance using the data from your entries, and show the eliminations relating to the contract for the December 31, 20X1, consolidated worksheet.
Compare and contrast solicited and unsolicited proposals : Compare and contrast solicited and unsolicited proposals. Which do you think is harder to write? Why?; and Given your academic major and/or your chosen career field, describe a situation where you would write an unsolicited proposal to either an inte..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create an application that uses a graphic interface

Create an application that uses a graphic interface to capture room assignment data for dormitory residents and writes that data to a random access output file.

  Point class that represents points on an x, y axis

Write a Point class that represents points on an x, y axis. The data members should be doubles x and y plus an int value called count that represents the number of points currently instantiated

  What things are you struggling to understand

Discuss your experiences with the programming assignment - what things are you struggling to understand?

  Take a position on whether or not an object-oriented

take a position on whether or not an object-oriented approach can be used to develop any type of system. provide two

  Object-oriented application to manage students

GPA is calculated using the Quality Point algorithm (each A is worth 4 points, B - 3, C - 2, D - 1, F - 0; Find the sum of that value times the number of credits for all courses, then divide by the total number of credits.).

  Ask the user to enter a positive non-zero integer value.

Write a program which aske the user to Enter a positve non-zero integer value. if the value enterd zero or negative print as error message and end the program; otherwise, use the integer to call a method displayPattern(n) which must display the follo..

  Write a program called drawing in the form of a public class

Write a program called Drawing in the form of a public class Drawing that extends a Java JFrame and provides the following features.

  Describe the basic c syntax for creating a class comprise

explain the basic c syntax for creating a class. include an explanation of the private and public section of a class

  Implement the nested loops

The user has also already entered a mystery number they want the following series to calculate based upon their current numbers (also relatively logical in size).

  How is the location of the click point determined

When a mouse event is generated how is the location of the click point determined?

  Develop an application that counts the number of words

Develop an application that counts the number of words, number of characters with spaces and without spaced

  Program to calculate semester grade based on the scores

Write a java application program that takes in user input from keyboard and calculate semester grade based on the scores. I need help, to rewrite the program, instead of taking keyboard input, you will use dialog box to prompt user, take input, an..

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