[Solved] Solution Write the solution algorithms and the corresponding flowcharts

$25

File Name: Solution_Write_the_solution_algorithms_and_the_corresponding_flowcharts.zip
File Size: 668.82 KB

SKU: [Solved] Solution Write the solution algorithms and the corresponding flowcharts Category: Tag:
5/5 - (1 vote)

Write the solution algorithms and the corresponding flowcharts to solve each one of the following two problems:

1. Car ClassDesign a class named Car that has the following fields:yearModel: The yearModel field is an Integer that holds the cars year model.make: The make field references a String that holds the make of the car.speed: The speed field is an Integer that holds the cars current speed.In addition, the class should have the following constructor and other methods:Constructor: The constructor should accept the cars year model and make as arguments. These values should be assigned to the objects yearModel and make fields. The constructor should also assign 0 to the speed field.Accessors: Design appropriate accessor methods to get the values stored in an objects yearModel, make, and speed fields.accelerate: The accelerate method should add 5 to the speed field each time it is called.brake: The brake method should subtract 5 from the speed field each time it is called.Next, design a program that creates a Car object, and then calls the accelerate method five times. After each call to the accelerate method, get the current speed of the car and display it. Then call the brake method five times. After each call to the brake method, get the current speed of the car and display it.

2. Employee and ProductionWorker Classes Design an Employee class that has fields for the following pieces of information:Employee nameEmployee numberNext, design a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following information:Shift number (an integer, such as 1, 2, or 3)Hourly pay rateThe workday is divided into two shifts: day and night. The shift field will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Design the appropriate accessor and mutator methods for each class.Once you have designed the classes, design a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the objects fields. Store the data in the object and then use the objects accessor methods to retrieve it and display it on the screen.

Submission Requirements:

Create a word document including the class table, the class diagram, the algorithms, the flowcharts, and the output generated for each problem

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Solution Write the solution algorithms and the corresponding flowcharts[Solved] Solution Write the solution algorithms and the corresponding flowcharts
$25