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 and 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.

Answers

Answer 1

Answer:

The program doesn't use comments; See explanation section for detailed line by line explanation

Program starts here

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

Line by Line explanation

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

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

     if score >= 90 and score <= 100:

           print("Letter Grade: A")

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

     elif score >= 80 and score <= 89:

           print("Letter Grade: B")

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

     elif score >= 70 and score <= 79:

           print("Letter Grade: C")

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

     elif score >= 60 and score <= 69:

           print("Letter Grade: D")

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

     elif score >= 0 and score <= 59:

           print("Letter Grade: F")

If input score is less than 0 or greater than 100, "Invalid Score" is printed

     else:

           print("Invalid Score")

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)


Related Questions

In this lab, you declare and initialize constants in a C++ program. The program, which is saved in a file named NewAge2.cpp, calculates your age in the year 2050.

Answers

Answer:

#include <iostream>

using namespace std;

int main()

{

   const int YEAR = 2050;

   int currentYear = 2020;

   int currentAge = 38;

   

   cout<<"You will be " << currentAge + (YEAR - currentYear) << " years old in " << YEAR;

   return 0;

}

Explanation:

Initialize the YEAR as a constant and set it to 2050

Initialize the currentYear as 2020, and currentAge as 38

Calculate and print the age in 2050 (Subtract the currentYear from the YEAR and add it to the currentAge)

if you want to exclude a portion of an image which option should be chosen?? A. Arrange B. Position C. Crop D. Delete

Answers

It would be C- crop. This allows you to specifically delete parts of the image using drag and drop features. Hope this helps!

Describe any five GSM PLMN basic services?

Answers

Answer:

Your answer can be found in the explanation below.

Explanation:

GSM is the abbreviation for Global System for Mobile communication. Its purpose is to transmit voice and data services over a range. It is a digital cellular technology.

PLMN is the abbreviation for Public Land Mobile network. It is defined as the wireless communication service or combination of services rendered by a telecommunication operator.

The plmn consists of technologies that range from Egde to 3G to 4G/LTE.

PLMN consists of different services to its mobile subscribers or users but for the purpose of this question, i will be pointing out just 5 of them alongside its definitions.

1. Emergency calls services to fire or police: Plmn provides us with the option to make emergency calls in the event of any accident or fire incident, etc.It is available on devices either when locked or unlocked.

2. Voice calls to/from other PLMN: This entails the putting of calls across to persons we cannot reach very quickly. PLMN helps to connect persons through its network of from other networks thus making communication easier.

3. Internet connectivity: PLMN provieds us with internet services through wifi or bundles that enable us have access to the internet as well as help us communicate with people and loved ones over a distance. Internet service are possble either on GPRS or 3G or 4G networks.

4. SMS service: SMS means short messaging service. This is also know as text messages. PLMN allows us to be able to send short messages to people as oppposed to mails. It is mostly instant and can be sent or recieved from the same PLMN or others.

5. MMS service: Multimedia messaging service whose short form is MMS ccan be descibed as the exchange of heavier messages such as a picture or music or document but not from an email. It is availabel for use from one PLMN to another.

Cheers.

If i wanted to change my phones simcard, does anything need transferring, or is it an easy swap?

Answers

Most likely not but I think you’ll have to log in your account like if you have an Apple phone . You’ll have to log into your Apple ID

DEF is a small consulting firm with ten on-site employees and 10 to 12 part-time (off-site) software consultants. Currently, the network consists of 2 servers for internal business processes, 1 server that handles the call-in connections; 10 on-site wireless workstations/devices, and 2 printers. Respond to the following in a minimum of 175 words: Identify one network security strategy that would help this organization. Why did you choose this strategy over others

Answers

Answer:

What i would suggest for the organization is to use the Testing Infrastructure strategy. it is good for your consulting firm because it is less costly and provide security.

Explanation:

Solution

There are different network security strategy which is listed below:

Segment the network:

Segmentation in network is very useful for providing security.If any threat is occur only one segment is effected remaining are safe and it is less cost process. very useful for small organizations.

Test your infrastructure :

Testing infrastructure also very good technique.

Always we have to test our infrastructure whether threat is occur or not.

If any threat is happen we can detect that easily by testing our infrastructure.

Regularly update anti-virus software :

This is very useful for small organizations and it is less cost.with less cost we can provide security for all devices like computer,server,modems etc.

Frequently backup your critical data :

This is very good technique for crucial data.If we backup important data any time that will be useful if any attack is happen.

This is less costs and simple.

Change router default security settings :

Changing router password and settings also helpful for providing security.If we maintain same password and same settings for a long time that may lead to data hacking.It is cost less process very useful for small organizations.

Write a python program that asks the user to enter a student's name and 8 numeric tests scores (out of 100 for each test). The name will be a local variable. The program should display a letter grade for each score, and the average test score, along with the student's name. There are 12 students in the class.
Write the following functions in the program:
calc_average - this function should accept 8 test scores as arguments and return the average of the scores per student
determine_grade - this function should accept a test score average as an argument and return a letter grade for the score based on the following grading scale:
90-100 A
80-89 B
70-79 C
60-69 D
Below 60 F

Answers

Answer:

The program doesn't make use of comments (See Explanation)

Also the source code is attached as image to enable you see the proper format and indexing of the source code

The program using python is as follows

def calc_average(name):

   score = []

   sum = 0

   for j in range(8):

       inp = int(input("Test Score"+str(j+1)+": "))

       score.append(inp)

       sum = sum + inp

       if inp>=90 and inp<=100:

           print("A")

       elif inp>=80 and inp<90:

           print("B")

       elif inp>=70 and inp<80:

           print("C")

       elif inp>=60 and inp<70:

           print("D")

       else:

           print("F")

   avg = sum/8

   print("Result Details of "+name)

   print("Average Score: "+str(avg))

   return avg

