The Student Grade Calculator X47713


Statement
 

pdf   zip

html

Input

Input must be two lines, the first containing the student school grades and the second the weight of each grade. Values will be separated by one space. Grades are numbers between 0.0 and 10.0. Weights are numbers between 0.0 and 1.0.

Output

The output will print a single line with the weighted arithmetic mean of the input values considering the weights. Only output one decimal digit.

The student final grade is weighted arithmetic mean value

Public test cases
  • Input

    6.5 7.7 7.2 10.0 7.0 8.5
    0.1 0.1 0.1 0.1 0.2 0.4
    

    Output

    The student final grade is 7.9
  • Input

    8.5 9.0 10.0 8.6
    0.1 0.2 0.2 0.5

    Output

    The student final grade is 8.9
  • Input

    10.0
    1.0

    Output

    The student final grade is 10.0
  • Input

    7.0 4.5 5.5 6.4 8.0 3.5 5.0 5.5 6.5 7.0 5.5 8.5 7.6
    0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.4

    Output

    The student final grade is 6.7
  • Input

    5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0
    0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02
    
    

    Output

    The student final grade is 5.0
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++ Python
    User solutions
    C++ Python Rust