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
Files and e-mail messages sent over the Internet are broken down into smaller pieces called _____.
Fynjy0 [20]
Files and email messages sent over the internet are broken down into smaller pieces called packets
6 0
3 years ago
In web developing, what are the differences between front-end developer, back-end developer and full stuck developer?
Ilia_Sergeevich [38]

When it comes to front end, back end and full stack developer, the difference is determined by :

front end (the visible parts of a website)

back end (the “under the hood” databases and infrastructure)

full stack (a hybrid of both)

And front end developers work on technologies that are used to build front end(which is what clients visiting that website see)of application like HTML,CSS, Javascript ( Node js, Angular are also now used ).

Similarly back end developers work on back end technologies like Node js.

Full stack developers work on both front end and back end developers and know  both end technologies as well.

For example :

MEAN Stack developer where

M stands for Mongoose ( Back end database technology )

E stands for Express ( Back end technology)

A stands for angular ( front end technology)

N stands for Node ( back end technology)

8 0
3 years ago
Which feature of a blog helps to store and retrieve older posts?
Rashid [163]
Could it be archive posts? I'm not sure, but I believe it's archive posts.
8 0
3 years ago
Read 2 more answers
Pls help me computer science discoveries
lara31 [8.8K]

Answer:

jdinwoahdjsioadjsakodsiaohdeioajfnsohfujkdshksyfneowjdfikdjiadjsadhnsuidghaiudbnha

Explanation:

3 0
2 years ago
Write a subclass named 'ReadWrite' with the following additional behavior: Any necessary constructors. a method named 'setVal' t
nataly862011 [7]

Answer:

Java Class given below

Explanation:

class ReadOnly

{

protected int val;

public ReadOnly(int arg)

{

val = arg;

}

public int getVal()

{

return val;

}

}

class ReadWrite extends ReadOnly

{

private boolean dirty;

public ReadWrite(int arg)

{

super(arg);

dirty = false;

}

public void setVal(int arg)

{

val = arg;

dirty = true;

}

public boolean isDirty()

{

return dirty;

}

}

6 0
3 years ago
Other questions:
  • What might be the best response to a cyberbuly attack
    6·2 answers
  • Numeric data is stored in ___________ for direct processing.
    10·2 answers
  • What are the 6 external parts of a computer
    14·1 answer
  • When using presentation aids A. make the aid available for the audience to look at throughout the speech. B. prepare to give you
    6·1 answer
  • Category 6 is an example of a ________ used to connect wired network devices.
    9·1 answer
  • The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz
    8·1 answer
  • Rob creates a Course_Details table that has four columns: Course _ID, Course_Name, Semester and Credits. A course may have 0.5 c
    6·2 answers
  • Write a chemical reaction to show that nitric acid contains nitrogen​
    15·1 answer
  • Nicole is in a study group to prepare for a test on plant biology, a subject she knows a lot about. During their meetings, she a
    8·2 answers
  • Which of the following are drivers of machine learning growth?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!