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   --------------------------------------------------------------

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

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.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage