Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Calculate Bill Calculation Program Using Java
WhatsApp
Senthilvelan Sambamoorthy
Aug 13
2016
3.7
k
0
0
ssva11.rar
/*CLOTH PURCHASE*/
import
java.io.*;
import
java.lang.*;
class
ssva11
{
public
static
void
main(String args[])
throws
IOException
{
double
netamt =
0
;
double
amt=
0
,dis=
0
;
int
tag=
0
;
int
x;
String type=
""
;
do
{
BufferedReader obj =
new
BufferedReader(
new
InputStreamReader(System.in));
System.out.println(
"\tCLOTH PURCHASE\n"
);
System.out.print(
"\nENTER THE CLOTH PURCHASE AMOUNT : "
);
amt = Integer.parseInt(obj.readLine());
System.out.print(
"\nENTER THE TYPE(m/h) : "
);
type = obj.readLine();
if
(type.equals(
"m"
))
tag =
0
;
else
tag =
1
;
switch
(tag)
{
case
0
:
{
System.out.print(
"\nTHE SELECTED CLOTH IS MILL CLOTH "
);
if
(amt >
100
&& amt <
201
)
netamt = (amt - (amt/
100
.)*
5
);
if
(amt >
200
&& amt <
301
)
netamt = (amt - (amt/
100
.)*
7.5
);
if
(amt >
300
)
netamt = (amt - (amt/
100
.)*
10
);
break
;
}
case
1
:
{
System.out.print(
"\nTHE SELECTED CLOTH IS HANDLOOM CLOTH "
);
if
(amt >
100
&& amt <
201
)
netamt = (amt - (amt/
100.0
)*
7.5
);
if
(amt >
200
&& amt <
301
)
netamt = (amt - (amt/
100.0
)*
10
);
if
(amt >
300
)
netamt = (amt - (amt/
100.0
)*
15
);
break
;
}
}
System.out.print(
"\n\nNET AMOUNT IS : "
+netamt);
System.out.print(
"\n\nDO YOU WANT TO CONTINUE[1/0] :"
);
x=Integer.parseInt(obj.readLine());
}
while
(x==
1
);
}
}
Java
Calculate Bill Calculation
Up Next
Calculate Bill Calculation Program Using Java