From 0e812ef6cb97a8b1b8216b645265c8b75f321283 Mon Sep 17 00:00:00 2001 From: cheeks Date: Fri, 27 Jun 2025 01:26:16 +0000 Subject: [PATCH] docs: create home/code-exercises/student-grades --- home/code-exercises/student-grades.md | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 home/code-exercises/student-grades.md diff --git a/home/code-exercises/student-grades.md b/home/code-exercises/student-grades.md new file mode 100644 index 0000000..96284f3 --- /dev/null +++ b/home/code-exercises/student-grades.md @@ -0,0 +1,58 @@ +--- +title: Student Grades +description: +published: true +date: 2025-06-27T01:26:14.561Z +tags: +editor: markdown +dateCreated: 2025-06-27T01:26:14.561Z +--- + +# Exercise: Student Grades + +## Concept Focus +- Functions +- Conditional Statements +- Data Manipulation + +## Time Requirement +20-25 minutes + +## Difficulty Level +Medium + +## Problem Statement +Write a Python program that takes the following inputs: +- Student name +- Number of subjects (integer) +- Scores for each subject (list of integers) + +The program should then calculate and display the student's average score, as well as their grade based on the following scale: +- 90-100: A +- 80-89: B +- 70-79: C +- 60-69: D +- Below 60: F + +## Example Inputs and Expected Outputs +### Input +John Doe, 3, [85, 90, 78] +### Output +Student Name: John Doe +Average Score: 82.67 +Grade: B + +### Input +Jane Smith, 2, [92, 95] +### Output +Student Name: Jane Smith +Average Score: 93.5 +Grade: A + +## Instructions +1. Write a Python program that takes the student name, number of subjects, and scores as input. +2. Use functions to calculate the average score and determine the grade based on the provided scale. +3. Print out the student's name, average score, and grade. + +## Hint +- You can use the `sum()` function to calculate the total score, and then divide by the number of subjects to get the average score.