Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


chandru
Quries
1 Answer(s)      3 years ago
Posted in : Java Beginners


a JAVA program to calculate the percentage of a student marks by using java arithmetic operators like +(addition), % (division).


Advertisement
View Answers

August 3, 2011 at 11:24 AM


import java.util.*;
public class Student
{
    public static void main(String[]args){

Scanner input=new Scanner(System.in);
System.out.println("MAXIMUM MARKS in each sub : 100");
System.out.print("Enter Marks1: ");
int m1=input.nextInt();
System.out.print("Enter Marks2: ");
int m2=input.nextInt();
System.out.print("Enter Marks3: ");
int m3=input.nextInt();
System.out.print("Enter Marks4: ");
int m4=input.nextInt();
System.out.print("Enter Marks5: ");
int m5=input.nextInt();
int tm=m1+m2+m3+m4+m5;
double percentage=(double)tm/500;
System.out.println("Percentage of student is: "+(percentage*100)+" %");
    }
}


Related Tutorials/Questions & Answers:
sql quries
sql quries  i want basic sql quries please provide
Advertisements
uploading image in the form
they logged into the screen. Im using Orcale database(sql quries to check
CHECK WHICH NO IS GREATER IN 4 NO'S
chaudhary(+919261377137) if you want to ask any quries then contact me or email
 

 

 

DMCA.com