Question
Program 1: file operations Please create a Python program, read through the file and process each record/line. For each student, show the name and letter
Program 1: file operations
Please create a Python program, read through the file and process each record/line. For each student, show the name and letter grade.
At the end, you would like to print out a summary, including
- How many students in the file?
- Average student scores in terms of percentage
- Which student (show student name) has the highest score?
- How many A student?
The same summary information should be written into an output file named 'Summary report.txt.'
Enhance your program by allowing user to enter the filename. If the filename does not exist, please say so and end your program gracefully.
Example
Summary report:
Program 2: using lists
Please create a second Python program. This program does similar things as Program 1, but you have to use lists to store various information. That is, when processing each line, put name, assignment, exam, and project into lists.
At the end, you don't need to produce a summary report. But rather, use the lists to output student details to screen and to a file called "Student detail report.txt"
Rubrics
Open and read file, write to a file | |
Loop for students and process each student (get the total and percent, determine letter grade, etc) | |
Number of students, number of A students Student with highest score, average student score | |
Lists (second program) | |
Total |
Fall 301/Assignment 3/ISM 301 assignment 3 solution 1.py', wdir='C: working/Teaching/2022 Fall 301/Assignment 3' Michigan)/from_box/COB Please enter data file name>students.txt Max 134.0 100.0 40.0 E Jack 190.0 190.0 96.0 A Joey 180.0 160.0 80.0 B Mary 170.0 170.0 70.0 B ===Summary=== Number of students: 4 The student with highest percent is Jack . The percent is 95.20% Number of A students is 1 the average is 79.00% Summary report created.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import numpy as np Simulate bouncing ball g 981 acceleration due to gravity initi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started