Professional Documents
Culture Documents
Gpa Calculation Using Java Web Service: 1. Source Code
Gpa Calculation Using Java Web Service: 1. Source Code
|SOA Lab
|SOA Lab
}
else if(gs[i].equalsIgnoreCase("c"))
{
tp.add(7);
}
else if(gs[i].equalsIgnoreCase("d"))
{
tp.add(6);
}
else if(gs[i].equalsIgnoreCase("e"))
{
tp.add(5);
}
else
{
tp.add(0);
}
}
// GPA calculation process
for(int i=0;i<tp.size();i++)
{
// total points calculation
3
|SOA Lab
totalPoints+=(Integer.parseInt(tp.get(i).toString()))*(Integer.parseInt(tc.get(i).toString()));
}
tp.clear();
tc.clear();
// final GPA calculation
gpa=(float)totalPoints/(float)totalCredits;
String i1="Total Points Earned\t: "+totalPoints+"\n";
String i2="Total Credits Earned\t: "+totalCredits+"\n";
String info=i1+i2+"\n";
return info+"Ur GPA is : "+String.valueOf(gpa);
}
else
return "Input is empty!plz submit the Grades and Credits ";
}
}
|SOA Lab
2. OUTPUT
|SOA Lab