Answer to Question #222053 in Java | JSP | JSF for Prathip

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






1
Expert's answer
2021-08-01T00:30:15-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS