Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Details of Question 1 (needed for question 4) Prolgramming Language: Java 4) Create a class called Test ProductOrder in the same package that you created
Details of Question 1 (needed for question 4)
Prolgramming Language: Java
4) Create a class called Test ProductOrder in the same package that you created ProductOrder class in problem 1. The requirements for Test ProductOrder class is as given below. Create a main method and write the code for main method as given below: a) Create a ProductOrder object called prodOrder1, using the default constructor. b) Use the setters on prodOrder1 to set the values of instance variables. (Make sure quantity Fulfilled is lesser that quantityRequested) c) Prompt the user to provide a value for amount and scan this into a variable called price. d) Call the calculate Payments method for prodOrder1 and to this method, pass on the value of price, (obtained from user). Print out the return value of this method call. e) Call the printPendingOrder method for prodOrder1. f) Prompt the user to provide a new value for quantity Fulfilled and use the setter on prodOrder1 to set the new value of quantity Fulfilled. g) Create a new object called prodOrder2 using the overloaded constructor h) Call the printPendingOrder method for prodOrder2. i) Prompt the user to provide a new value of payment amount and scan this into the variable called price. j) Call the calculatePayments method for prodOrder2 and to this method, pass on the value of price, (obtained from user).Print out the return value of this method call. k) Use the setter and change the value of quantityRequested by increasing the orders requested to new value. 1) Call printPendingOrder method for cashReg2 to print out the pending orders. Answer: copy/paste your code below. Also provide a screen shot of the results. The outputs should be formatted such that each out put line should describe what is the output stands for. 1) Write a blueprint class that tracks the orders made to vendors in a company's product purchasing system. We will create a class called ProductOrder. The requirements are as follows: a) The class ProductOrder has the following private instance variables:productID orderID, quantityRequested, quantityFulfilled all of types integer. We will need separate variables for quantity requested and quantity fulfilled because the vendors may not be able to fulfill the requests completely. b) The class/object model will provide the values of the quantityRequested and quantity Fulfilled to the client program. To do this, have proper getters and setters for the instance variables. c) The class/object model has method, calculatePayment, that will calculate the pending payments to be made to vendors for the product quantity fulfilled. To do this, the method will receive the payment price as a parameter and multiply this price with the quantityFulfilled to determine the payments that are due. Write a method in the class that will take in a (double) parameter called price and returns the value of the payment due (also a double). This value of payments due is the amount that the company will need to pay to the vendor. d) The class/object model has a method called printPendingOrder that will print the number of un-fulfilled orders. The value of balance is given by the difference between quantityRequested and quantity Fulfilled. The printPendingOrder method takes in no input parameters and has a void return. e) The class/ object model has constructors that will allow default and full-argument overloaded constructors in the client class. Write appropriate default and overloaded constructors Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started