Calculates and displays the cost of computing


Assessment task

Write a java console application that calculates and displays the cost of computing infrastructure setup for N banks. 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 S547221 then N should be equal to 7 and you can declare it as final int N=7). The cost is based on number of computers to be installed as shown below in Table 1.

Table 1. Number of Computers and Cost

Number of Computers

Cost

2 or less

$1000

Over 2 but not more than 20

$1000 + $400 per computer Over 2

Over 20 but not more than 100

$1000 + $300 per computer Over 2

Over 100

$200 per computer

The application should ask the user to enter the number of computers for each bank (total N banks) and calculate the cost. The application should display the cost for each bank as shown in the example below. At the end of the Nth bank's cost, a receipt with total cost, lowest cost and average cost should be displayed. The total cost is calculated by adding the setup cost for all banks. The lowest cost is calculated by finding the lowest amount from costs for N banks. The average cost is calculated by dividing the total cost with the total number of banks. The format for your input and output must be same as given in example below.

Example for N=4 (Note that a loop should be used for reading the input and displaying the output) Your welcome message should be here

Enter the number of computers for Bank number 1: 1
The cost to setup the computing infrastructure for Bank number 1 is $1000

Enter the number of computers for Bank number 2: 10
The cost to setup the computing infrastructure for Bank number 2 is $4200

Enter the number of computers for Bank number 3: 22
The cost to setup the computing infrastructure for Bank number 3 is $7000

Enter the number of computers for Bank number 4: 100
The cost to setup the computing infrastructure for Bank number 4 is $30400

*********Receipt for Total Cost, Lowest Cost and Average Cost********* Total Cost is $42600
Lowest Cost is $1000 Average Cost is $10650

Your exit/end message containing your ID number must be here.

The application should be user-friendly by displaying appropriate welcome message at the beginning and an exit message at the end.

The application should use the following classes and methods.

public class Bank
{
//declare constants
//declare fields/variables
//declare constructor
//declare and define all methods including get and set methods
}

public class BankTest
{
public static void main(String[] args)
{
//create object
//read and store quantity of computers using a set method
//get the quantity of computers using a get method and calculate the cost
//print the output as shown in the example
}
}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Calculates and displays the cost of computing
Reference No:- TGS01557585

Now Priced at $65 (50% Discount)

Recommended (93%)

Rated (4.5/5)