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 1
Answer:

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

Answer 2
Answer:

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


Related Questions

Which key do programmers use to end running programs?Num Lock Scroll Lock Pause/Break Backspace
Which of these terms best describes the type of AI used in today’s email spam filters, speech recognition, and other specific applications?A. Artificial Narrow Intelligence (ANI)B. Artificial General Intelligence (AGI)
Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )using only . C++ programming
Given six memory partitions of 100 MB, 170 MB, 40 MB, 205 MB, 300 MB, and 185 MB (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes of size 200 MB, 15 MB, 185 MB, 75 MB, 175 MB, and 80 MB (in order)? Indicate which—if any—requests cannot be satisfied. Comment on how efficiently each of the algorithms manages memory.
Write a program segment that simulates flipping a coin 25 times by generating and displaying 25 random integers, each of which is either 1 or 2

Given the following structure and variable definitions, struct customer { char lastName[ 15 ]; char firstName[ 15 ]; unsigned int customerNumber; struct { char phoneNumber[ 11 ]; char address[ 50 ]; char city[ 15 ]; char state[ 3 ]; char zipCode[ 6 ]; } personal; } customerRecord, *customerPtr; customerPtr = &customerRecord; write an expression that can be used to access the structure members in each of the following parts: a) Member lastName of structure customerRecord. b) Member lastName of the structure pointed to by customerPtr. c) Member firstName of structure customerRecord. d) Member firstName of the structure pointed to by customerPtr. e) Member customerNumber of structure customerRecord. f) Member customerNumber of the structure pointed to by customerPtr. g) Member phoneNumber of member personal of structure customerRecord. h) Member phoneNumber of member personal of the structure pointed to by customerPtr. i) Member address of member personal of structure customerRecord. j) Member address of member personal of the structure pointed to by customerPtr. k) Member city of member personal of structure customerRecord. l) Member city of member personal of the structure pointed to by customerPtr.

Answers

Answer:

see explaination

Explanation:

a)

customerRecord.lastName

b)

customerPtr->lastName or (*customerPtr).lastName

c)

customerRecord.firstName

d)

customerPtr->firstName or (*customerPtr).firstName

e)

customerRecord.customerNumber

f)

customerPtr->customerNumber or (*customerPtr).customerNumber

g)

customerRecord.personal.phoneNumber

h)

customerPtr->personal.phoneNumber or (*customerPtr).personal.phoneNumber

i)

customerRecord.personal.address

j)

customerPtr->personal.address or (*customerPtr).personal.address

k)

customerRecord.personal.city

l)

customerPtr->personal.city or (*customerPtr).personal.city

m)

customerRecord.personal.state

n)

customerPtr->personal.state or (*customerPtr).personal.state

o)

customerRecord.personal.zipCode

p)

customerPtr->personal.zipCode or (*customerPtr).personal.zipCode

The study of a current business and information system application and the definition of user requirements and priorities for a new or improved information system are part of which phase? (Points : 2) Problem analysis phaseScope definition phase
Requirements analysis phase
Decision analysis phase
None of the above

Answers

Answer: Problem analysis phase

Explanation: Problem phase analysis is the mechanism that helps in studying the problems and issue that occur in the application and system of any business organization.It helps in identification of the reason and consequences of the detected problems.The requirements of user and resources to accomplish business system is also analyzed.

Other options are incorrect because scope definition phase is used for identification of the boundaries of any project regarding opportunities and issue in business .

Requirement analysis phase is used for gathering the need of the user and the condition requirement to fulfill a project. Decision phase analysis is done to bring out the best possible solution for any project. Thus, the correct option is problem analysis phase.

Should I get hollow knight, hyper light drifter, Celeste, or stardew valley for switch

Answers

Ooh, very tough question. I've played both Celeste, and Hollow knight. So I cant say anything for the other two games.

Celeste and Hollow Knight are both platforming games, so that was something I was interested in. And both also have deep morals to learn and stories to enjoy. Celeste basically follows Madeline, who's had some emotional problems in the past as she's trying to climb a mountain. In this mountain, a part of her escapes and becomes a but of a antag.

I loved the background, and the characters in this game. But there were a lot of parts in the game that frustrated me and I got very close to just all-out giving up on the game. I still loved it though.

But don't even get me started on Hollow Knight. LIKE OH My GOD, I am obsessed with Hollow Knight and its beauty! I have almost every piece of merchandise, every plush, every t-shirt, charm, sticker, pins, and all the DLC packs. This game is an absolute masterpiece. I cant say anything without giving off the background and lore behind the game. and I'll be honest, there's been a couple of times where I was so touched with the game, that I just started crying. There's lovable characters like Hornet, our little Ghost, Myla (oml rip Myla you beautiful baby), and of course laughable Zote. Its so beautiful. The art is stunning, the animation is so clean. And if you do end up getting Hollow Knight, then your going to be even more excited because Team Cherry is actually in the works of creating the sequel (or prequel) of Hollow Knight, which is Hollow Knight ; Silksong! Definitely go and watch the Nintendo trailer for that game! I've been so excited about it for months and Ive been watching the trailer almost every day.

Anyway, sorry this is so long. But i'm going to go with my gut and say Hollow Knight. Its beautiful, amazing, and overall just..perfect.

Answer:

hollow knight is pretty good

Explanation:

