Define method headers for computeaveragesales

Assignment Help JAVA Programming
Reference no: EM13806859

A - Your technical leader has submitted additional requirements for your application. You have been asked to enhance the application so that it includes data validation, computes average sales data, and computes average shipping charges. To plan for this new functionality, you will define 2 new method headers and develop pseudocode.

Data Validation Requirement

To incorporate data validation at the time of product data entry, you will need to include an error-checking condition to allow the user to reenter a data value that is not valid. For example, if a class should have a positive number for an attribute, continuously prompt the user for a valid positive number until one has been entered by the user. Based on the attributes you provided, you will select where to include appropriate error checking. You must include error checking for at least one value required by the user. Provide pseudocode that includes error checking.

New Methods

Define method headers for computeAverageSales() and computeShipping Charges() according to the following requirements. Develop pseudocode for two new methods to be added to your product class:

The computeAverageSales() method should use sentinel-controlled repetition to allow a user to enter product sales data until the user has indicated that he or she is done. The average of the entered sales data will be computed and returned by the method to be displayed by the application. For example, if the user entered 500.50, 250.50, and 300.30, then the average sales would be computed for these 3 values and returned by the method. The prompting of the sales data is done within the method. If the value of the average sales exceeds, $200.00, a message should be displayed to alert the user that the product has produced a significant amount of revenue. The computeAverageSales() method should return type "double."

The computeShippingCharges() method should use sentinel-controlled repetition to allow a user to enter shipping data until the user has indicated that he or she is done. The total shipping charges will be computed and returned as a double value.

Post your pseudocode for the data validation, method headers, and pseudocode for each new method to the Discussion Board. You will use your pseudocode to make the modifications to your application in an upcoming task.

B. Implement the data validation enhancement you designed in the previous task. Include an error-checking condition to allow the user to reenter a data value that is not valid. For example, if a class should have a positive number for an attribute, continuously prompt the user for a valid positive number until one has been entered by the user. Based on the attributes you provided, you have selected where to include appropriate error checking. You must include error checking for at least 1 value required by the user.

Reference no: EM13806859

Questions Cloud

Tagistan a new country in asia the gov­ernment of tagistan : International Diversified Corporation (IDC) owns assets in Tagistan, a new country in Asia. The gov­ernment of Tagistan wants to nationalize all assets owned by foreign firms and investors. What can IDC do? Can it at least obtain payment for the asse..
Conduct a comparative analysis of the firms : Normal 0 false false false EN-US X-NONE X-NONE Conduct a comparative analys..
Patriot act was used to guarantee the ignorance of american : The Patriot Act was used to guarantee the ignorance of the American people, so you will be deprived of real factual information that you could use to make an educated choice about what you want from leadership and foreign policy.
Define method headers for computeaveragesales : Define method headers for computeAverageSales() and computeShipping Charges() according to the following requirements. Develop pseudocode for two new methods to be added to your product class
Write a paper that define eating disorder : Write a paper that define eating disorder and explain how people with eating disorders behave, act and deal with it.
Cognitive therapy (ct) and cognitive-behavioral therapy : What statistical test should be used to analyze the data?
Discuss the factors that currently motivate corporate leader : Identify the critical factors on each side of the "shareholder versus stakeholder debate." Discuss the factors that currently motivate corporate leaders to address this issue. Discuss the aspects of strategic stakeholder management. Discuss how it ha..
Assignment on training and development in small businesses : Normal 0 false false false EN-US X-NONE X-NONE Training and Development in ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  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..

  Implements the queue interface

Element from an ArrayList is slow because of all the shifting. For this question, you should modify the poll()method so that it runs in constant time - implementations as well as correct/fast implementations. In the former case, your functions may..

  User interface menu using doubly linked lists

Each mNode defines the main menu item name, two links to its mNode neighbors (the previous and next mNode) and a link to its first submenu node.

  Create a simple votingmachine

In this exercise you will create a simple VotingMachine. In the United States, when a candidate runs for office, the person is often identified as a Democrat, Republican, or Independent

  Write following java expressions in mathematical notation

Write the following Java expressions in mathematical notation.

  Javas drawing capabilities

This week, we will be learning to use some of Java's drawing capabilities. The Graphics class provides methods for drawing many different shapes, using different colors, and for drawing strings using different fonts.

  Using an array in java

Using an array in Java - have a list of keywords from a web service and have to print out the list of keywords on the screen with one keyword on each line. This is my code

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Define render a model scene in java

Render a Model Scene in Java - Imagine you are prototyping animation for a Jurassic Park Movie

  Java code using jframe

Write a Java code using JFrame. This code needs to manipulate 4 shapes(2 rectangles and 2 squares) in a 400x400 JFrame. This needs to manipulate the shapes in 3 different ways, using 3 different methods. One for translating a shape, one for proportio..

  Java program to read line of text which ends with period

Write down the java program which will read the line of text which ends with the period, which serves as sentinel value. Show all the letters which occur in the text.

  Design a solution to the problem by using the five steps to

the software needs to allow the restaurant owner to schedule employees for up to 40 hours in a seven-day week. the

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