Creating a system for the traffic portion

Assignment Help JAVA Programming
Reference no: EM133389668

Part 1: demonstrate inheritance of classes

You are creating a system for the traffic portion of a police department in a new source package named traffic. It will one day be placed in new handheld computers so the officers on traffic duty can print these tickets from handheld computers. Java is a perfect language to make this kind of application as we learned earlier in the course. There are several types of Ticket though so this is a perfect one to demonstrate inheritance with.
Every Ticket has a Tag (license plate number), Make, Model, and Color.
Each Ticket also has a special version.....these are the inheriting classes....
A TimeExpiredTicket is a Ticket for a car parked too long in a timed zone or when a parking meter has no time left and shows the expired flag while the car is there. This type of ticket has a $50 charge.
A HandicappedTicket is a Ticket for a car parked in a handicapped zone with no handicapped permit on it. This type of ticket has a $100 charge.
A FireLaneTicket is a Ticket for a car parked in fire lane or beside a fire hydrant. This type of ticket has a $150 charge.
Make the ticket super class, and the three subclasses inheriting from it. Then write a class with main() to test your new classes by making at least one object of each of the three types of tickets (expired, handicapped, and fire lane) and later report their information stored in them to the user.
Note: You can put the charge in the a message being printed or as a variable holding the value. It's up to you. You do have to have the tag, make, model, and color along with their gets and sets only in the ticket superclass. You have to demonstrate inheritance here by inheriting from the base class which is holding these values.

Part2: demonstrate Polymorphism of Classes
Make a copy of the part 1 to a new source package named abstarcttraffic and make the following changes:
Your system is going to have to have an array of the different tickets. They are going to be printed and processed in order. This means you have to use polymorphism to do because they are different types of tickets.
Make sure Ticket is now abstract. There are no general tickets. They must all be of one of the subclass types.
Make an abstract method called printTicket() in the base Ticket class.
Make a method called printTicket() in each of the subclasses that prints out the tag, make, model, color, and charge information along with a message for what kind of ticket it is.
In the class testing the classes you created....make an array of tickets including at least one of the three types of tickets (expired, handicapped, and fire lane). Then use a loop to process the whole array and call printTicket() to polymorphically print them all out.

Part 3: Polymorphism of Interfaces
Copy the Account class from your completed assignment 2 to a new source package named accounts.
Create class in the same package accounts with name CarLoan. Carloan class should have a name of type String, amount owed of type double, a rate of type double, and a monthly payment of type double.
Create Interface called iMailable to print the monthly statements for all Accounts and all Carloans in the same print run. It should have one method in it called printStatement()

Demonstrate polymorphism with interfaces by having both Account and Carloan implement iMailable and add code to each to have the printStatement() that prints out their data.

Finally, create class named Bank with only a main method to print statements of an array of iMailables. In the main method, define an array of at least 2 iMailable and have at least one Account and at least one CarLoan in it, and use a loop to call printStatement() to show all the statements of the customers accounts and car loans in this array of the interface.

Reference no: EM133389668

Questions Cloud

Write a program that prompts the user for a measurement : Write a program that prompts the user for a measurement in meters and then converts it to miles, feet, and inches.
Write a 9 x 9 grid sudoku board game in java : Write a 9 X 9 grid sudoku board game in Java. Please make sure it is an interactive game (user will be able to type in their guesses)
Discuss how recent increases in interest rates : Discuss how the recent increases in interest rates by the Bank of Canada have impacted Air Canada and their the stock price for the last 12 months.
How do the articles of confederation reflect where power : How do the Articles of Confederation reflect where power was concentrated, and how the newly created states saw themselves in regards to the new nation
Creating a system for the traffic portion : creating a system for the traffic portion of a police department in a new source package named traffic
What is the tone of jourdon letter : What is the tone of Jourdon's letter? Polite and deferential? Sarcastic and cutting? A mixture of the two (and if so, why do you think he uses both tones)?
Professional goals and trajectory : Make sure you pick a topic that makes sense for your own professional goals and trajectory.
What was mary church terrell approach : What did Booker T. Washington believe was in the best interest of African Americans? What did W. E. B. Du Bois believe to be in the best interest of African
Discuss some of the challenges and benefits of building : Discuss some of the challenges and benefits of building this application as a SPA compared to a traditional multi-paged web application. What are some trade

Reviews

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