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
Java - Switch Statement
Senthilvelan Sambamoorthy
Aug 20
2016
Code
602
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssvswitch.rar
import
java.io.*;
class
ssvswitch
{
public
static
void
main(String arg[])
throws
IOException
{
String t,t1;
double
allo=
0
;
int
inc,cat;
double
all;
DataInputStream dr =
new
DataInputStream(System.in);
System.out.print(
"Enter the Income : "
);
t = dr.readLine();
inc = Integer.parseInt(t);
System.out.print(
"Enter the Category : "
);
t1 = dr.readLine();
cat = Integer.parseInt(t1);
switch
(cat)
{
case
1
: allo =
0.05
;
break
;
case
2
: allo =
0.07
;
break
;
case
3
: allo =
0.10
;
break
;
}
all = inc * allo;
System.out.println(
"\nAllowance to be paid : "
+ all);
}
}
Java
Switch Statement