1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Black_prince [1.1K]
2 years ago
7

Using Python I need to Prompt the user to enter in a numerical score for a Math Class. The numerical score should be between 0 a

nd 100. Prompt the user to enter in a numerical score for a English Class. The numerical score should be between 0 and 100. Prompt the user to enter in a numerical score for a PE Class. The numerical score should be between 0 and 100. Prompt the user to enter in a numerical score for a Science Class. The numerical score should be between 0 and 100. Prompt the user to enter in a numerical score for an Art Class. The numerical score should be between 0 and 100. Call the letter grade function 5 times (once for each class). Output the numerical score and the letter grade for each class.
Computers and Technology
1 answer:
yaroslaw [1]2 years ago
7 0

Answer:

<em>The program doesn't use comments; See explanation section for detailed line by line explanation</em>

<em>Program starts here</em>

def lettergrade(subject,score):

     print(subject+": "+str(score))

     if score >= 90 and score <= 100:

           print("Letter Grade: A")

     elif score >= 80 and score <= 89:

           print("Letter Grade: B")

     elif score >= 70 and score <= 79:

           print("Letter Grade: C")

     elif score >= 60 and score <= 69:

           print("Letter Grade: D")

     elif score >= 0 and score <= 59:

           print("Letter Grade: F")

     else:

           print("Invalid Score")

maths = int(input("Maths Score: "))

english = int(input("English Score: "))

pe = int(input("PE Score: "))

science = int(input("Science Score: "))

arts = int(input("Arts Score: "))

lettergrade("Maths Class: ",maths)

lettergrade("English Class: ",english)

lettergrade("PE Class: ",pe)

lettergrade("Science Class: ",science)

lettergrade("Arts Class: ",arts)

Explanation:

The program makes the following assumptions:

Scores between 90–100 has letter grade A

Scores between 80–89 has letter grade B

Scores between 70–79 has letter grade C

Scores between 60–69 has letter grade D

Scores between 0–69 has letter grade E

<em>Line by Line explanation</em>

This line defines the lettergrade functions; with two parameters (One for subject or class and the other for the score)

def lettergrade(subject,score):

This line prints the the score obtained by the student in a class (e.g. Maths Class)

     print(subject+": "+str(score))

The italicized determines the letter grade using if conditional statement

<em>This checks if score is between 90 and 100 (inclusive); if yes, letter grade A is printed</em>

<em>      if score >= 90 and score <= 100:</em>

<em>            print("Letter Grade: A")</em>

<em />

<em>This checks if score is between 80 and 89 (inclusive); if yes, letter grade B is printed</em>

<em>      elif score >= 80 and score <= 89:</em>

<em>            print("Letter Grade: B")</em>

<em />

<em>This checks if score is between 70 and 79 (inclusive); if yes, letter grade C is printed</em>

<em>      elif score >= 70 and score <= 79:</em>

<em>            print("Letter Grade: C")</em>

<em />

<em>This checks if score is between 60 and 69 (inclusive); if yes, letter grade D is printed</em>

<em>      elif score >= 60 and score <= 69:</em>

<em>            print("Letter Grade: D")</em>

<em />

<em>This checks if score is between 0 and 59 (inclusive); if yes, letter grade F is printed</em>

<em>      elif score >= 0 and score <= 59:</em>

<em>            print("Letter Grade: F")</em>

<em />

<em>If input score is less than 0 or greater than 100, "Invalid Score" is printed</em>

<em>      else:</em>

<em>            print("Invalid Score")</em>

This line prompts the user for score in Maths class

maths = int(input("Maths Score: "))

This line prompts the user for score in English class

english = int(input("English Score: "))

This line prompts the user for score in PE class

pe = int(input("PE Score: "))

This line prompts the user for score in Science class

science = int(input("Science Score: "))

This line prompts the user for score in Arts class

arts = int(input("Arts Score: "))

The next five statements is used to call the letter grade function for each class

lettergrade("Maths Class: ",maths)

lettergrade("English Class: ",english)

lettergrade("PE Class: ",pe)

lettergrade("Science Class: ",science)

lettergrade("Arts Class: ",arts)

You might be interested in
The expressions in each part of an AND or OR expression use ________ evaluation; that is, they are evaluated only as much as nec
I am Lyosha [343]

Answer:

The expressions in each part of an AND or OR expression use <u>Short Circuit</u> evaluation; that is, they are evaluated only as much as necessary to determine whether the entire expression is true or false.

Explanation:

Logic operations follow different type of evaluation methods that can be short circuit or open circuit evaluation. In short circuit evaluation if first operand of the expression is true or false in OR or AND operation respectively, the result will found as true or false without checking the second operand of the expression. This is called Short Circuit Evaluation.

In OR operation, If first operand is true it means that the result of the expression is true without knowing that the other operand is true or false. In AND operation, If the first operand is False, the result will found as False without knowing that whether the 2nd operand is  true or false.

This Mechanism is called Short Circuit Evaluation.

4 0
3 years ago
In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server
rjkz [21]

Answer:

Distributed DOS attacks.

Explanation:

Computers in a network or the network itself is are prone to cyber attacks. A cyber attack is a concept of taking advantage of computer network vulnerabilities, to retrieve information from the target source. An example of these types of security attacks is the denial of service (or DOS) attacks.

The DOS  or the distributed DOS attack prevents users form accessing or requesting a service that they are legitimately allowed, by flooding the target system with superfluous resource request from millions of computers, controlled by the attacker.

8 0
2 years ago
How to create a delete button in Python?
deff fn [24]

Answer:

class Db_test(models.Model):

   name = models.CharField(max_length=50)

   comment = models.CharField(max_length=200)

   created = models.DateField(auto_now_add=True)

   modified = models.DateField(auto_now=True)

   class Meta:

       db_table = "db_test"

Explanation:

5 0
3 years ago
How to do 2. Pleaser
V125BC [204]

Answer:

GOD HAS FORSAKEN YOU NOW PRAISE DHAR MANN

6 0
3 years ago
Sending an identical message in an e-mail blast to all customers is an example of
disa [49]

Answer:

Broadcast message

Explanation:

A broadcast message is an identical message sent to a lot of recipients. When it is an email, it can be sent in Carbon Copy (Cc) or a Blind Carbon Copy (Bcc) form.

With the<em> Carbon Copy</em>, every recipients will be notified about the other recipients. In most cases all the email usernames of the recipients will be sent to all the recipients individually.

With the <em>Blind Carbon Copy</em>, every individual sees the message as he/she received it alone. The individual is not notified about the other recipients.

8 0
3 years ago
Other questions:
  • You are reluctant to write an extra credit book report because you are afraid that your language and punctuation skills are not
    11·1 answer
  • Explain why this scenario points towards a potential problem with BIOS.
    10·2 answers
  • What does OLE stand for? Object
    8·2 answers
  • ​______________________ is a general security term that includes computer​ viruses, worms, and trojan horses.
    13·1 answer
  • Describe some ways that you personally use information technologies differently than you did just a few years ago
    11·1 answer
  • 120
    14·1 answer
  • Anyone down to play gta later i play on ps4?
    15·2 answers
  • Is orgenized maningful and useful data​
    15·1 answer
  • How many pages is 1500 words double spaced 12 font?.
    10·1 answer
  • By the mid-1990s, how did revenue generated from video games compare to revenue generated from movies?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!