Question

Using python, write the program below. Program Specifications: You are to write the source code and...

Using python, write the program below.

Program Specifications:

You are to write the source code and design tool for the following specification:

A student enters an assignment score (as a floating-point value). The assignment score must be between 0 and 100. The program will enforce the domain of an assignment score.

Once the score has been validated, the program will display the score followed by the appropriate letter grade (assume a 10-point grading scale). The score will be displayed as a floating-point number with one value to the right of the decimal point.

Score 89.9           Grade B

Score 77.3           Grade C

Once a score has been processed, the program will ask the user if he or she wishes to enter another grade. The program will continue entering grades until the user chooses to stop. Once the user selects stop, the program will display the following:

Highest Assignment Score entered: 99.9 #99.9 is a placeholder value the represents the users input#

Lowest Assignment Score entered: 99.9

Average Assignment Score………..:   99.9

Submission Requirements:

  • You are to write your source code and create a source code document. You are to create your design tool. You are to attach the *.py source code and your design tool document to the Canvas assignment thread.

YOU CANNOT:

  • Use global variables
  • Use the word goto

Homework Answers

Answer #1

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thank You.

askGradeAndPrint.py

def getScore():
score = float(input("Enter score : "))
while(score<=0 or score>100):
score = float(input("Error !!! Please enter score in range 0-100 : "))
return score

def getGrade(score):
if score>=90:
return ('A')
elif score>=80:
return ('B')
elif score>=70:
return ('C')
elif score>=60:
return ('D')
else:
return ('F')


highscore=-999
lowscore = 999
count = 0
total = 0
print("Enter grades below or enter negative value to exit....")
while True:
score = getScore()
print("Score %.3f%15s %c"%(score,"Grade",getGrade(score)))
if highscore<score:
highscore=score
  
if lowscore>score:
lowscore=score
  
total += score
  
count+=1
  
choice = input("Would you like to continue [y/n] ? ");
if(choice[0]!='y' and choice[0]!='Y'):
break
  
print("Highest Assignment Score entered : ",highscore)
print("Lowest Assignment Score entered : ",lowscore)
print("Average Assignment Score : ",total/count)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using Python, write the following code. You are to allow the user to enter the daily...
Using Python, write the following code. You are to allow the user to enter the daily temperature as a floating-point number. You should make the assumption that you are recording temperatures in Fahrenheit. You should allow the user to continue entering temperatures until the value -999 is entered. This number should not be considered a temperature, but just a flag to stop the program. As the user enters a temperature, you should display the following each time: Current Temperature: 999...
5) Create a Java program using Scanner: Write a program where you will enter the grade...
5) Create a Java program using Scanner: Write a program where you will enter the grade score for 5 classes, then it will display total points and average and it will display the grade based on percentage. Steps: 1) Declare variable integer for English, Chemistry, Java Programming, Physics and Math 2) Declare variable total and percentage 3) Create Scanner object and prompt the user to enter grades for each class and input grades after each class 4) Calculate total of...
Python code only! (Do not include breaks or continue functions) Write a program that asks the...
Python code only! (Do not include breaks or continue functions) Write a program that asks the user to enter the amount that they budgeted for the month. A loop should then prompt the user to enter their expenses, one at a time and to enter 0 to quit. When the loop finishes, the program should display the the amount of budget left. (a negative number indicates the user is over budget and a positive number indicates the user is under...
Java: Distance calc. This question is fairly straightforward. Design implement (source code) a program to compute...
Java: Distance calc. This question is fairly straightforward. Design implement (source code) a program to compute the distance between 2 points. The program prompts the user to enter 2 points (X1, Y1) and (X2, Y2). The distance between 2 points formula is: Square_Root [(X2 – X1)^2 + (Y2 – Y1)^2] Document your code, properly label the input prompts, and organize the outputs as shown in the following sample runs. Note: for C++, #include and then call sqrt(). For Java, you’ll...
Program specifications: For this assignment, you will write a C/C++ program to maintain a fixed size...
Program specifications: For this assignment, you will write a C/C++ program to maintain a fixed size library of 1024 documents, whose size randomly ranges between 2MB to 3MB. This library is managed in a FIFO fashion. The software also maintains a separate, fixed size C-style struct (named recent_list) containing 128 pointers that points to a different set of individually initialized documents, whose size randomly ranges between 2MB to 3MB. At start up, every document is individually initialized with random upper...
PART B- Javascript Using a text editor (VS Code or Notepad) and a web browser, you...
PART B- Javascript Using a text editor (VS Code or Notepad) and a web browser, you will demonstrate how to create an HTML file, externally link a JavaScript file, and write some source code in the JavaScript file. a..Create two blank files to be an HTML file and a JavaScript file. The file names should be partA.html and partA.js. b.. Create a basic HTML webpage structure. c..Link the JavaScript file to the HTML file using the <script> tag. d.. Prompt...
Write a program that asks for five test scores. The program should calculate the average test...
Write a program that asks for five test scores. The program should calculate the average test score and display it. The number displayed should be formatted in fixed-point notation, with one decimal point of precision. Display: (1) your (1) interactive dialog with the console, (2) the five test scores entered, and (3) the computed average. the pseudo code is: you will need to include a library for the output formatting for specifying decimal point display: #include <iomanip> in std namespace...
For this assignment, you need to submit a Python program that gathers the following employee information...
For this assignment, you need to submit a Python program that gathers the following employee information according to the rules provided: Employee ID (this is required, and must be a number that is 7 or less digits long) Employee Name (this is required, and must be comprised of primarily upper and lower case letters. Spaces, the ' and - character are all allowed as well. Employee Email Address (this is required, and must be comprised of primarily of alphanumeric characters....
Draw flowchart AND write pseudo code User asks you to develop a program to calculate and...
Draw flowchart AND write pseudo code User asks you to develop a program to calculate and print weekly payroll. Calculations must take into account the following: User input ? a. Income tax rate is rate is 15% (.15*salary) b. Social Security tax is 7.65% (.0765*salary) c. Display salary, income tax, social security tax, and net pay net pay=salary-income tax – social security tax
Using C++, Python, or Java, write a program that: In this programming exercise you will perform...
Using C++, Python, or Java, write a program that: In this programming exercise you will perform an empirical analysis of the QuickSort algorithm to study the actual average case behavior and compare it to the mathematically predicted behavior. That is, you will write a program that counts the number of comparisons performed by QuickSort on an array of a given size. You will run the program on a large number of arrays of a certain size and determine the average...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT