Write a java application that allows the user to read

Assignment Help JAVA Programming
Reference no: EM13836136

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)

Reference no: EM13836136

Questions Cloud

Challenges for international advertising research : Please provide a brief summary and analysis of the article the Tension between Strategy and Execution - Challenges for International Advertising Research- analysis of the article INTERNATIONAL TV NEWS, FOREIGN AFFAIRS INTEREST AND PUBLIC KNOWLEDGE
Which is the stronger acid : Problem 1: Which is the stronger acid, HF or HBr (EN of = 4.0, EN of Br = 3.0)? Problem 2: Place the following compounds in order of increasing acidity (1 = least acidic, 5 = most acidic).
Determine the amount of performance-based compensation : What is the performance benchmark(s) being used to determine the amount of performance-based compensation? Is it based on financial statement numbers prepared in accordance with accounting standards?
How the theoretical perspectives explain the crime : While walking to her car in a mall parking lot, a woman is approached by a man who displays a handgun and demands her purse. She gives him her purse, and he runs away with it. How would each of the theoretical perspectives explain this crime?
Write a java application that allows the user to read : 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 ..
Which rate of withholding tax will apply : Which rate of withholding tax will apply to the dividends distributed to Saudi Arabia? (Please, indicate the article of the OECD Tax Model convention to which you refer to justify your answer)
How might this relate to medicalization of women sexuality : Despite the accessibility of vibrators and other sex toys, open discussion of women's orgasms and sexual pleasure is rare. Why might this still be the case? How might this relate to the medicalization of women's sexuality, as discussed in this uni..
Study the criminal activities of gang member : Identify at least three relevant ethical concerns with this study - How would these concerns shape your research project and Create two separate paragraphs.
Experimentally determined rate law : Problem 1: The experimentally determined rate law for the following reaction indicates that the reaction is second-order in AB and that the reaction is second-order overall.

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  What is mean by swing and awt

What is mean by Swing and AWT and compare the statements break and continue with example in terms of their functions

  How these feature desirable in modern software engineerig

Java is a portable language and being an object-oriented programming language, it also encourages component reusability. How are these features desirable in modern software engineering

  Create a servlet to display a table

NetBeans for Java with GlassFish/Tomcat: https://netbeans.org/downloads/ (select All option)) and create a servlet to display a table that contains factorials for the numbers from 0 to 10, as shown

  Prepare a java program draws a chess board

Write a Java program "chess.java" that draws a chess board with 8 x 8 squares, half of the squares are filled black and are interleaved with the white squares.

  Explain where the following method invocations

Explain where the following method invocations are most likely to be found in a program for dealing with census data organized using the Model, View, Controller (MVC) design pattern. Choices are zero or more of Model, View, and Controller. Be sure to..

  You are to implement an intrusion detection system in java

you are to implement an intrusion detection system in java. we are assuming all activities are associated with the same

  An advantage of a two-dimensional array

A two-dimensional array can have a different number of columns in every row. Do you see that as an advantage or a disadvantage

  Follow the projects suggestion

Be sure that you follow the projects suggestion and create a separate class for the word analysis. An instance of this class and its methods should then be called by your GUI interface.

  Prepare a java program to random pick

The user and computer will each randomly pick one and common rules of winning apply. The game ends when the user and computer pick the same item.

  Negatively impacting health care currently

Identify and explain at least two events that are negatively impacting health care currently. Tell us why you think these items are negatively impacting the access to care, and make sure that you cite your references.

  Eplain the main purpose of using javascript on a website

question 1 what is the purpose of using javascript on a website? what is a specific example of a javascript

  Create a program that has an object type of contact

Create a program that has an object type of Contact. This contact will need to have the following attributes: Name, Birth Date, Phone Number, Address and Eye Color

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