Report Card Display

Mr. Jones is an elementary school teacher who teaches 5 subjects to his class. Your task is to write a program that stores a student's name and grades as variables and then displays a report card in the following format:

Student: John Doe Course Grade ========================================= History B- Spelling A+ Reading A Math B+ Science C

Requirements

  • Use a variable to store the distance to the grades column so that it can be easily changed later.
  • You should have 8 variables: 6 for the grades, 1 for the student name, and 1 for the position of the grades column.

Hints

Spacing the columns

A number variable and strings will have to be combined when defining the spacing to the second column.

String.format("%-" + distance + "s" , "History")