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 students marks grade using Java
Senthilvelan Sambamoorthy
Aug 13
2016
Code
829
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssvstud.rar
import
java.io.*;
class
ssvstud
{
public
static
void
main(String arg[])
{
int
s[]=
new
int
[
9
];
int
n,z=
0
,x=
0
,y=
0
,w=
0
;
s[
0
]=
60
;s[
1
]=
70
;s[
2
]=
80
;s[
3
]=
72
;s[
4
]=
48
;s[
5
]=
55
;s[
6
]=
25
;s[
7
]=
90
;s[
8
]=
99
;
n=
9
;
for
(
int
i=
0
;i<n;i++)
{
if
(s[i]>=
81
&& s[i]<=
100
)
z=z+
1
;
}
System.out.println(
"students in the range(81-100)is="
+z);
for
(
int
i=
0
;i<n;i++)
{
if
(s[i]>=
61
&& s[i]<=
80
)
y=y+
1
;
}
System.out.println(
"students in the range(61-80)is="
+y);
for
(
int
i=
0
;i<n;i++)
{
if
(s[i]>=
41
&& s[i]<=
60
)
x=x+
1
;
}
System.out.println(
"students in the range(41-60)is="
+x);
for
(
int
i=
0
;i<n;i++)
{
if
(s[i]>=
0
&& s[i]<=
40
)
w=w+
1
;
}
System.out.println(
"students in the range(0-40)is="
+w);
}
}
Java