logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Write a Python code that gets a file name from a user using the input statement

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

HOMEWORK #3

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. 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 names and grades of the students after reading them. 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 successFailure Ratio, which is numSuccesses divided by numFailures.

Barbara 62.5

John 85.

Marvin 72.5

2. Please submit only one zip me 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. Name your Python codes as lastname1.py, lastname2.py, and so on.

3. 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.

4. If your Python code works with files, do not use file paths or commands specific to your computer. Your code is supposed to work on another computer as it is.

 

(5/5)
Attachments:

Expert's Answer

354 Times Downloaded

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

354 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

785 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

851 Answers

Hire Me
expert
Husnain SaeedComputer science

619 Answers

Hire Me
expert
Atharva PatilComputer science

838 Answers

Hire Me

Get Free Quote!

401 Experts Online