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

  Projectyou will create a secure parts inventory catalog

projectyou will create a secure parts inventory catalog system using model 2 architecture. the application will require

  Write a program that reads words from a text file

Write a program that reads words from a text file and displays all the nonduplicate words in ascending order. The text file is passed as a command-line argument.

  Write a program that prompts the user for a start date

write a program that prompts the user for a start date and an end date and then prints all of the dates between them (inclusive), with seven tab-separated dates on each line.

  Consider an array of integers

Consider an array of integers as below: int[] a = {5, 2, -4, 3, 0, -5, 7, 11, 6, 13} Complete the method named count(int[] a) in the class Count. The method should return the number of positive numbers in the array

  Program to mimic a student information management system

Write a Java program to mimic a student information management system. The main entry page should have at least following options:

  Consider the following conditions

Consider the following conditions: An enqueuer waiting on a full-queue or a dequeuer waiting on an empty queue sleep indefinitely, unless woken up by another thread. A thread must send a signal ONLY when it adds an element to an empty queue or remove..

  Write an executable program with java

calculates the cost of the baggage when the weight of the baggage is stated by the operator. The baggage cost should differ from city to city

  Problem aa savings account object holds a nonnegative

problem aa savings account object holds a nonnegative balance and provides depositk and withdrawk methods where

  Program that simulates the rolling of a single die1000 times

Write a program that simulates the rolling of a single die 1000 times. The program must use an array of size 6 and not 1000 to store the occurrences of each side or face on the six-sided die. The program should output the particular die face and the ..

  Invoice project - test the invoice application

Test the Invoice Application with an invalid total like $1000 and include the dollar sign. This should cause the application to crash with a runtime error and to display an error message in the Output window. Take a screenshot of the error message..

  Write a java applet for grade of gas in costco gas station

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Teaching software componentization

Describe one way in which one could apply Java graphics in education. Provide one example of such use to support your response and analyze at least three commands that you would use in order to draw a bar chart. Provide a rationale for your respons..

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