Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment

Aim

The aim of this assignment is to add a class to the project that you developed for the first part of the coursework to make a graphical user interface (GUI) for a system that stores details of cars in a car company. The class will contain a main method and will be tested using the command prompt. A learning aid about the command prompt is linked from the main index page of the learning materials. You will also need to write a report about your program. You are advised to study the learning aid on reflective practice, which is also linked from the module in WebLearn. Your report should be no more than 1200 words in length (excluding the cover page, table of contents, class diagram, pseudocode and code listing).

Your GUI should contain the same components but you are free to use a different layout if you feel that it improves the aesthetics, ease of use etc. The CarCompany class should store an array list (not an array) of type Car to hold the cars tobuy and the cars to rent.

Text field input methods

For each text field, write a method to read its contents and return the value. For the description, customer name, rental date and return date, the value should simply be returned as a string but, for the other text fields, the input value should be converted into its correct integer data type and then that numerical value should be returned.

There should be text fields for entering:

(1) the price
(2) the year of registration
(3) the mileage
(4) the description
(5) the admin fee
(6) the daily rate
(7) the customer name
(8) the rental date
(9) the return date
(10) the number of days
(11) the car number (its position in an array list of cars)

The input method for the car number is different from the input methods for the other text fields. The method first initialises the car number to -1. If the input from the user via the GUI is valid, the car number will be changed from -1 to a value that corresponds to a car in the array list. The input from the car number text field must therefore be tested using a try/catch statement to ensure that the car number entered is an integer and, if it is, that it is in the correct range. If the value

entered is an integer but is not in the correct range, a suitable error message is displayed using a message dialog box. If the car number entered is not an integer then an alternative error message is displayed using a message dialog box. The method will therefore either return -1 or a value that corresponds to a car in the array list, depending on whether or not there was an error in the input. Any method that gets the car number should check its value and only use it if its value is not equal to -1.

Buttons

The GUI should have the following buttons:

1) Add Car To Buy

The description, price, year and mileage are input via the GUI. When this button is pressed, the methods to get the description, price, year and mileage are called, and these values are used to create a new object of type CarToBuy, which isadded to the array list of cars.

2) Add Car To Rent

The description, admin fee and daily rate are input via the GUI. When this button is pressed, the methods to get the description, admin fee and daily rate are called, and these values are used to create a new object of type CarToRent, whichis added to the array list of cars.

3) Buy Car

The car number and the customer name are input via the GUI. When this button is pressed, the method to get the car number is called and its value is checked. If it is not equal to -1, the method to get the customer name is called, the method to get the car from the array list is called and the car is cast to CarToBuy, then the method from the CarToBuy class to buy the car is called.

4) Rent Car

The car number, customer name, rental date, return date and number of days are input via the GUI. When this button is pressed, the method to get the car number is called and its value is checked. If it is not equal to -1, the methods to get the customer name, rental date, return date and number of days are called, the method to get the car from the array list is called and the car is cast to CarToRent, then the method from the CarToRent class to rent the car is called.

5) Return Car

The car number is input via the GUI. When this button is pressed, the input value of the car number is checked. If a suitable value has been entered, the method to get the car number is called and its value is checked. If it is not equal to -1, the method to get the car from the array list is called and the car is cast to CarToRent, then the method from the CarToRent class to return the car is called.

6) Display All

When this button is pressed, the car number and the information relating to that car is displayed for each car, for example:

7) Clear

When this button is pressed, the text is cleared from all of the eleven text fields.

Report

For the report, marks will be awarded as follows:

A class diagram of just the CarCompany class showing the name of the class, the data types and names of the fields, and the return types and signatures of all of the methods

A short description of each method in the CarCompany class

Pseudocode for the following button-handling methods in the CarCompany class:

1) Add Car To Buy
2) Add Car To Rent
3) Buy Car
4) Rent Car
5) Return Car
6) Display All

You should give evidence through appropriate screenshots of the following testing that you carried out on your program:

1) Test that the program can be compiled and run using the command prompt, including a screenshot similar toFigure 1 from the command prompt learning aid.

2) Test the following:adding a car to buyadding a car to rentselling a carrenting a carreturning a cardisplaying all of the cars

3) Test that appropriate dialog boxes appear when unsuitable values are entered for the car number, (include a screenshot of the dialog box, together with a corresponding screenshot of the GUI, showing the values that were entered).

The report should contain a section on error detection and error correction where you give examples and evidence of three errors encountered in your implementation. The errors (syntax and/or runtime) should be distinctive and not of the same type.

The report should contain a conclusion, where you evaluate your work, reflecting on what you learnt from the assignment. You are advised to study the learning aid on reflective practice, which is linked from the module in WebLearn.

The report should include a title page (including your name and ID number), a table of contents (with page numbers), and a listing of the code (in an appendix). Marks will also be awarded for the quality of writing and the presentation of the report.

Attachment:- Coursework.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M92794758
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in Java

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As