Program that allows user to search internet account number

Assignment Help JAVA Programming
Reference no: EM13834735

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.

Reference no: EM13834735

Questions Cloud

How the use of ifrs is enforced within your chosen country : Discuss whether and how the use of IFRS is enforced within your chosen country. Evaluate whether the firm's accounts are comparable with their key global competitors.
Levels of contingent liabilities : 1. Identify the three levels of contingent liabilities and the respective accounting treatments.
Problem regarding the forten company : Forten Company, a merchandiser, recently completed its calendar-year 2013 operations. For the year, (1) all sales are credit sales, (2) all credits to Accounts Receivable reflect cash receipts from customers, (3) all purchases of inventory are on ..
Perform a financial analysis of wmt vs tgt : Perform a FINANCIAL ANALYSIS of WMT vs. TGT: Create side-by-side LINE CHARTS with CAGRs for WMT vs. TGT for fiscal years 2007-2014 in SALES, STOCK PRICE, NET PROFITS.
Program that allows user to search internet account number : Read, validate and store account number and internet usage for N customers - Calculate, store and display the cost for all customers and Calculate, store and display the cost for all customers
What are all possible values of the ack field : What are the possible sets of sequence numbers inside the sender's window at time t? Justify your answer.What are all possible values of the ACK field in all possible messages currently propagating back to the sender at time t? Justify your answer.
Which of the following risk factors can you control : Which of the following risk factors can you control
Build a combination west coast manufacturing location : Provide a detailed recommendation as to whether you should open a West Coast distribution center, add on to the existing East Coast factory and warehouse, or build a combination West Coast manufacturing location and warehouse
What will be the acknowledgement number : Suppose host A send two TCP segments back to back to host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110. a) How much data is in the first segment? b) Suppose that the first segment is lost but t..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Scenario - clinic management system

Change the category of a doctor - Clinic Management System - Java client application that perform

  Create a complete java application

Create a complete Java application that meets these requirements and the program has an opening comments section (using block comments) with the file name, date, your name, and purpose of the program.

  Write an application that extends jframe

Write an application that extends JFrame and that displays a phrase in every font size from 6 through 20.

  This assignment will focus on creating java servlets that

this assignment will focus on creating java servlets that can not only serve html to web users but also provide a web

  Java program asks the user to input the number of gallons

Write a java program asks the user to input the number of gallons of gas in the tank and the price of gas per gallon

  Evaluate an infix expression entered by the user

Spaces between tokens are allowed but not required. The program will repeatedly prompt the user for the value of x, displaying the value of the expression each time. When the user enters the letter q instead of a number, the program terminates.

  Values that occur just once

This list has some values that occur just once (1, 3, 4, 11, 13, 18), some values that occur twice (9, 16), some values that occur three times (14, 19) and a single value that occurs four times (7). Therefore, the call of list.maxCount() should re..

  Write a program in java that reads a file

Write a program in Java that reads a file of numbers of type int and outputs all the numbers to another file, but without there being any duplicate numbers.

  Write a java method delete(key1, key2) to delete

1. Write a Java method delete(key1, key2) to delete all records with keys between key1 and key2 (inclusive) from a binary search tree.

  Create a java class named headphones

Create a Java class named HeadPhones to represent a headphone set. The class contains- A private String data field named manufacturer that specifies the name of· A private boolean data field named pluggedIn that specifies if the headphone is plugge..

  Have to implement a search algorithm

Suppose you have to implement a search algorithm in a high programming language such as Java or C++. You are given a linked list that is not sorted and it's rather small, in the order of a few dozen elements.

  Calculate the age of a person given the birthdate

Assemble a program to calculate the age of a person given the birthdate. The output should print the line "In 2014 you will be ''the age of the person" years old." Code needs to be in assembly language using motorola 68000.

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