TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Calculate Bill Calculation Program Using Java
Senthilvelan Sambamoorthy
Aug 13
2016
Code
3.7
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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