Lab Exam Midterm
Lab Exam Midterm
ASSESSMENT TASK
[READ ALL THE INSTRUCTIONS VERY CAREFULLY BEFORE YOU SUBMIT]
Write a java application that calculates and displays the property tax for N property owners.
N should be declared as a constant and it should be equal to the largest digit of your student
ID number
E.g. if your ID number is 15-10380-1 then N should be equal to 8 and you can
declare it as final int N=8
The property tax is based on the assessed value of the property as shown below in Table-1.
The application should ask the user to enter the name of the property owner and the
assessed value of the property for each owner (total N owners) and calculate the
property tax.
The application should display the message with tax and the value of the property after tax
as shown in the example below.
At the end of the Nth owner, a receipt with total tax, largest tax and average tax should be
displayed.
The total tax is calculated by adding the tax amount for all owners.
The largest tax is calculated by finding the largest amount from tax paid by N
owners.
The average tax is calculated by dividing the total tax with the number of owners.
INPUT & OUTPUT FORMAT
The format for your input and output must be same as given in example below.
Example for N=3 (Note that a loop should be used for reading the input and displaying the output)
Enter the name for Owner 1: Tim Pointing
Enter the value of the property for Owner 1: 9500
Hello Tim, your tax is $0 and the value of the property after tax is $9500.
The application should be user-friendly by displaying appropriate welcome and exit messages.
The application should use the following classes and methods.
g. A method that computes the distance from the lon and lat of one city to the lon and lat of
another city. Use the standard distance formula to compute this value (let’s pretend that
the cities lie on a flat plane and not on a sphere!) Here’s a method header to get you
started:
public double distanceFrom(City otherCity)
City # 2
Enter name: Chicago
Enter longitude: 25
Enter latitude: 10
City # 3
Enter name: LA
Enter longitude: 0
Enter latitude: 50
--------