Ask Java Expert


Home >> Java

Objectives

This assessment item is designed to test your understanding of arrays/arraylists, objects, classes, methods, sorting and searching.

Assessment task

Write a java application that allows the user to read, validate, store, display, sort and search the internet account number (integer number), usage (integer number) and cost (double number) for N customers. 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 S0234182 then N should be equal to 8 and you can declare it as final int N=8;). The account number, usage and cost must be stored in three separate single dimension Arrays/ArrayLists (index 0 for customer 1 and index N-1 for customer N). The minimum and maximum account numbers which can be stored are 1111 and 8888. The minimum and maximum internet usages which can be stored are 5 GB and 1000 GB. The internet account number and usage must be entered from the keyboard and a validation for minimum and maximum values must be done.

Your application should display and execute a menu with the following options.

A switch statement must be used to execute the following menu options.

1. Read, validate and store account number and internet usage for N customers

2. Calculate, store and display the cost for all customers

3. Display all account numbers which have over 10 GB usage

4. Find and display the account number with the highest cost

5. Find and display the account number with the lowest usage

6. Sort and display the cost in ascending order

7. Search and display the accounts which have usage equal to the given usage

8. Exit from the application

1. Read, validate and store account number and internet usage for N customers This option reads account number and usage for all customers from the keyboard and stores them in two separate single dimension Arrays/ArrayLists. If the account number is less than 1111 and greater than 8888 then an appropriate message should be displayed and the user should be asked to enter a new account number.

Similarly if the usage is less than 5 GB and greater than 1000 GB then an appropriate message should be displayed and the user should be asked to enter a new usage.

2. Calculate, store and display the cost for all customers This option calculates the cost ($2 for 1 GB), stores in an Array/ArrayList and displays the account number, usage and cost as follows. Example: Account Number Usage Cost 2123 15 GB $30 3367 5 GB $10 1123 11 GB $22

3. Display all account numbers which have over 10 GB usage This option displays all account numbers stored in Array/ArrayList which have over 10 GB usage. If there are no customers with over 10GB usage then an appropriate message should be displayed. Example: Account Number Usage Cost 2123 15 GB $30 1123 11 GB $22

4. Find and display the account with the highest cost This option finds and displays the account number stored in Array/ArrayList which has the highest cost. Example: Account Number Usage Cost 2123 15 GB $30

5. Find and display the account number with the lowest usage This option finds and displays the account number stored in Array/ArrayList which has the lowest usage. If there is more than one account with the same usage (lowest usage) then it displays all of them. Example: Account Number Usage Cost 3367 5 GB $10

6. Sort and display the cost in ascending order This option sorts and displays the cost stored in Array/ArrayList for all customers in ascending order. You can use any sorting algorithm. A built-in sort algorithm for sorting is not allowed in this assignment. Example: Account Number Usage Cost 3367 5 GB $10 1123 11 GB $22 2123 15 GB $30

7. Search and display the accounts which have usage equal to the given usage This option searches Array/ArrayList and displays the accounts which have usage equal to the given usage. The application asks the user to enter the internet usage in GB using the keyboard and searches for it.

If the usage entered from the keyboard is found then the application displays account number, usage and cost otherwise it displays an appropriate message. A built-in search algorithm for searching can be used in this assignment.

8. Exit from the application The application should display the message "Thank you for using this application" and your student id number and then exit from the application.

The application should work in a loop to enable the user to Read, validate and store account number and internet usage for N customers.

Calculate, store and display the cost for all customers, Display all account numbers which have over 10 GB usage, Find and display the account number with the highest cost, Find and display the account number with the lowest usage, Sort and display the cost in ascending order, Search and display the accounts which have usage equal to the given usage and Exit from application.

Program design You may use any design that meets the specification. However, a good design will adhere to the following guidelines:

• be logically correct

• be easy to read and maintain

• be well-designed

• use a UML activity diagram

• use appropriate classes, methods and fields

Your design MUST use the classes and methods as listed below.

public class Account { //fields //get and set methods } public class AccountTest { Method to read, validate and store account number and internet usage for N customers Method to calculate, store and display the cost for all customers Method to display all account numbers which have over 10 GB usage Method to find and display the account number with highest cost Method to find and display the account number with lowest usage Method to sort and display the cost in ascending order Method to search and display the accounts which have usage equal to the given usage

public static void main(String[] args) { } }

You may add/use other methods, parameters, fields/variables, constants, etc. which you need to complete the application.

Testing Testing is important. You should:

• List the different types of test cases.

• Display the results for each test case.

What to submit You should submit online the following files.

• Account.java (this file contains java code for class Account)

• AccountTest.java (this file contains java code for class AccountTest).

• Report.docx (this file contains a brief report that includes student name, student ID, course name, course code, UML activity diagram for menu option 2 (calculate, store and display the cost for all customers) and test results (screenshots/test cases with results to show that your application is correctly working)).

Warning: You must submit your own work and correct files. Please read the plagiarism policy.

Java, Programming

  • Category:- Java
  • Reference No.:- M91404572
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As