Write a program that asks the user to enter the size of a triangle (an integer from 1 to 50). Display the triangle by writing lines of asterisks. The first line will have one asterisk, the next two, and so on, with each line having one more asterisk than the previous line, up to the number entered by the user. On the next line write one fewer asterisk and continue by decreasing the number of asterisks by 1 for each successive line until only one asterisk is displayed. (Hint: Use nested for loops; the outside loop controls the number of lines to write, and the inside loop controls the number of asterisks to display on a line.) For example, if the user enters 3, the output would be:_______.a. *b. **c. ***d. **e. *

Answers

Answer:

Implemented using Python

n = int(input("Sides: "))

if(n>=1 and n <=50):

    for i in range(1,n+1):

         for j in range(1,i+1):

              print('*',end='')

         print("")

       

    for i in range(n,0,-1):

         for j in range(i,1,-1):

              print('*',end='')

         print("")

else:

         print("Range must be within 1 and 50")

Explanation:

This line prompts user for number of sides

n = int(input("Sides: "))

The line validates user input for 1 to 50

if(n>=1 and n <=50):

The following iteration uses nested loop to print * in ascending order

   for i in range(1,n+1):

         for j in range(1,i+1):

              print('*',end='')

         print("")

The following iteration uses nested loop to print * in descending order        

    for i in range(n,0,-1):

         for j in range(i,1,-1):

              print('*',end='')

         print("")

The following is executed if user input is outside 1 and 50

else:

         print("Range must be within 1 and 50")

write a program that calculates the average of a group of 5 testscores, where the lowest score in the group is dropped. it shoulduse the following functionsa. void getscore() should ask the use for the test score, store itin a reference parameter variable and validate it. this functionshould be called by main once for each ofthe five score to be entered.

Answers

C++ program for calculating the average of scores

#include <iostream>

using namespace std;

const int n=5;//As per question only 5 test scores were there

int numbers[5];

void getscore(int i)//defining function for taking input

{

cin >> numbers[i];

while(numbers[i]<0 || numbers[i]>100)//score should be between 0 to 100

{

cout<<"\nThe number should be between 0 to 100\n";

cin>>numbers[i];

}

}

int main()//driver function

{

cout << "Enter 5 scores:\n";

for (int i = 0; i < n; i++)

{

getscore (i);//calling function each time for input

}

int s = 101;

double avg = 0;

for (int i = 0; i < n; i++)//loop for finding the smallest

{

s = numbers[i] < s ? numbers[i] : s;

}

for (int i = 0; i < n; i++) //loop for finding the Average

{

avg += numbers[i];

}

avg -= s;

avg /= 4;

cout << "Average of the four scores are: " << avg<< endl;//printing the output

return 0;

}

Output

Enter 5 scores:

4

5

6

7

8

Average of the four scores are: 6.5

You use utility software to_____. Select all that apply.A play video games
B reformat a hard disk drive
C manage fonts on a computer
D write and edit documents

Answers

You use utility software to:

  • Reformat a hard disk drive.
  • Manage fonts on a computer.

What are utility software used for?

Utility software are known to be a kind of software that is often used to  configure and maintain any system.

Conclusively, Note that this software is made up of  small programs which can be used to  Reformat a hard disk drive and also to Manage fonts on a computer.

Learn more about  utility software from

brainly.com/question/20659068

Utility software is system software designed to help analyze, configure, optimize or maintain a computer. Utility software usually focuses on how the computer infrastructure (including the computer hardware, operating system, software and data storage) operates.

Other Questions
Hello,Can you please help me with the following questions:3. You enjoy technical matters, have a background in computer science and enjoy coding and playing video games in your free time. Which video game industry job would best match your profile?a. Game testerb. Producerc. Programmerd. Video game artist6. Which of the following is an essential skill for game testers?a. Thorough understanding of Java and C++b. Technical drawingc. Technical writingd. Project management9. Which of the following skills is the most important when applying for a game artist job?a. Degree in artsb. Strong art portfolioc. Previous game testing experienced, knowledge of scripting and codeing10. The Stencyl program is recommended for ______.a. creating 2D gamesb. creating 3D gamesc. Starting to learn to programd. creating gaming art11. You are passionate about video games, have spent part of your life in different countries and are fluent in their languages. You are considering looking for a job in video games. Which of the following jobs could you be qualified for, considering your skills and experience?a. Game programming with a focus on languagesb. Translationc. Game localizationd. Cultural gaming12. Because it is one of the main programming languages used in some of the most popular game engines in the industry, which programming language does the author of the textbook recommend learning first?a. Javab. C Sharpc. C++d. SQL13. Which of the following statements is NOT true about internships?a. internships offer great opportunity to create and build connections within the industry.b. Internships lead to a job offer upon successful completionc. Internships offer an opportunity to get first-hand experience of the industryd. Internships can be paid or unpaid15. What is the best approach to take if you have not heard back from a company after applying for a job?a. Wait, sometimes it takes time to process application and impatience can give a bad impressionb. Visit the company site personally to inquire about the status of your applicationc. Try to find out on which side the process may be stalling and take appropriate steps to get the process moving forward, when possibled. Reapply18. You are applying for a game programmer job at a reputable gaming company. Your application may stand the best chance of being noticed if you include which of the following in your application?a. List of all degrees and courses you have taken to acquire and hone your programming skillsb. Portfolio including samples of codes you have createdc. Portfolio including playable video game demo.d. Portfolio of your artwork.19. Which of the following is the most important item to include in your CV?a. All gaming projects you have worked on, paid or unpaid.b. Extracurricular activities related to gaming.c. Major accomplishmentsd. Short samples of code or technical writing samples.20. Which of the following job hunting practices is the least effective?a. Posting CV on job boards.b. Searching for jobs on job posting sitesc. Doing an internshipd. Applying for a specific job posting via company website