Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 01 (10 points) Write a Python script that will prompt for the scores of the 6 homework and 7 lab assignments in this course,

Task 01 (10 points)

Write a Python script that will prompt for the scores of the 6 homework and 7 lab assignments in this course, and then calculate the amount of extra credit you would need in order to get a 90% or higher in the class. You are allowed to ask for the scores to be entered in any format and in as many prompts as you like.

Input string

Expected output of script

Enter your hw scores:

40, 40, 50, 40, 50, 40

Enter your lab scores:

100, 90, 90, 100, 90, 90, 100

you need at least 80 points of extra credit to get a 90% in this class

Hint: Remember how many total points are available for this course = 1000

Task 02 (10 points)

Write a Python script that will continually prompt for a string in the following format and do the necessary calculations based on the given operator using a separate function for each operator. It should be able to perform addition, subtraction, multiplication, division, exponentiation (where first number is base and second is power), modulo.

Input string

Expected output of script

Enter calculation: add 1 2 3 4

Enter calculation: sub 20 30 100 50

Enter calculation: mul 60 7

Enter calculation: div 10 5

Enter calculation: exp 3 2

Enter calculation: mod 3 12

Sum: 10

Difference: -160

Product: 420

Quotient: 2

Power: 9

Modulus: 3

Task 03 (20 points)

Write a Python script that will simulate a dice roll. It should prompt for a number of sides and then return a random number that might be rolled with a die of that number of sides. Assume a standard die that starts at 1 and goes to the given number of sides.

Input string

Expected output of script

Enter number of sides: 4

Enter number of sides: 6

Enter number of sides: 20

Roll: 2

Roll: 4

Roll: 11

Task 04 (30 points)

Consider the following list of student grades. Write a script that will open the file and calculate the average for each student and the grade that the student would receive based on the grade scale for this course found in the syllabus. It should save the output to a file named out604.txt

Input file (lab0604.csv)

Expected output file (out604.txt)

name,hw1,h2,h3,lb1,lb2,lb3,ec,fn

Andrew,69,52,32,83,22,33,77,34

Brandon,87,80,79,85,99,92,77,80

Chelsey,98,97,91,92,93,99,91,94

Deborah,51,61,28,58,34,53,74,39

Erik,80,88,97,88,102,106,86,94

Arielle,73,73,88,79,73,80,90,82

Shaun,61,76,77,69,71,80,74,67

Ninette,88,67,28,42,51,66,57,43

Nguyen,5,23,93,60,31,25,65,23

Name grade letter

Andrew 50.25 E

Brandon 84.88 B

Chelsey 94.38 A

Deborah 49.75 E

Erik 92.62 A-

Arielle 79.75 C+

Shaun 71.88 C-

Ninette 55.25 E

Nguyen 40.62 E

Task 05 (30 points)

Write a Python script that will take in a name and return the respective address based on a csv file of names and addresses. If the name is not found in the file, prompt the user to enter an address for that name and add it to the file.

Input

Expected output

Todd

Frankie

Homer

Add address: 742 Evergreen Terrace

Homer

Todd: 344 South Fairview

Frankie: 1123 Wilson Way

No address found for Homer

Homer: 742 Evergreen Terrace

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions