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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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