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
Reil [10]
3 years ago
8

You want to write a Python program to compute the average of three integer quiz grades for a single student. Decide what variabl

es your program needs, and create them with appropriate initial values
Computers and Technology
1 answer:
lara [203]3 years ago
3 0

Answer:

Here is code in python.

#define three variables to store grades

grade_1 = 0

grade_2 = 0

grade_3 = 0

//define variable to store average of all three quiz

avg_grade=0

// read score of 1st quiz as integer

grade_1 = int (input ("please enter score of first quiz: "))

// read score of 2nd quiz as integer

grade_2 = int (input ("please enter score of second quiz: "))

// read score of 3rd quiz as integer

grade_3 = int (input ("please enter score of third quiz: "))

//calculate average of three grades

avg_grade = (grade_1 + grade_2 + grade_3)/3

// print the average

print ("Average of three quizs is {}".format(avg_grade))

Explanation:

Declare three variables "grade_1","grade_2" and "grade_3" to store the score of 3 quiz. And variable "avg_grade" to store the average of all quiz.Read score of quiz as integer and then calculate their average and assign it "avg_grade".

Output:

please enter score of first quiz: 23                                                                                                                          

please enter score of second quiz: 33                                                                                                                          

please enter score of third quiz: 45                                                                                                                          

Average of three quiz is 33.6666  

You might be interested in
The range A2:B4 has how many cells?   A. 2   B. 4   C. 6   D. 8
olya-2409 [2.1K]
The answer to that is D.
3 0
3 years ago
Read 2 more answers
What word does<br> this pattern spell?<br> d.
Advocard [28]

Answer:

BEG

Explanation:

In traditional music theory, pitch classes are typically represented by first seven Latin alphabets (A,B,C,D,E ,F and G) . And in the below music notes attachment we can understand that the answer is option (a) BEG

7 0
4 years ago
The weakest hydrogen line stars are classified as:
Ostrovityanka [42]
O is the weakest hydrogen line
7 0
4 years ago
Read 2 more answers
In cell B20, enter a
zzz [600]

Answer:

かあなたは棚田やヌタほたややあはあやあやあさあ与田弥太は沙汰やあはあわあね、田やホワアラハやくださいヤアカやさ矢田かほあや体は白湯のやさた

Explanation:

なたさたらなやさゆなやさら

5 0
2 years ago
Write a program to calculate student's average test scores and the grade. You may assume the following input data:
Brums [2.3K]

Answer:

def gradeAverage():

   grades = []

   i = 0

   while i < 5:

       a = int(input('enter score ' + str(i + 1) + ': '))

       grades.append(a)

       i = i+1

   #print(grades)

   average = sum(grades)/len(grades)

   #print(average)

   return average

def lettergrade(a):

   letter = 'A'

   if a < 60:

       letter = 'F'

   elif 59 < a < 63:

       letter = 'D-'

   elif 62 < a < 67:

       letter = 'D'

   elif 66 < a < 70:

       letter = 'D+'

   elif 69 < a < 73:

       letter = 'C-'

   elif 72 < a < 77:

       letter = 'C'

   elif 76 < a < 80:

       letter = 'C+'

   elif 79 < a < 83:

       letter = 'B-'

   elif 82 < a < 87:

       letter = 'B'

   elif 86 < a < 90:

       letter = 'B+'

   elif 89 < a < 94:

       letter = 'A-'

   elif 93 < a < 101:

       letter = 'A'

   return letter

numOfStudents = int(input('How many students: '))

names = []

aver = []

grade =[]

while numOfStudents > 0:

   studentName = input('Enter students name: ')

   names.append(studentName)

   a = gradeAverage()

   aver.append(a)

   grade.append(lettergrade(a))

   numOfStudents = numOfStudents - 1

for name in names:

       for score in aver:

           for letter in grade:

               if names.index(name) == aver.index(score) == grade.index(letter):

                   print('%s : Average =  %d  Letter Grade:  %s \n' %(name, score, letter))

                   break

Explanation:

The programming language used is python.

Two functions were created, the first function gradeAverage() was used to calculate the average values of the scores.

The second function lettergrade(a) was used to get the letter grade i.e(A, A-, C, D, e.t.c.) and it takes its argument from the average.

The main block of code asks for how many students are there and prompts the user to input their names and scores for all the students.

It takes that data calculates the average and the letter grade and prints out the names of the students, their average and their letter grade.

7 0
3 years ago
Other questions:
  • Suppose you want to delete an existing file from within Word. What would you do? A. Click on the File button, choose Recent, ope
    9·1 answer
  • 6. Which of the following options is used to view a computer's memory properties?
    8·1 answer
  • What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
    11·1 answer
  • The _____ model of a systems development life cycle provides for progressive development of operational software, with each rele
    8·1 answer
  • The replacer parameter of the stringify method accepts a/an ______________ or an array.
    15·1 answer
  • 23+ Composition refers to
    11·1 answer
  • Why are computer manufacture constantly releases fast computer and do user benefit from ths speed
    9·1 answer
  • How are computers connected to one another?
    5·2 answers
  • Prepare the truth table for the following boolean expressions: (A+B).(A+C).(B)
    12·1 answer
  • What are the five generations of computer software​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!