Create a main program as MyStore2 Prompt the user to enter the following details via keyboard Enter Item Name : ________ Enter price tag : ________ Enter number of items : ________ Instantiate an object of Items class and pass the variables as the parameters for the new Product. ------------------------------------------------------------ Create a Items class Declare the following as private properties: itemName, itemPrice, and numItems Create a constructor of the Items class * copy the values of the parameters in the constructor to the properties. * Display the following: Product name : Price tag : Cost : ? Discount : ? Net Amount : ? -------------------------------------------------------------- Enter Item Name : Coca Cola Litro Enter price tag : 35.00 Enter number of items : 10 Product entered: Coca Cola Litro Price tag : 35.0000 Total Amount : 350.00000 Discount : 0.0000 Net Amount : 350.00000 --------------------------------------------------------------
Create a main program as MyStore2
Prompt the user to enter the following details via keyboard
Enter Item Name : ________
Enter price tag : ________
Enter number of items : ________
Instantiate an object of Items class and pass the variables as the parameters for the new Product.
------------------------------------------------------------
Create a Items class
Declare the following as private properties:
itemName, itemPrice, and numItems
Create a constructor of the Items class
* copy the values of the parameters in the constructor to the properties.
* Display the following:
Product name : <itemName>
Price tag : <itemPrice>
Cost : ?
Discount : ?
Net Amount : ?
--------------------------------------------------------------
Enter Item Name : Coca Cola Litro
Enter price tag : 35.00
Enter number of items : 10
Product entered: Coca Cola Litro
Price tag : 35.0000
Total Amount : 350.00000
Discount : 0.0000
Net Amount : 350.00000
--------------------------------------------------------------
Cost is equal to numItems x itemPrice
Discount is given as 10% of Amount OR 60 pesos whichever is lower; whenever the Amount exceeds
500.000
Net Amount is the difference between Cost and Discount.
Step by step
Solved in 3 steps with 1 images