Write code to ask the user for a lab score and a test score. Call calculate_grade with the appropriate arguments, use the round() function to round the result to 2 decimal places and print the answer.
I'm doing this in Python.
def calculate_grade(lab_score, test_score):
grade = (lab_score * 50 + test_score * 50) / 100
return round(grade, 2)
def main():
lab_score = float(input("Enter lab score: "))
test_score = float(input("Enter test score: "))
print("Grade is {:.2f}".format(calculate_grade(lab_score, test_score)))
main()


Write code to ask the user for a lab score and a test score. Call calculate_grade...
Write a script that asks the user to input a number. If the value the user enters is a negative value, call the pre-defined function neg_value which consumes no arguments and returns no values. If the user enters a positive value, call the pre-defined function pos_value which consumes no arguments and returns no values. If the user enters a zero, display the message "Invalid Value". Doing this on Python. This is what I have: number = int(input("Enter a number: "))...
IN PYTHON. Write a function that ask the user to (a) enter a string, (b) ask the number of time to repeat the string and (c) ask user to input a delimiter to separate them. Call the function and append the test run to your solution. Here is a test run of what is wanted: Enter a string: Ted How many repetitions? 10 Separated by? [}(+ Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted
NOTE: USE PYTHON CS160 Computer Science Lab 14 Working with lists, functions, and files Objective: Work with lists Work with lists in functions Work with files Assignment: Part 1: Write a program to create a text file which contains a sequence of test scores. Ask for scores until the user enters an empty value. This will require you to have the scores until the user enters -1. After the scores have been entered, ask the user to enter a file...
Python Please!! Write code to ask the user to provide 2 numbers and to divide the two numbers to find the reminder. Return the reminder. Code must work if the user provides a zero as divisor.
Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...
Write a Python program that asks the user to type in their three quiz scores (scores between 0 and 100) and displays two averages. The program should be written so one function gets the user to input a score, another function takes the three scores and returns the average of them. And another function takes the three scores and averages the two highest scores (in other words, drops the lowest). Each of these functions should do the computation and return...
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Round the average...
using python
Do it now 2. Write a code with two functions of squared and square_root. At the beginning your code should ask the user to enter one number. Then it should ask the user what they want to do (enter s to calculate the squared value of the entered number and enter r to perform a square root). Then based on the choice of user (using if) the program should call the proper function. Each function, when executing, should...
In C code Directions: Write fully executable code when answering the following: 1. Write a function prototype for a function called GetInput that takes no arguments. The function will ask, get, and then return a double value input from the user. 2. Write the function definition for GetInput 3. Write the function call to GetInput using the variable points that has already been declared
c++ QUESTION 9 Write a code that ask the user for the number n of decimal to average. Then n times the code the user to enter all numbers that you save or accumulate each time. Finaly print to the console the average of the n values the user entered using the format: cout << " The average of the " << n << " number you entered is: " << averagedValue <<endl;