Implement an integer attribute called seats

Assignment Help JAVA Programming
Reference no: EM132837979

Java Bootcamp

Abstract Classes, Inheritance, and Map

Objectives

In this week's lab, you will:
• use proper Java coding standards
• implement an abstract base class and concrete subclasses
• become familiar with the Java standard library classes by selecting and using a Map class
• design your own solutions to satisfy requirements

You must first have completed all tasks from previous weeks' Bootcamps.

Use the FIT git server: Don't forget to commit each task to your git repository and push them to the FIT git server before you are marked.

Google Java Coding Standards: Your marker will check that you have used proper Java coding standards before marking your work. These include conventions for naming classes, variables, and more. Make sure you have read the standards linked to from Moodie, and adhere to them in your code.

Draw your design: Before you begin coding, you must draw a UML class diagram showing the structure of the AutoShowroom system i.e. after you have implemented all tasks. This means you'll need to think about the design of your system before you implement it! Your diagram must show all classes and the relationships between them: associations, dependencies, and inheritance. You don't have to show attributes and methods.

Put your class diagram in your git repository, so that you have a record of it in case you need to be re-marked for any reason. If possible, please get your class diagram checked by your marker before you start coding.

Task 1. Support for multiple types of vehicles

The car showroom agency has decided to start selling two types of vehicles, which are Sedans and Trucks. Your task is to add new classes that represent sedan and truck cars. You must implement these requirements using inheritance. You need to:

a) Refactor the class Car name to be Vehicle'

video - How to rename a class in IntelliJ?

b) Add another attribute to the Vehicle' class that represents its unique ID and make it an abstract class by adding the keyword 'abstract to its header to look like this:

abstract public class Vehicle {
private String maker;

private String model;

private int vld;

c) Develop two constructors:

1) a two-parameter constructor which accepts the maker and model attributes and generates a random id for the attribute vld (or read it from the user). This piece of code might give you an idea of how to generate a simple random number.

public int nextlD() (
Random r = new Random();
int low = 102e0;//using titerot values is not a good idea, replace them with input parameters int high = 99999;
return (r.nextlnt(high - low) + low);

2) a three-parameter constructor that accepts as input the three attributes of the Vehicle class.

d) Add Sedan and Truck Classes

1) add a new class called 'Sedan' that:
i) extends the Vehicle class
ii) implement an integer attribute called 'seats' that represents the number of seats
iii) implement two constructors to match the parents ones. Both constructors must accept and initialize the value of 'seats'

2) add a new class called 'Truck' that:
i) extends the Vehicle class
ii) implement two integer attributes called 'capacity and 'wheels' that represent the load capacity of a truck (in tons) and its number of wheels
iii) implement two constructors to match the parents ones. Both constructors must accept and initialize the two attributes 'capacity' and 'wheels'
video - How to generate constructors using IntelliJ?

Task 2. Add BidManager Class

We must implement several operations for the vehicles' bids such as add a new bid and find the best/worst bid. To do so, you need:
a) Add a new class that 'has a' list of 'Bid' class called 'BidsManager'. The 'BidsManager class must:
I) In order to ensure, each buyer offers one bid per vehicle, add a HashMap to the BidsManager class where the key is the buyer's id and the value is the bid object.
II) a zero parameter constructor that initializes the HashMap object
III) a method called 'addBid' that accepts three parameters: buyer ID, bid price, and bid date. This method must create and a new instance of the Bid class and puts in the HashMap attribute the <buyerld, bid> pair.
IV) update the Vehicle' class to have an instance of the BidsManager instead of the ArrayList of Bids
HashMap in Java

Task 3. Group classes using packages.

Till this moment, all our classes are under the same package. We must group them by adding multiple packages as follows:
I 'edu.monash.fit2099': root package
II) 'edu.rnonash.fit2099.vehicles': subpackage that contains the classes: Vehicle, Sedan, and Truck
III) 'edu.monash.fit2099.bids': subpackage that contains the classes: Bid and BidsManager
IV)'edu.monash.fit2099.buyers': subpackage that contains the class Buyer.
video- * Java packages in IntelliJ

Task 4. Update AutoShowroom Class

Now its time to create vehicles, buyers, and bids. Add the following methods:
I) createSedan(): responsible for creating a new Sedan and add it to the array list of Vehicles. You must read from the user, the maker, model, and seats. Up to your design, you can also read the vehicle ID or generated internally.
II) createTruck(): responsible for creating a new Truck and add it to the array list of Vehicles. You must read from the user, the maker, model, wheels, and capacity. Up to your design, you can also read the vehicle ID or generated internally.
III) createBuyer(): responsible for creating a new Buyer and add it to the list of buyers. You must read from the user, the buyer's given name and family name.

IV) createBid(): responsible for creating a new Bid and add it to its corresponding vehicle. You must read the vehicle ID, buyer ID, price, and date. You need to search the list of vehicles to find the one that matches the given id, and then add the new bid to it.
V) displayFleet() and displayBuyers(): these two methods are responsible for printing the list of vehicles and buyers
Ms How to read from the console in Java?

Task 5. Update the console menu items

Include all the features you have implemented so far. The following recording should give you an idea about the required menu items.
Video - Expected Output

Task 6. Upload your code to Gitlab

Attachment:- Java Bootcamp.rar

Reference no: EM132837979

Questions Cloud

What is her yearly amortization : If money is worth 8% compounded annually, what is her yearly amortization if all payments are to be made at the beginning of each year
Result of trade and investment liberalization : Today's economy is becoming increasingly globalized as a result of trade and investment liberalization and consequently businesses are looking beyond
Distinctions between social change and advocacy : Post your perspective on the distinctions between social change and advocacy. Discuss the implications of these distinctions and differences.
Explain the optimal communication for each stakeholder : Explain the optimal communication for each stakeholder (e.g., oral, written, face-to-face) and the considerations that would be best practices in any plan.
Implement an integer attribute called seats : Implement an integer attribute called 'seats' that represents the number of seats and implement two constructors to match the parents ones. Both constructors
What amount reduces the net equipment account : Consolidation eliminating entry (R), on the consolidation working paper for 2018, reduces the net equipment account by what amount?
How much is the capital of Dany after admission of Del : Del is admitted as a new partner into the partnership with 20%interest upon investment of P200,000. How much is the capital of Dany after admission of Del
Analyze the implementation of patient safety and quality : Begin your initial post with a one-sentence summary of your proposal topic. Then, give a brief description of the activities leading to achieving the objectives
How much is the total bonus : How much is the total bonus if the vice president gets 3% and each division manager gets 1% of profit after bonuses but before income taxes

Reviews

len2837979

3/23/2021 10:50:32 PM

Plz so W4 tasks using W2 and W3 files Pls write down how to get answers Thx

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