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

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Print the name and number

Question is to print the name and number you entered in order either asked by name or number.

  Total annual compensation policy to improve sales

The company has recently changed its total annual compensation policy to improve sales. A salesperson will continue to earn a fixed salary of $30,000. The current sales target for every salesperson is $400,000. Sales incentives are calculated as foll..

  Java code that needs to be coded-complex number class

Just a Java Code that needs to be coded. Your given the design, just needs the methods and such to be fixed. This is for a Complex Number class.

  Determine the purpose of using javascriptr on a website

write a 200- to 300-word short-answer response to the followingwhat is the purpose of using javascriptr on a website?

  Write a method that takes two integers as parameters

Write a method that takes two integers as parameters and returns trueif the first integer is evenly divisible by the second integer, false otherwise.

  Modify the book class to accommodate multiple authors

modify the Book class to accommodate multiple authors using one of the components from the Java Collection Framework.

  Pass in the number of gallons on board

public float usefulLoad() // this is the grossWeight - emptyWeight public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.

  Prepare executable programs a translate program and a

prepare executable programs. a translate program and a dictionary program. the programs will be written in any

  Create floating point arrays

Create floating point arrays each with three elements - Ask the user to give input for the two arrays.

  Program 2 classes one called student one called grades

program 2 classes one called student one called grades functional requirements ask for how many students u need to

  Review of classes-objects-arrays and enhance for looping

Write Java code for class Produce that meets the listed requirements

  What are the steps necessary to create a jar file

What are the steps necessary to create a JAR file where the main entry point is identified?

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