Sure! Here's a Python program that fulfills your requirements:
```python
def get_student_grades():
student_ids = []
grades = []
for i in range(10):
student_id = input(f"Enter student ID for student {i+1}: ")
grade = float(input(f"Enter final grade for student {i+1}: "))
student_ids.append(student_id)
grades.append(grade)
return student_ids, grades
def display_student_grades(student_ids, grades):
print("Student Grades:")
for i in range(len(student_ids)):
print(f"Student ID: {student_ids[i]}, Grade: {grades[i]}")
def get_highest_grade(grades):
return max(grades)
def get_lowest_grade(grades):
return min(grades)
def get_class_average(grades):
return sum(grades) / len(grades)
# Main program
student_ids, grades = get_student_grades()
display_student_grades(student_ids, grades)
highest_grade = get_highest_grade(grades)
lowest_grade = get_lowest_grade(grades)
class_average = get_class_average(grades)
print(f"\nHighest Grade: {highest_grade}")
print(f"Lowest Grade: {lowest_grade}")
print(f"Class Average: {class_average}")
```
Explanation:
1. We first define the `get_student_grades` function to prompt the user to input the student IDs and grades for each student. It makes use of two lists, `student_ids` and `grades`, to store the input values.
2. Next, we define the `display_student_grades` function to print out the student IDs and grades in a formatted manner. It iterates through both lists using a for loop and uses string formatting to display the information.
3. We then define three additional functions: `get_highest_grade`, `get_lowest_grade`, and `get_class_average`. These functions take the `grades` list as input and use built-in Python functions (`max`, `min`, and `sum`) to calculate the highest grade, lowest grade, and class average, respectively.
4. Finally, in the main program section, we call the `get_student_grades` function to retrieve the student IDs and grades from the user. Then, we call the `display_student_grades` function to display the inputted data.
5. We calculate the highest grade, lowest grade, and class average using the respective functions and print them out in the desired format.
Note: In the code, I assumed that the grades are input as floating-point numbers. If you want to accept integer grades instead, you can modify the code accordingly.