005-003-010

Multi-Level Nested Conditions

Hard

Problem Description

Multi-Level Nested Conditions

In this problem, you will create a program that reads three values from standard input, evaluates them in sequence using nested if statements, and displays the result (A/B/C) to standard output.

Learning Objective: Understand three or more levels of nested conditional branching

Overview

Read three values from standard input, check conditions in sequence, and output the result.

Input Format

score
attendance
project
  • Line 1: score (integer)
  • Line 2: attendance (integer)
  • Line 3: project (true or false)

Specifications

  • Check in order: score >= 60, attendance >= 80, project == true
  • Output "A" if all conditions are met
  • Output "B" if score or attendance is not met
  • Output "C" if project is false

Output Format

A

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