Preparing a java program

Assignment Help Data Structure & Algorithms
Reference no: EM1380175

Prepare a program that asks the user how many automobiles are to be explained, 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: EM1380175

Questions Cloud

C program that accepts a month and day : Make a C program that accepts a month and day for example, June 14 from the keyboard as input. Store this data in a string called date.
Finding the values of queuefront and queuerear : Assume that queue is a queue type object and the size of the array-implementing queue is 100. Also, assume that the value of the queueFront is 25 and the value of queueRear is twenty-five.
Creating an automated checkout program : A local department store employee you to create an automated checkout program to expedite customers in a hurry. The checkout line can only allow 5-products for any one purchase.
Java program to make choice for a coffee cup size : Create an application that prompts the user to make a choice for a Coffee cup size, S for Small, T for Tall, G for Grande and V for Venti the rates of cup sizes will be stored in a parallel double array as $2, $2.50, $3.25, and $4.50 respectively.
Preparing a java program : Prepare a program that asks the user how many automobiles are to be explained, and for each automobile it inputs the user's selection of make and color.
Creating villian : Announce a new Villian called sharpay who has a wit of 24, a stealth of sixteen, and who has currently claimed three victims: Chad, Troy, and Gabriella.
Creating a class for services : Make a class for services offered by a hair styling salon. Information fields with a String to hold the service description, a double to hold the price, and an integer to hold average number of minutes it takes to perform the service.
Design and implement a sorting algorithm : Your task is to design and implement a sorting algorithm and running time grows as a linear function of the array
Important java questions : Add a method addText to the Question class, and provide a different implementation of Choice Question that calls add Text rather than storing an array list of selections.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Find cost of sorting the relation in seconds

Suppose you need to sort a relation of 40 gigabytes, with 4 kilobyte blocks, using a memory size of 40 megabytes. Find the cost of sorting the relation, in seconds, with bb = 1 and with bb = 100.

  Creating dataflow diagram

Think about the level of detail involved with creating a dataflow diagram, why should the narrative be prepared? Explain why do we need the questionnaire?

  Js code to prompt the user for integer and print result

Write JS code which prompt the user for an integer and prints the result.

  Describe properties of bfs and dfs for acyclic tree

Analyze the given properties of BFS and DFS for Acyclic Tree without making any assumptions. Optimality, Completeness.

  Determine schedule that obtains maximum amount of profit

Assume you have one machine and a set of n jobs a1, a2, ..., an to process on that machine. Determine the schedule that obtains the maximum amount of profit. Compute the running time of your algorithm?

  Describe sorting algorithm to be parsimonious

Describe a sorting algorithm to be parsimonious if it never compares same pair of input values twice. (Supose that all the values being sorted are distinct.).

  List of common data structures

Make a list of some of the common data structures provided by C#. You should have a minimum of 4 different data types.

  Calculate a three quarter moving average forecast

The Fastgro Fertilizer Corporation distributes fertilizer to various lawn and garden shops. Calculate a three-quarter moving average forecast for quarters 4 through 13 and calculate the forecast for each quarter.

  Find shortest path tree by bellman-ford-dijkstra algorithm

Find the shortest path tree from every node to node 1for the graph of following figure using Bellman-Ford and Dijkstra algorithm.

  Finding page faults for lru replacement algorithms

How many page faults would happen for the given replacement algorithms, assuming one, two, three, and four frames?

  Explaining playout delay algorithm

Let the adaptive playout delay algorithm. Show through simple example that adjusting playout delay at beginning of each talk.

  Explain algorithm which gives initial infection of computer

Explain an O(m+n) algorithm which, given an initial infection of a computer Ca at time t determines for each other computer the earliest time at which it can become infected.

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