Write a custom function with the definition def computegrade

Assignment Help Computer Engineering
Reference no: EM131917267

Problem

Score as its parameter and returns a grade as a string.

Score

Grade

> 0.9

A

> 0.8

B

> 0.7

C

> 0.6

D


F

1. Write a custom function with the definition def computegrade():

2. The function should compute the grade using the score variable based on the table above. You can use if-elif statements to accomplish this

3. Ensure your function has a "return" statement to return the computed grade back to the calling program

4. Once the function is defined, proceed to writing the part of the program that takes in user input for score.

5. Validate that the score is numeric within a try-except block.

6. Invoke the above-defined computegrade function with the user-supplied score. Ensure you capture the return value within your program into a variable placeholder, or else use the print statement to print the return value directly

7. Be sure to comment your program adequately!

8. Remember your Python code will be graded according to our class Rubric.

9. Submit your Python code file. Name it "XXXX-score-function.py" where XXXX is your name.

10. Submit also a Word document showing screen shots of the various testing conditions. Good programmers test all cases, so you should make sure you show tests for each possible grade level (A through F) plus error messages.

Reference no: EM131917267

Questions Cloud

How are rhel and centos different : How does this impact free linux distributions? How are RHEL and CentOS different? In linux, what is the default, super user account name?
What is the ph at the midpoint in the titration : When a 21.0 mL sample of a 0.308 M aqueous hypochlorous acid solution is titrated with a 0.388 M aqueous potassium hydroxide solution
Aqueous barium hydroxide solution : What is the pH at the equivalence point in the titration of a 18.7 mL sample of a 0.478 M aqueous acetic acid solution with a 0.370 M aqueous barium hydroxide.
Determine the ph during the titration : Determine the pH during the titration of 14.7 mL of 0.218 M nitric acid by 0.138 M potassium hydroxide at the following points:
Write a custom function with the definition def computegrade : Write a custom function with the definition def computegrade(): Validate that the score is numeric within a try-except block.
How businesses apply a set of beliefs in short term decision : You procure some business services but the vendor forgets to invoice you - and six months go by. Do you remind them to send the invoice? Why?
Organic chemical building blocks : Name and describe at least 3 ways in which the EARLY EARTH (and the other "Terrestrial" planets in the inner solar system; Mercury, Venus and Mars
How would you expect the solubility of silver fluoride : How would you expect the solubility of silver fluoride (AgF) to compare to the halides measured in lab (AgBr, AgCl, AgI)?
Write a article review - a better way to forecast : A Better Way to Forecast by Uriel Haran and Don A. Moore - What are the implications of the article for management practice

Reviews

Write a Review

Computer Engineering Questions & Answers

  Bourne shell and design suitable functions

Bourne shell and design suitable functions

  Show the amount of time

Convert the pseudocode given below into an executable shell script for Knoppix, following the similar order.

  Outline sound practices for reducing input errors

Outline sound practices for reducing input errors. Briefly discuss each

  Find out the upper control limit ucl and lower control

determine the upper control limit ucl and lower control limit lcl for an x-bar chart if six samples of subgroup size 3

  Demorgans theorem

Compute by means of the truth table the validity of DeMorgan’s theorem for three variables: (ABC)’ = A’ + B’ + C’. Simplify the following expressions using Boolean algebra. AB + A(CD + CD’)

  Describe what occurs in the fetch-execute cycle

Describe what occurs in the fetch-execute cycle of a von Neumann machine. Explain what part the system clock plays in this and how this has limited improvements in the performance of processors.

  Create the structure for the records in the customer file

Create the "structure" for the records in the customer file. Use given Figure as a general guide to the data elements to be included in the customer records. However, observe the following specific requirements:

  Determine the process used to add content and publish the

write a 200- to 300-word short-answer response to the followingwhat is the process used to add content and publish the

  Plot the capacity as a function of both w and p-n

Capacity Versus Bandwidth and SNR] The capacity of a bandlimited AWGN channel with input power constraint P and bandwidth W is given by.

  Write a program to plot the given face

Write a program to plot the following face. Provide a class FaceViewer and a class Face Component. Write a program that draws a picture of a house.

  Deducing security policy to mitigate the threat.

Information like sales data, client data, and the network configuration. Recognize the threats these significant items are subject to and deduce the security policy in order to mitigate that threat.

  Wireless networking

Explain the origins/genesis of the wireless networking. Explain the devices included used and how they operate.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd