Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose there is a class called ProductOrder . This class has two instance varia

ID: 3711814 • Letter: S

Question

Suppose there is a class called ProductOrder. This class has two instance variables as shown below:

private Product p;
private int quantity;

The Product class has the following instance variables:

private String prodID;
private String prodName;
private double prodPrice;

The Product class has a full-arg constructor.

a) Write a full-arg constructor for ProductOrder class.

b) Write a code segment that will use the full-arg constructor of the ProductOrder class to create a new object. Assume the values of the instance variables are already obtained form the user.

Explanation / Answer

void setter()

{

string ISBN; //variable declaration

cout<<"Enter the ISBN number"<<endl;

cin>>ISBN; //accepting the value from the user

Product.prodID=ISBN; //storing ISBN to the prodID valriable

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote