Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
37 views

Import: in Out Out Out

The document contains code for a Java program that calculates a student's average grade based on inputted scores for algebra, physics, and programming courses. It then outputs the student's average and determines if they are a president's lister, dean's lister, or average student based on their average grade. The code was modified to change the ranges used to categorize the student's performance.

Uploaded by

guianÜ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Import: in Out Out Out

The document contains code for a Java program that calculates a student's average grade based on inputted scores for algebra, physics, and programming courses. It then outputs the student's average and determines if they are a president's lister, dean's lister, or average student based on their average grade. The code was modified to change the ranges used to categorize the student's performance.

Uploaded by

guianÜ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

Scanner;


public class AverageGradeNewVersion
{
public static void main(String[] args)
{
double algebra = 0, physics =0, programming = 0,average =0;
Scanner input = new Scanner(System.in);
System.out.print("Enter algebra grade: ");
algebra = input.nextDouble();
System.out.print("Enter physics grade: ");
physics = input.nextDouble();
System.out.print("Enter programming grade: ");
programming = input.nextDouble();

average = (physics +algebra +programming)/3;


System.out.println("Average grade is: "+average);

if (average >= 1.75)
System.out.print("You're an average student");
else if (average >= 1.5)
System.out.print("You're a Dean's Lister");
else
System.out.print("You're a President's Lister");

/*if((average == 1.0) && (average < 1.49))
System.out.print("You're a President's Lister");
else if((average >= 1.5) && (average < 1.75))
System.out.print("You're a Dean Lister");
else
System.out.print("You're an average student");
**/
}
}



import java.util.Scanner;


public class AverageGrade
{
public static void main(String[] args)
{
double algebra = 0, physics =0, programming = 0,average =0;
Scanner input = new Scanner(System.in);
System.out.print("Enter algebra grade: ");
algebra = input.nextDouble();
System.out.print("Enter physics grade: ");
physics = input.nextDouble();
System.out.print("Enter programming grade: ");
programming = input.nextDouble();

average = (physics +algebra +programming)/3;


System.out.println("Average grade is: "+average);

if((average == 1.0) && (average < 1.49))
System.out.print("You're a President's Lister");
else if((average >= 1.5) && (average < 1.75))
System.out.print("You're a Dean Lister");
else
System.out.print("You're an average student");

}
}

//if(salary>=15000)
//rate=0.01;
//else if(salary>=10000)
//rate=0.05;
//else
//rate=0.10;

You might also like