2023 1 Please submit only one zip file including only Python codes with py extension There will | Assignment Collections

Computer Science 2023 Python Homework

2023 1 Please submit only one zip file including only Python codes with py extension There will | Assignment Collections

1.Please submit only one zip file including only Python codes with .py extension.

There will be a separate .py file for each question in the zip file. Submissions in

other formats will not be accepted.

2. Codes are expected to be clear, legible and compact with minimum number of

lines and variables, and proper indentation. Variable names are expected to be

appropriate, meaningful and self-explanatory. Codes will be graded based on

these criteria. A correctly working code does not guarantee full credit.

Que 1. (55 points) Write a Python code that gets a file name from a user using the input

statement and reads it to obtain information about students. Each line of the file

includes information about a different student and has two items separated by a

space character. A file, grades.dat, that includes the names and grades of 10

students as shown below is given as an example. The first item is the student name

and the second item is the grade of that student. The code will read the information

in the file in a dictionary where student names are keys and their grades are values

using a for loop. The second item in each line that represents a grade will be

converted to float when it is read as a value in the dictionary. The code is expected

to print the name and grade of the student that are read in each execution of the

for loop. A grade is considered success if it is 70 or above, and failure if it is below

70. The code will count the number of successes, numSuccesses, and the number

of failures, numFailures. It will print successFailureRatio, which is numSuccesses

divided by numFailures.

Barbara 62.5

John 85.

Marvin 72.5

Lewis 95.

William 65.

Mary 87.5

Sandra 92.5

Jacob 60.

Leigh 75.

Pamela 67.5

Que 2. (45 points) Extend the Python code written in question 1 to raise exceptions for the

following three cases using try and except statements so that it will not crash. The

code is expected to have a separate except statement for each case. The code is

expected to print a relevant error message under each except statement:

a. (15 points) IOError if the file does not exist.

b. (15 points) ValueError if the second item in a line cannot be converted to

float. Assume that each line in the file has definitely two items separated by

a space character, but the second item may not be a number by mistake.

c. (15 points) ZeroDivisionError if there are no failures, which happens when

all grades are 70 or above.

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational