Calculate vehicle registration fees

Assignment Help Computer Engineering
Reference no: EM132106308

Program : Vehicle Registration Program using netbeans .java

This program will be used to calculate vehicle registration fees. It will include a Vehicle parent class, a Car subclass, and a Calculate interface that is implemented by the Car class. The steps are outlined below.

1. Write an interface called Calculate that includes one method - calcFee - that will calculate the registration fee for a vehicle. calcFee returns a float and doesn't take any parameters.

2. Create a class called Vehicle. This class contains the following attributes:

owner (String)
regNumber (int)

The Vehicle class contains methods to set/get owner and regNumber. Its constructor should initialize all variables to 0 or "" (depending on type). Vehicle will have subclasses.

3. Create a subclass of Vehicle called Car that implements the Calculate interface. Car should have additional attributes of:

make (String)
model (String)
regType (String - values will be either "new" or "renew")
regFee (float)

In addition to the get/set methods for make, model, and regType, include the method calcFee, to calculate the registration fee according to the following conditions:

if regType = renew, then the fee is $36
else if regType = new, then the fee is $58.50

NOTE: To compare two strings in Java, use the "equals" method rather than ==; e.g., if (string1.equals(string2))

When getting input from the user using sc.nextInt() (this assumes that you named your Scanner object "sc"), there will be a newline left in the buffer. Simply put the statement sc.nextLine() after your sc.nextInt() statement to clear the newline from the buffer.

4. In your main class for the program, create a car object called myCar (be sure and include make, model, and registration type [either new or renew] in the constructor call statement). Get the following input from the user:

owner name
registration number
make
model
registration type

Calculate the registration fee, then display the owner name, registration number, registration type, and registration fee.

NOTE: The following statement will print the result of the calcFee() method with two decimal places (and go to a new line):

System.out.format("Amount: $ %.2f%n", myCar.calcFee());

Reference no: EM132106308

Questions Cloud

Quasi-single case designs fitting into clinical practice : How do you see the information on small group and quasi-single case designs fitting into clinical practice?
Write a program to produce a cross table : Write a program to produce a cross table. This table should be built from a single int8 value provided by the user.
Sigmund freud and karen horney : What is the main sticking point between the theories of Sigmund Freud and Karen Horney? How are their theories alike? Which do you agree with, if either?
Type of diagnoses for the same person : Sometimes many different psychologists come up with different type of diagnoses for the same person. How these different psychologists
Calculate vehicle registration fees : This program will be used to calculate vehicle registration fees. It will include a Vehicle parent class, a Car subclass, and a Calculate interface.
Psychological disorder impact : Please provide three activities that have severe psychological disorder impact and explain how characteristics of a particular disorder might affect.
Grief issues and attitudes towards grief : Why is it important that the crisis workers address their own grief issues and attitudes towards grief, in working with those who are grieving?
Significant change in problem-solving ability : How Do you put data to demonstrate a significant change in problem-solving ability? Use a two-tailed test with " = .01.
Multifactor leadership questionnaire : Does anyone know the shortest version of the Multifactor Leadership Questionnaire (MLQ)?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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