Subject code: COIT20245

Subject title: Lawn calculate

Weighting: 20%

Assignment task

Write a java console application for a lawn-mowing service for N lawns. 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 S143261 then N should be equal to 6 and you can declare it as final int N=6). The weekly fee for mowing a lawn is shown below in Table 1.

Table 1. Weekly Fee for Lawn Mowing

Screen Shot 1941-04-19 at 12.31.09 PM 

The application should ask the user to enter the area for each lawn (total N lawns) and calculate the weekly fee for lawn mowing. The application should display the fee for each lawn as shown in the example below. At the end of the Nth lawn, the details such as total weekly fee, lowest weekly fee, highest weekly fee, and lawn number with highest monthly fee should be displayed. The lowest fee is calculated by finding the lowest value from weekly fee for N lawns. The highest monthly fee is calculated by finding the highest value from weekly fee for N lawns. The average lawn moving fee is calculated by dividing the total weekly fee with the total number of lawns. The monthly fee is calculated by multiplying the weekly fee by 4.

Example for N=4

Enter the area for lawn 1: 450

The weekly fee for lawn 1 is $40

 

Enter the area for lawn 2: 600

The weekly fee for lawn 2 is $60

 

Enter the area for lawn 3: 1200

The weekly fee for lawn 3 is $75

 

Enter the area for lawn 4: 3000

The weekly fee for lawn 4 is $100

 

————————————————–Report—————————————————–

Total weekly lawn mowing fee: $275

Lowest weekly lawn mowing fee: $40

Highest weekly lawn mowing fee: $100

Average weekly lawn mowing fee: $68.75

Lawn number with highest monthly fee: 4

——————————————————————————————————————-

Your application is to follow the same format for input and output as in the example above, but with customised welcome and exit messages.

The application is to use the following classes.

public class Lawn

{

public Lawn()

{

// constructor

}

public double lawnMowingFee(double area)

{

// code to calculate lawn mowing fee goes here

}

public int lawnNumber(double fee)

{

// code to determine lawn number with highest monthly fee

}

}

public class LawnTest

{

public static void main(String[] args)

{

//   local variable declarations go here

//   display welcome message

//   loop to input area, calculate and display fee

//   generate and display report

//   display exit message

}

}

Submission:

You must submit the following three files using the Moodle online submission system.

·             Lawn.java

·             LawnTest.java

·             Report.docx (this file contains a brief report that includes student name, student ID number, course name, course code and test results (screenshots/test cases with results to show that your application is working correctly))

 

You can order the COIT20245: Lawn calculate Assignment 1 from our service and receive a completely high-quality custom paper. Our service offers any of the COIT20245: Lawn calculate academic paper written from scratch, according to all customers’ specifications, expectations and highest standards.”

 

Related posts: