import java.util.*;
/**
 * Course:        Data Structures and Algorithms for Language Processing WS 2010/2011
 * Assignment:    SelfTest 1, exercise1
 * Author:        Marie Hinrichs; modified by Frank Richter
 * Description:   A program that reads in a student's name, three homework assignment
 *                scores and the scores of a final exam; returns the name of a
 *                student and his/her final grade
 */
public class CalculateGrade 
{
    public static final double HW_WEIGHT = 0.60;
    public static final int NUM_HW_ASSIGNMENTS = 3;
    public static final double EXAM_WEIGHT = 0.4;
    
    public static void main(String args[])
    {
        Scanner keyboard = new Scanner(System.in);
        String lastName = "";
        String firstName = "";
        double hw1 = 0, hw2 = 0, hw3 = 0, hwAve = 0;
        double exam = 0;
        double finalScore = 0;
        
        // Read last and first names        
        firstName = keyboard.next(); // note: complete program should prompt the user for input
        lastName = keyboard.next();
        
        // Read scores
        hw1 = keyboard.nextDouble();
        hw2 = keyboard.nextDouble();
        hw3 = keyboard.nextDouble();
        exam = keyboard.nextDouble();
        
        // compute final score
        hwAve = (hw1 + hw2 + hw3) / NUM_HW_ASSIGNMENTS;
        finalScore = ((hwAve * HW_WEIGHT) +
                      (exam * EXAM_WEIGHT));
        
        System.out.println(lastName + ", " + firstName + " : " +
                           finalScore + "%");
    }
}
