/** * StudentGrade determines the final semester score of students in a course. * * @author (Andrew Samuels) * @version (02-01-2010) */ //import scanner class import java.util.Scanner; public class StudentGrade { public static void main(String[] args) { //initialize variables int programs; int homeworks; int examinations; double finalSemesterScore; //create scanner Scanner keyboard = new Scanner(System.in); //input total program score from the user System.out.print("Please enter total program score (0-200): "); programs = keyboard.nextInt(); //input total homework score from the user System.out.print("Please enter total homework score (0-500): "); homeworks = keyboard.nextInt(); //input examination score from the user System.out.print("Please enter examination score (0-100): "); examinations = keyboard.nextInt(); //calculate final semester score finalSemesterScore = 50*(programs*.005) + 30*(homeworks*.002) + 20*(examinations*.01); //print final semester score System.out.println("Final semester score is: " + finalSemesterScore); } }
I am a software engineer with a computational physics focus. The purpose of this blog is to showcase my ideas and works. I can create value and reduce costs for your company.