Question

In: Computer Science

in python You will be writing a program that can be used to sum up and...

in python You will be writing a program that can be used to sum up and report lab scores. Your program must allow a user to enter points values for the four parts of the problem solving process (0-5 points for each step), the code (0-20 points), and 3 partner ratings (0-10) points each. It should sum the points for each problem-solving step, the code, and the average of the three partner ratings and print out a string reporting the student’s information, points earned, and lab number. Each function referred to below must be implemented and have an appropriate docstring. Please work in order of the steps listed below.

1) Define the function called grade_lab that takes in the lab number and student id as parameters. Have it return a string in the form “Student: XXX earned 50 points on lab Y”. You may start by assuming all students earn 50 points.
2) Call the function with student id 12345 and for lab 3 and print the string it returns to the screen. Evaluate whether or not it is correct, and whether it could be improved (e.g, with spacing and formatting). Call again with different values and re-evaluate.
3) Define a function for grading parts of the problem solving process that takes the problem-solving step number (1-4) as a parameter, and prompts the user with a detailed message to enter the score for the giving problem-solving set (e.g., “Please enter a score 0 - 5 earned for understanding the problem: ”). The prompt must be specific to the step number entered.
4) In the grade_lab function, call the function for grading parts of the problem solving process and replace the 50 point value (referred to in step 1) with the score returned. Then, call the function for steps 2 - 4, and print the total of all scores.
5) Define a function that prompts the user to enter a score grading code. Be sure to know what values are expected.
6) In the grade lab function, call the function for grading code and add its value to the total score reported. Test your code to make sure the total score is being calculated correctly.
7) Define a function that prompts the user to enter 3 partner rating scores (be sure to include expected values) and returns the average of those scores.
8) In the grade lab function, call the function for getting partner ratings and it to the total score reported. Test this partner function with at least the following values: 10, 10, 10; and then 0, 5, 10. Evaluate whether or not the function is working correctly.
9) Update your grade_lab function to store names associated with various student ids. Hard code some example id numbers and student names. Update the string returned to include the student name along with their id number.
10) Execute your code for two different students who received different scores. Evaluate the values printed to screen and update your code as needed.

Solutions

Expert Solution

Thanks for the question. Below is the code you will be needing. Let me know if you have any doubts or if you need anything to change. 

Let me know for any help with any other questions.

Thank You!
===========================================================================

#5
def get_grading_code_score():
    score = int(input('Enter grading code score: '))
    return score

#7
def get_partner_ratings():
    total = 0
    for partner in range(1, 4):
        score = int(input('Enter rating 0-10 for partner #{}: '.format(partner)))
        total += score
    return total / 3


# 3
def get_score(step_no):
    score = int(input('Please enter a score 0-5 for step #{}: '.format(step_no)))
    return score

# 1
def grade_lab(lab_no, student_id):
    # 4
    total_step_score =0
    for step in range(1,5):
        score = get_score(step)
        total_step_score+=score
    grading_score = get_grading_code_score()
    partner_rating = get_partner_ratings()
    total = int(total_step_score + grading_score + partner_rating)
    return f'Student {student_id} earned {total} points on lab {lab_no}'


def main():
    student_ids = [12345, 23456, 34567]
    lab = 90
    for student_id in student_ids:
        gr_lab = grade_lab(lab, student_id)
        print(gr_lab)


main()

=====================================================================


Related Solutions

What method is used to set up a file for reading and/or writing? code in python
What method is used to set up a file for reading and/or writing? code in python
In python make a simple code. You are writing a code for a program that converts...
In python make a simple code. You are writing a code for a program that converts Celsius and Fahrenheit degrees together. The program should first ask the user in which unit they are entering the temperature degree (c or C for Celcius, and f or F for Fahrenheit). Then it should ask for the temperature and call the proper function to do the conversion and display the result in another unit. It should display the result with a proper message....
Writing a Modular Program in Python In this lab, you add the input and output statements...
Writing a Modular Program in Python In this lab, you add the input and output statements to a partially completed Python program. When completed, the user should be able to enter a year, a month, and a day. The program then determines if the date is valid. Valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31. Instructions Notice that variables have been declared...
(Python) Implement a function to compute a sum that can compute sum for an arbitrary number...
(Python) Implement a function to compute a sum that can compute sum for an arbitrary number of input integers or float numbers. In other words, calls like this should all work: flexible_sum(x1, x2) # sum of two integer or float numbers or strings x1 and x2 flexible_sum(x1, x2, x3) # sum of 3 input parameters and can also handle a single input parameter, returning it unchanged and with the same type, i.e.:   flexible_sum(1) returns 1 and can accept an arbitrary...
Write a python program to sum the prime numbers existing in an array . For instance...
Write a python program to sum the prime numbers existing in an array . For instance , if A = [4, 7, 12, 3, 9] the output should be 10
Write a Python program that calls a function to sum all the numbers in a list...
Write a Python program that calls a function to sum all the numbers in a list and returns the result to the caller. The main program creates a list (with hard-coded or user input) and passes the list as an argument to the function. You may not use the built-in function, sum. The program calls a second function to multiply all the numbers in a list passed to it by main and returns the product back to the caller. List...
Writing python code: Can you do for me this. The question looks bellow Overview : As...
Writing python code: Can you do for me this. The question looks bellow Overview : As a programmer, you have be asked by a good friend to create a program that will allow them to keep track of their personal expenses. They want to be able to enter their expenses for the month, store them in a file, and then have the ability to retrieve them later. However, your friend only wants certain people to have the ability to view...
The following program is used to sum arrays. Fill in blanks of the following program to...
The following program is used to sum arrays. Fill in blanks of the following program to complete the program and make the output is: s = 150. #include <iostream.h> class Arr { int *a,n; public: Arr():a(0),n(0){} Arr(int *aa, int nn) {n=nn; a=new int [n]; for(int i=0;i<nn;i++) *(a+i)=*(aa+i); } ~Arr(){delete a;} _____________ {return *(a+i);} }; void main() { int b [5]={10,20,30,40,50}; Arr a1(b,5); int i=0,s=0; _____________ s+=a1.GetValue(i); cout<<"s="<<s<<endl; }
Python Programming Question: Objective: Sum of Numbers. Design a program with a loop that asks the...
Python Programming Question: Objective: Sum of Numbers. Design a program with a loop that asks the user to enter a series of positive numbers. The user should enter "0" (zero) to signal the end of the series. After all the positive numbers have been entered, the program should display their sum. The program should display the following: • Contain proper indentation. • Comments (Blocks or Lines). • Good Variables initializations. • Good questions asking for the parameters of the code....
The sixth assignment involves writing a Python program to read in the temperatures for ten consecutive...
The sixth assignment involves writing a Python program to read in the temperatures for ten consecutive days in Celsius and store them into an array. The entire array should then be displayed. Next each temperature in the array should be converted to Fahrenheit and the entire array should be again be displayed. The formula for converting Celsius to Fahrenheit is °F = (°C × 1.8) + 32. Finally, the number of cool, warm and hot days should be counted and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT