Implement a validation plan to get a valid input

Assignment Help JAVA Programming
Reference no: EM131031922

Implementation-

Task 1 - Presenting the Catalogue

In the beginning of the program, print to a table the catalogue for all products including name, code, and price to assist users shopping. You should use a loop plan to access the data stored in productListArr and priceListArr and present it in a four-column table, like Figure 4, where each column is a set of products with code, name, and price.

Task 2 - A Validation Plan for Valid Product Codes

You need to implement a validation plan to get a valid input from the user for product code. An input value is considered invalid if:

- it is not a number at all;

- it is not an integer number;

- it is a negative number;

- it is a number out of range (greater than or equal to the size of   productListArr).

Task 3 - A Validation Plan for Valid Quantity  Values

You need to implement another validation plan to get a valid input from the user for quantity. An input value is considered invalid if:

- it is not a number at all;

- it is not an integer number;

- it is zero or a negative number;

- it is greater than 100.2

Task 4 - An Iteration Plan for Information Gathering   Phase

You need to design a looping plan to implement the Information Gathering Phase. Refer to Functional Requirements and Fig. 1 for the detail of data flow in the loop. Clearly, this task should incorporate the works in Task 2 and 3.

Task 5 - A Sum Plan to Calculate the Total   Cost

Your program needs to calculate the total cost for all ordered products in the shopping cart. The calculation formula is provided:

totalCost(cart) =  Σicart pricei × quantityi

Task 6 - A Maximum Plan to Find the Most Expensive Product in Cart

Your program needs to find the most expensive product in the shopping cart. To do it, for each of the products added in to the cart you need to retrieve the corresponding price from priceListArr, and then compare the prices one by one. Once you find out the most expensive price, the corresponding product item in productListArr will be the most expensive product in the shopping   cart.

If you have multiple products in the cart sharing the same most expensive price you can select any one of them as the "most expensive product".

Task 7 - A Minimum Plan to Find the Least Expensive Product in Cart

Your program also needs to find the least expensive product in the shopping cart. You may adopt the same strategy in previous task for this task. Again, if you have multiple products in the cart sharing the same least expensive price you can select any one of them as the "least expensive product".

Task 8 - An Average Plan to Calculate the Average Cost

Your program needs to be able to calculate the average cost for all product items in the shopping cart.     This can be done by the total cost divided by the accumulated value of quantities:

averageCost(cart) = Σicart pricei × quantityi/ Σicart quantityi

You should handle the "Division by Zero" exception when calculating average.

Task 9 - Presenting the Cart

Print to a table the detailed information of shopping cart, such as product name, price, quantity, and cost. You should adopt an iteration plan to visit the elements stored in quantityArr and orderedP roductCodeArr in order to get the index to retrieve product names and prices from productListArr and priceListArr.

All currency values should be at cents in terms of precision.3

Task 10 - Presenting the Statistics

Print to an unordered list the statistic information (total cost, most expensive item, least expensive item, and average cost per unit for the ordered product items) on shopping cart.

Attachment:- Assignment.rar

Reference no: EM131031922

Questions Cloud

Explain what it means for a student to be successful : For this essay you will explain what it means for a student to be successful in an online classroom and then argue which three characteristics or habits that are most essential for students to achieve success in an online classroom.
Evaluates the supplier of their deep-frozen beef patties : The management of a large fast food chain evaluates the supplier of their deep-frozen beef patties. The supplier delivers frozen beef patties that according to the specifications have to weigh between 94.5 grams and 95.5 grams. All other beef patties..
Four-step assembly operation with quality problems : Consider the following four-step assembly operation with quality problems: The first resource has a processing time of 5 minutes per unit and one employee doing the operation. The second resource has a processing time of 4 minutes per unit. No qualit..
Relevant regulatory officials are asking for consulting fee : Assume that you are the Vice-President for International Operations for the XYZ Widget Company. You are under pressure from the CEO to significantly increase the sale of widgets across Asia. To break into the market in some countries, the relevant re..
Implement a validation plan to get a valid input : You need to implement a validation plan to get a valid input from the user for product code. An input value is considered invalid if: it is not a number at all
Discuss the five major kinds of drivers of globalization : Discuss the five major kinds of drivers of globalization as it applies for your chosen company. Analyze the basic needs potential for the markets of your chosen company. Analyze the applicable financial and economic forces. Analyze the applicable pol..
Two quality management styles : Based either on your work experience or on the readings in this course or both, discuss the following:  What should prevail in a company, TQM by facts or intuitive decisions that are made without regard to facts? What is generally the impact of the t..
Discuss how csr has become an important part of business : Discuss how CSR has become an important part of business and give examples of at least 2 companies who have been very active in regard to their social responsibility.
Who are the three best-known quality pioneers : Who are the three best-known quality pioneers? Describe and then compare their individual contributions to quality. Look through the ITT Tech Virtual Library and identify a major company that adopted one or more of the pioneers' strategies. Suggest h..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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