Question #222053

Develop the internal mark calculation system based on the attendance percentage using java. Get the student name, register number,total number of according days present. Calculate attendance percentage of the students and award attendance mark based on the following condition.

Attendance percentage >=90 - 5 marks Attendance percentage >= 80 - 4 marks






Expert's answer

import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
		
		Scanner in=new Scanner(System.in);
		String name;
		int days;
		System.out.println("Enter the name of the student: ");
		name=in.next();
		
		System.out.println("Enter total number of according days present: ");
		days=in.nextInt();
		double attendance_perc=(100*days)/7.0;
		int marks=0;
		if (attendance_perc>=90){
		    marks=5;
		}
		else if(attendance_perc>=80){
		    marks=4;
		}
		System.out.println("Name: "+name);
		System.out.println("Number of days: "+days);
		System.out.println("Marks: "+marks);
		
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS