-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.java
More file actions
42 lines (38 loc) · 865 Bytes
/
Copy pathprogram.java
File metadata and controls
42 lines (38 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.util.Scanner;
class Program
{
public static void main(String[] args)
{
float price,quantity,amount=0;
float temp=amount;
System.out.println("*******WELCOME TO MY KIRANA SHOP********\n");
while(true)
{
Scanner ob=new Scanner(System.in);
System.out.println("are you want to continiue");
char y=ob.next().charAt(0);
if(y=='y'||y=='Y')
{
//enter the thing name
System.out.println("what you want");
String name=ob.next();
//enter the quantity
System.out.println("tell me Quentity");
quantity=ob.nextFloat();
//enter the price
System.out.println("enter the price");
price=ob.nextFloat();
//total amount
System.out.println("your amount is");
amount=quantity*price;
System.out.println(amount);
temp+=amount;
}
else
{
break;
}}
System.out.println("YOUR TOTAL AMOUNT IS:->"+temp);
System.out.println("***************THANKS FOR SHOPPING**************");
}
}