Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python with detailed comments please... You should only use functionality covered in CS115 in your solution. Your solution for this lab should not use

image text in transcribedimage text in transcribed In python with detailed comments please...

  • You should only use functionality covered in CS115 in your solution.
  • Your solution for this lab should not use lists, tuples, dictionaries.
  • Do NOT use the string split() function.
  • Include a docstring for your functions.
  1. Download the files courses.txt, students.txt.
  2. Create a module, course_info.py that contains the following functions:
    1. get_grade(): takes a string grade as a parameter, and returns the float grade points for the given grade. Example: A -> returns 4.0.
    2. find_id(): takes a string file name and a student name as parameters. Returns the id of the student with the given name. If no student is found, returns -99. The student name is not case sensitive.
    3. find_courses(): takes a file name and a student id, and semester as parameters. Returns the average grade points, and string set of courses for the student with the given id, for the given semester. If no courses are found, average will be zero and the (string) courses will be an empty string.
  3. Write a script, yourname_student_app.py that inputs the name of a student and a semester from the user. Using functionality defined in the module, your program should display the courses taken by the student and the average grade of the student for the given semester. If student/courses are not found, display a meaningful message (see sample run below). Write the student id and average grade to a file with the name .txt . The program should keep inputting student names/semesters and searching courses until the user inputs exit for the student name to quit (not case sensitive).
  4. Upload course_info.py and yourname_student_app.py in a zip file with the name: Lab04_yourname.zip.

Sample Runs:

Enter student name to search(quit to exit): Kaan Kolay

Enter semester: Fall 2020

Course Summary:

ENG101

MATH102

Average Grade Fall 2020: 3.85

Enter student name to search(quit to exit): Selin Yetis

Enter semester: Fall 2020

Courses Not Found!

Enter student name to search(quit to exit): Hande Oral

Enter semester: Spring 2020

Student Not Found!

Enter student name to search(quit to exit): quit

courses.txt

12345,Fall 2020,ENG101 A 12345,Spring 2020,TURK102 B+ 98734,Fall 2019,HUM112 C 34567,Spring 2020,CS101 A- 98734,Fall 2020,ENG102 C+ 12345,Fall 2020,MATH102 A- 98734,Fall 2020,MBG201 B- 34567,Spring 2020,CHEM100 C- 12345,Spring 2020,HIST201 B

students.txt

89454-Anna Karpat 20987-Alara Roberts 98734-Mert Eren 12345-Kaan Kolay 45678-Selin Yetis

students.txt 89454-Anna Karpat 20987-Alara Roberts 98734-Mert Eren 12345-Kaan Kolay 45678-Selin Yetis courses.txt 12345, Fall 2020, ENG101 A 12345, Spring 2020, TURK102 B+ 98734, Fall 2019, HUM112 C 34567, Spring 2020, C5101 A- 98734, Fall 2020, ENG102 C+ 12345, Fall 2020,MATH102 A- 98734, Fall 2020,MBG201 B- 34567, Spring 2020, CHEM100 C- 12345, Spring 2020, HIST201 B

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago