Introduction to Computer Science/3.5 Formative Activity: The 'Letter Grader'

3.5 Formative Activity: The 'Letter Grader'

MDX Parsing Error

[next-mdx-remote] error compiling MDX: Expected a closing tag for `<li>` (17:106-17:110) before the end of `paragraph` 15 | 16 | 1. Asks the user to enter a numeric grade between 0 and 100. > 17 | 2. Uses an `if/elif/else` chain to determine the correct letter grade based on the following scale: <ul> <li>**A:** 80 - 100 | ^ 18 | 3. **B:** 70 - 79 19 | 4. **C:** 60 - 69 More information: https://mdxjs.com/docs/troubleshooting-mdx

Raw Content:

<Callout title="🎯 Activity Goals" type="info">
- Apply your knowledge of `if/elif/else` chains to solve a practical problem.
- Practice the "Plan First, Code Second" workflow using pseudocode.
- Share your code and learn from your classmates in a supportive environment.
</Callout>

## Practice Task: The "Letter Grader" Program

It's time to put all the pieces of selection together! For this activity, you will write a program that functions as a simple grade calculator. It will take a numeric grade as input and print the corresponding letter grade as output.

### Your Task

Write a Python program that does the following:

1. Asks the user to enter a numeric grade between 0 and 100.
2. Uses an `if/elif/else` chain to determine the correct letter grade based on the following scale: <ul> <li>**A:** 80 - 100
3. **B:** 70 - 79
4. **C:** 60 - 69
5. **D:** 50 - 59
6. **F:** Below 50
7. Prints a message displaying the final letter grade.

**Example Output:**

```python
Please enter a numeric grade: 85
The letter grade is: A

```

---

## How to Submit (A Two-Step Process!)

Just like in Unit 1, we are using a Discussion Forum to showcase our work for this formative activity.

1. **Step 1: Post Your Code.** Navigate to the "**Unit 3 Code Showcase**" Discussion Forum. Create a new thread and paste your complete, working Python code into the body of the post.
2. **Step 2: Review and Comment.** Read through the posts from at least **two** of your classmates. Leave a positive, constructive reply on their threads.

<Callout title="Plan First!" type="info">
This is the perfect project to practice the planning skills from Unit 2. Before you write any Python, try writing out the pseudocode. It might look something like this:

DISPLAY "Please enter a numeric grade: "
GET grade from user
CONVERT grade to a number

IF grade &gt;= 80 THEN
    DISPLAY "The letter grade is: A"
ELIF grade &gt;= 70 THEN
    DISPLAY "The letter grade is: B"
ELIF grade &gt;= 60 THEN
    DISPLAY "The letter grade is: C"
ELIF grade &gt;= 50 THEN
    DISPLAY "The letter grade is: D"
ELSE
    DISPLAY "The letter grade is: F"
</Callout>

Interactive Sandbox

Use this space to practice writing code and complete the "Your Turn" activities above.

Python 3Initializing...
Loading code editor...
Program output will appear here...