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...
You are writing a billing program that adds up the items a user enters. Your program...
You are writing a billing program that adds up the items a user enters. Your program should use a loop and prompt the user for the item number for each item in inventory to add to the bill. (You can ask the user for the number of items you will enter and use a counter controlled loop or a sentinel controlled loop that has a stop number. Either way is fine.) Here is the table of items in inventory: Item...
PYTHON: Im writing a program to make a simple calculator that can add, subtract, multiply, divide...
PYTHON: Im writing a program to make a simple calculator that can add, subtract, multiply, divide using functions. It needs to ask for the two numbers from the user and will ask the user for their choice of arithmetic operation 1- subtract 2- add 3- divide 4- multiply
I'm writing a program that requires that I use the check sum technique with a for...
I'm writing a program that requires that I use the check sum technique with a for loop. A student enters their seven digit ID number. The seventh digit is determined from the other digits by this formula: 7th digit = (1 *(1st digit) + 2 * (2nd digit) + ... + 6 * (6th digit)) %10. The program should prompt users to enter a 7-digit number, and print valid if the actual 7th digit matches the computed 7th digit. Basicaly,...
I have a python program that must check if an integer is the sum of the...
I have a python program that must check if an integer is the sum of the squares of four consecutive prime numbers. However, when I run the program, it goes into an infinite while loop, and it doesn't give me any answer. I can only use the while, if, else, True and False commands. The code I'm using is n1=2   n2=3   n3=5   n4=7   n = int(input("n: "))   if (n==(n1**2)+(n2**2)+(n3**2)+(n4**2)):     print(n1,n2,n3,n4)   else :     i = 2     pr = True     next =...
(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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT