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

  Definition of a method named copy receives

Write the definition of a method named copy receives a reference to a Scanner object associated with a stream of input. The method reads all the Strings remaining to be read from the stream and displays them

  Write an advanced java program for the game blackjack

Write an advanced java program for the game blackjack according to the following below data flow diagram

  String as input and returns the reverse of that string

Write a method that takes a String as input and returns the reverse of that String. Then write a second method that uses the first method to test whether or not an input String is a palindrome.

  Create a login form

In this week's lab, we will create a login form, validate a user based on their login name and password, and allow them to access the system or not

  Java program that prompts the user to input an integer

Write a Java program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits.

  Write a generic linked list tree

Write a generic linked list tree and a generic linked list binary search tree class that inherits from your generic linked tree class

  Part-1inheritance write code using eclipse and output

part-1inheritance write code using eclipse and output screenimplement a subclass square that extends the rectangle

  Implement savings account using locks and conditions

A savings account object holds a non-negative balance - Use a shared counter protected by test-and-test-and-set lock. Each thread locks the counter, increments it, releases the lock, and repeatedly reads the counter until it reaches n.

  Write an enhanced for loop

Write an enhanced for loop that counts how many numbers in an ArrayList object named list are negative. Print the count after the loop terminates

  Write a program that uses a dynamic list of strings

Write a program that uses a dynamic list of strings to keep track of a list of chores that you have to accomplish today.

  Compute the daily wage of an employee

Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours add 30% to each excess hours as overtime rate. Formula: Daily ..

  Develop a logical database design

Develop a logical database design (relational schema) for the conceptual data model shown at the end of this document. All relations in your logical database design should be normalized to the third Normal form (3NF).

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