Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

You have been tasked with creating an application that accepts product data and displays this information. The application also computes average sales and shipping charges. Using appropriate control structures, enhance your product class to include the 2 new methods designed in an earlier task.

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.

Modify your application to call the computeAverageSales() and computeShippingCharges() methods.

As a result of these modifications, the following requirements should be met:

  1. Your application should use the class you created in the earlier tasks. Your class represents one product that your COMPANY sells. Your class should have at least 3 attributes (instance variables). Getters and setters for each instance variable should be provided. Attributes should be appropriately typed and scoped to incorporate data hiding. Appropriate constructors should be implemented by each class and called by the application.
  2. The application should provide a user-friendly interface that allows the user to input data for at least 2 instances of your product class.
  3. Data validation should be incorporated at the time of data entry. At least one error-checking condition must be incorporated to allow the user to reenter a data value that is not valid.
  4. Constructors should be called to create instances of your classes once the user has entered valid data. The valid data should be used appropriately by the constructors.
  5. After product information has been entered and displayed, your application should allow the user to compute average sales and shipping charges. The application should call the computeAverageSales() and computeShippingCharges() methods.
    1. There is no limit to the number of orders placed for each product. Using sentinel-controlled repetition, the computeAverageSales() method should 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.
    2. 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. The application will display the computed shipping charges.

Design Document Requirements

Compile all of your pseudocode from the earlier IPs into a design document. Your design document should have a section that includes the functional requirements and any class diagrams used to describe the system. Include any design requirements imposed by your technical leadership. Your design document should be ready to post to the Week 4 Discussion Board for review by your classmates. In the next task, you will get an opportunity to receive suggestions for improvement on your design document.

INDIVIDUAL PROJECT REQUIREMENT:

Your company needs to provide your sales team with information on the products your company has sold. You will deliver an application that accepts product data and displays this information. Using the class you created in the earlier tasks, complete the design and development of your application.

  1. Your application should use the class you created in the earlier tasks. Your class represents one product that your company sells. Your class should have at least 3 attributes (instance variables). Getters and setters for each instance variables should be provided. Attributes should be appropriately typed and scoped to incorporate data hiding. Appropriate constructor(s) should be created and called.
  2. The application should provide a user friendly interface that allows the user to input sales data for at least 2 instances of your product class.
  3. Data validation should be incorporated at the time of data entry. At least one error checking condition must be incorporated to allow the user to re-enter a data value that is not valid.
  4. Constructor(s) should be called to create instances of your class once the user has entered valid data.
  5. The interface should allow the display of the entered product information for each product. This information should display well formatted using a combination of printf(), print() and println() statements. Headers and labels should be used in the display to make it clear what each value displayed represents.
  6. After product information has been entered and displayed, your application should allow the user to compute average sales and shipping charges. The application should call the computeAverageSales() and computeShippingCharges() method on your product class.
  7. There is no limit to the number of orders placed for each product. Using sentinel controlled repetition, the computeAverageSales() method should allow a user to enter product sales data until the user has indicated that they are done. The average of the entered sales data will be computed and returned by the method to be displayed by the application. 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.
  8. The computeShipping Charges() method should use sentinel controlled repetition, to allow a user to enter shipping data until the user has indicated that they are done. The total shipping charges will be computed and returned as a double value. The application will display the computed shipping charges.

Your application should be well documented and developed using the principles covered in this course. All data displayed should be well formatted and presented in a readable manner.

A design document should be submitted that contains your UML class diagram of each class along with pseudocode for your methods and application.

Include a document that contains screenshots showing your application runs. Document each screenshot with a caption that explains the test data entered and the resulting application behavior/output.

True/False competency exam

The second part of the Key assignment is a competency test that will test your knowledge on fundamental data types, control structures, classes, objects, and methods. If you do not pass this competency exam you will not be able to proceed to the second Java course in this series.

  1. A Scanner class can be used to read in user input.
  2. Example syntax for creating a Scanner to read user input is:

    Scanner input = new Scanner("System.in");

  3. The println() statement can be used to provide a prompt to the user.
  4. When using printf(), you can use %d as the format specifier for an int type.
  5. An import statement, such as the one to import java.util.Scanner should be the very last line in an application.
  6. You should always declare your instance variables as type public.
  7. Getters are used to set the value of private instance variables.
  8. Your application can use a getter to get the current value of an instance variable of an object that your application has created.
  9. You must always have an else part for every ' if' statement.
  10. The following code will result in the code repeated while i is less than 5, causing the value of i to be printed out as 5.

    int i = 0; 

    while (i<5);

    {

    i++;

    }

    System.out.printf("%d", i);

  11. "for" loops can never result in an infinite loop.
  12. Pseudocode is helpful for algorithm development.
  13. Example syntax for a 3 argument constructor for a Book class that takes an int value, a double, and a String:

    public Book (int num1, double num2, String name) {

    bookId = num1; bookPrice = num2;

    title = name;

    }

  14. Example call to the Book constructor from an application could be:

    Book myBook = new Book("5", "3.5", "The Rabbit Ran");

  15. A no argument default constructor will not be provided automatically by the Java compiler once you have declared your own constructor for a class.
  16. Constructors should always have a return type of 'void'.
  17. The eight primitive Java types are: boolean, String, int, char, double, float, long, byte.
  18. A UML class diagram can be used to design your class.
  19. Relational operators can be used to create the condition for an "if" statement but never a "while" loop.
  20. In Java, && represents a Conditional AND operator.

Java, Programming

  • Category:- Java
  • Reference No.:- M91376376
  • Price:- $80

Guranteed 48 Hours Delivery, In Price:- $80

Have any Question?


Related Questions in Java

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As