005-003-004

Nested If: Grade Evaluation

Easy

Problem Description

Nested If: Grade Evaluation

In this problem, you will create a program that evaluates a grade (A–D) from an input score using nested if statements and displays the result to standard output.

Learning Objective

Learn how to create complex conditional branches by nesting if statements.

Problem

Create a program that evaluates grades based on score input.

  • 80 or above: A
  • 60-79: B
  • 40-59: C
  • Below 40: D

Input

Line 1: Score (integer)

Output

Score: [score]
Grade: [grade]

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up