Ex - No-1 (L5+6) (21-3-23)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

EX NO : 1 PROGRAM TO GENERATE SUPERMARKET STOCK BILL

AIM

To develop a Java application to generate SUPER MARKET stock Bill.

PROCEDURE

1.Create a class with the following members (refer i/p and o/p)

Product-1,Product-2, Product-3

2. Compute the bill amount using the following conditions.

If the product expiration date is exceed two days give 30 percentage discount .

3. Create the object for the created class. Invoke the methods to get the input from the
consumer and display the following information with the generated supermarket bill.
Sample I/P:
Customer Name : JOHN
Product-1 Name : Banana
Product-1 Quantity : 2
Product-1 Price : 20
Product-2 Name : mango
Product-2 Quantity : 3
Product-2 Price : 30
Product-3 Name : Apple
Product-3 Quantity : 4
Product-3 Prize : 40
Expiration date (in form of yyy-mm-dd ): 22-3-2023
Product 3 is expired! Applying discount of 20%.
Sample O/P:

---------------------------------------------------------
Supermarket Bill
------------------------------------------------------
Customer Name: JOHN
Product-1 Name : Banana
Product-1 Quantity : 2
Product-1 Price : 20
Product Total Cost : 40
-----------------------------
Product-1 Name : Mango
Product-1 Quantity : 3
Product-1 Price : 30
Product Total Cost : 90
-----------------------------
Product-1 Name : Apple
Product-1 Quantity : 4
Product-1 Price : 40
Item Total Cost: 128.0
-----------------------------
Total Cost: 258.0
-----------------------------

You might also like