def determine_grade(result):

   if float(result) >= 90.0 and float(result) <= 100.0:

       print("Letter Grade: A")

   elif float(result) >= 80.0 and float(result) <90.0:

       print("Letter Grade: B")

   elif float(result) >= 70.0 and float(result) < 80.0:

       print("Letter Grade: C")

   elif float(result) >= 60.0 and float(result) < 70.0:

       print("Letter Grade: D")

   else:

       print("Letter Grade: F")

   print(" ")

for i in range(2):

   name = input("Student Name: ")

   result = calc_average(name)

   determine_grade(result)

Explanation:

def calc_average(name):  -> Declares the function calc_average(name); It accepts local variable name from the main function

   score = []

-> Initialize an empty list to hold test scores

   sum = 0

-> Initialize sum of scores to 0

   for j in range(8):

-> Iterate from test score 1 to 8

       inp = int(input("Test Score"+str(j+1)+": "))

-> This line accepts test score from the user

       score.append(inp)

-> The user input is then saved in a lisy

       sum = sum + inp

-> Add test scores

The following lines determine the letter grade of each test score      

if inp>=90 and inp<=100:

           print("A")

---

      else:

           print("F")

   avg = sum/8  -> Calculate average of the test score

The next two lines prints the name and average test score of the student

   print("Result Details of "+name)

   print("Average Score: "+str(avg))

   return avg

-> This line returns average to the main method

The following is the determine_grade method; it takes it parameter from the main method and it determines the letter grade depending on the calculated average

def determine_grade(result):

   if float(result) >= 90.0 and float(result) <= 100.0:

       print("Letter Grade: A")

   elif float(result) >= 80.0 and float(result) <90.0:

       print("Letter Grade: B")

   elif float(result) >= 70.0 and float(result) < 80.0:

       print("Letter Grade: C")

   elif float(result) >= 60.0 and float(result) < 70.0:

       print("Letter Grade: D")

   else:

       print("Letter Grade: F")

   print(" ")

for i in range(2):

-> This is the main method

   name = input("Student Name: ")  -> A local variable stores name of the student

   result = calc_average(name)  -> store average of scores in variable results

   determine_grade(result)-> Call the determine_grade function

In this exercise we have to use the computer language knowledge in python to write the code as:

the code is in the attached image.

In a more easy way we have that the code will be:

def calc_average(name):

  score = []

  sum = 0

  for j in range(8):

      inp = int(input("Test Score"+str(j+1)+": "))

      score.append(inp)

      sum = sum + inp

      if inp>=90 and inp<=100:

          print("A")

      elif inp>=80 and inp<90:

          print("B")

      elif inp>=70 and inp<80:

          print("C")

      elif inp>=60 and inp<70:

          print("D")

      else:

          print("F")

  avg = sum/8

  print("Result Details of "+name)

  print("Average Score: "+str(avg))

  return avg

def determine_grade(result):

  if float(result) >= 90.0 and float(result) <= 100.0:

      print("Letter Grade: A")

  elif float(result) >= 80.0 and float(result) <90.0:

      print("Letter Grade: B")

  elif float(result) >= 70.0 and float(result) < 80.0:

      print("Letter Grade: C")

  elif float(result) >= 60.0 and float(result) < 70.0:

      print("Letter Grade: D")

  else:

      print("Letter Grade: F")

  print(" ")

for i in range(2):

  name = input("Student Name: ")

  result = calc_average(name)

  determine_grade(result)

See more about python at brainly.com/question/26104476

Other Questions
Identify the type of sentence below.Cara brought snacks to share in study hall.simplecompoundcomplexcompound-complex In the book "The Crysanthemums", what does Elisa's invitation to the stranger to enter her garden tell the reader about her feelings toward him? How does a worker bee develop a queen out of the larva stage? Calculate balloon volume for each balloon at maximum inflation from the circumference data. (You will have to assume that the balloon was a perfect sphere.) To calculate balloon volume, first find the radius (in cm) of the balloon by using the formula C = 2r. Then, use the radius' value in the formula V = (4/3)r3 to calculate volume (in cm3). Show all your work, place units on all numbers (even those within the calculations), and express your answers with appropriate sig figs. (12 pts) write h(x)=x2-6x + 3 in vertex form if four points are collinear, they are also coplanar What information does a phase diagram give? A. The effect of temperature on volume changes of substances B. The effect of temperature and pressure on the phase of a substance C. The effect of concentration on the freezing point of a solution D. The effect of oxidation number on the melting point of a metal If a company uses a predetermined rate for absorbing manufacturing overhead, the volume variance is the: Group of answer choices a. Underapplied or overapplied variable cost element of overhead. b. Underapplied or overapplied fixed cost element of overhead. c. Difference in budgeted costs and actual costs of fixed overhead items. d. Difference in budgeted costs and actual costs of variable overhead items. I need helppppppppppppp Change each algebraic expression to a verbal expression.1. A+B = 102. 4x - y = a I Am Thinking of a number. 1/12 of it equals 6. 1/3 of it equals_________. Where is mRNA produced? Please answer this correctly Can someone help me I dont know which goes with which its different structures of the cell membranes Please help me with this! Assume that when adults with smartphones are randomly selected, 49% use them in meetings or classes. If 30 adult smartphone users are randomly selected, find the probability that exactly 23 of them use their smartphones The congruence theorem that can be used to prove LON LMN is SSS. ASA. SAS. HL. Please help thank you What is the answer? x^2-y^2=55 In the matrix equation below, what are the values of x and y?