Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a python code JCU Subject results explained shows the percentage score result you need to get different grades: Below 50% EN 50 up to

write a python code
image text in transcribed
image text in transcribed
JCU Subject results explained shows the percentage score result you need to get different grades: Below 50% EN 50 up to but not including 65 =P 65 up to but not including 75=C 75 up to but not including 85 =D . 85 and over = HD Note: think about the boundary conditions and don't miss anything. Remember to test your boundaries. Suppose you used 84 as your boundary, e.g. If score > B4 then HD Would that work? No, because what if the score were 84.1? That should be a D, but your code would make it an HD! This is where bugs come from :( Our strong recommendation is that you always use the values in the question. In this case, use 50, 85, etc. not 49, 49.9, or whatever. This will help prevent mistakes. Write a function that takes a subject total score and returns the corresponding JCU grade. Check: Are you getting used to this kind of wording? If the function "takes" a score, it means you must pass it into the function as a parameter. If the function "returns" a grade, it means you don't print it, you... return it Test it! Like we've done before (see the pattern?), write a separate function to test that all the grades can be produced correctly When your tests all pass, write a main program that asks the user for their score and prints their grade until they enter a score of

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions