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
patriot [66]
4 years ago
6

Design a grade program that directs the user to enter information for one student. The user inputs the first name, last name, an

d three grades. The three grades MUST be entered into an array. Validate the grade input so that only grades between 0 and 100 are accepted. The program should display four output lines. One containing the student’s first and last name separated by a space One containing all three grades One containing the final average One containing the letter grade The program must calculate the final average. The letter grade is determined using the following ranges: A: 90-100 B: 80-89 C: 70-79 D: 60-69 F: Below 60

Computers and Technology
1 answer:
Tamiku [17]4 years ago
6 0

Answer:

#section 1

f_name = input('Enter First Name: ')

l_name = input('Enter last Name: ')

age = int(input('Enter age: '))

grades = []

#section 2

while True:

   try:

       g1 = int(input('Enter First Grade: '))

       if (-1 < g1 < 101):

           g2 = int(input('Enter Second Grade: '))

           if (-1 < g2 < 101):

               g3 = int(input('Enter Third Grade: '))

               if (-1 < g3 < 101):

                   break

               else:

                   raise

           else:

               raise

       else:

           raise

   except:

       print('Grades must be within the range 0 and 100 ')

#section 3  

grades.append(g1)

grades.append(g2)

grades.append(g3)      

average = round(sum(grades)/len(grades), 2)

def lettergrade(a):

   letter = 'A'

   if a < 60:

       letter = 'F'

   elif 61 < a < 70:

       letter = 'D'

   elif 69 < a < 80:

       letter = 'C'

   elif 81 < a < 90:

       letter = 'B'

   elif 91 < a < 101:

       letter = 'A'

       

   return letter

#section 4

print('\n ---------Result-------------\n\n')

print('{} {}'.format(f_name, l_name))

print(grades)

print(average)

print(lettergrade(average))

Explanation:

The programming language used is python.

#section 1

In this section the program prompts the user to enter its first name last, last name and age. An empty list is also created to hold the grades of the student.

#section 2

The program uses a WHILE loop, TRY and EXCEPT block with IF statements to check if the grades are within range, if the grades are out of range an error is raised and the except block tells the user that a wrong input has been entered, the while loop keeps running until it has collected values that are within the stipulated range before it breaks.

#section 3

In this section, all the scores collected appended to the grades list and the average is calculated.

A function is also created, that would evaluate the letter grade depending on the value that is passed to it.

#section 4

The results are printed to the screen

You might be interested in
When using the BinarySearch() method of an array or list type, what value is returned when the element is not found? How can we
Step2247 [10]

Answer:

When the element is not found we return -1.

Explanation:

When we use binary search we use BinarySearch() method of an array or list type when the element is found we return the index of the element if found if the element is not found we return -1.

We can decode this value since it is less than 0 and the indexing of arrays and lists starts with 0 upto the size-1.So -1 index is not present in the array or list.We have to check if the index is < 0 then the element is not present in the array or list.

for ex:-

if(index<0)

{

    System.out.println("Element is not present in the array");

}

5 0
3 years ago
Often technical personnel who are not familiar with security techniques think that restricting access to ports on a router or fi
zavuch27 [327]

Answer:

This is not a good solution

Explanation:

Your web browser uses port 80 outgoing to make web requests, so if you’re blocking incoming port 80, all you’re blocking is users of the organization from connecting to the internet. You have indeed close a vulnerable port to access from hackers, but this also can reduce the productivity of the organization.

3 0
4 years ago
Discuss about the main frame computer​
Nimfa-mama [501]

Answer:

Mainframes (also called "big iron")[1] are powerful computers used for large information processingjobs. They are mainly used by governmentinstitutions and large companies for tasks such as census, industry and consumer statistics, enterprise resource planning, and financial transaction processing. Mainframe computers are specially used as servers on the World Wide Web (WWW). They are distinct from supercomputers.

7 0
3 years ago
The collection of computer instructions and other files that constitute a piece of software is
lutik1710 [3]
The answer would be
A. Codebase

8 0
3 years ago
Read 2 more answers
If ADD = 81, BAD = 49, and CAD = 64, then what is the value of ACA?
Digiron [165]

Answer:

its 72

Explanation:

i know it because i did it and thats how i know it

6 0
3 years ago
Other questions:
  • All of the following are stages in the SDLC except _____.
    9·1 answer
  • Trish uas bought a new computer, which she plans to start working on aftwr a week. Since Trish has not used computers in the pas
    13·1 answer
  • when seeking information on the on the internet about a variety of subjects the most useful place to look would be?
    13·1 answer
  • PASSAGE: The picnic had been scheduled for weeks in advance. The Morris family was looking forward to some fun and relaxation wi
    12·1 answer
  • The expression that is tested by a switch statement must have a(n) __________ value.
    12·1 answer
  • Which key should you press and hold to select multiple cells?
    8·2 answers
  • Jeremy is working with a team that is creating an application using attributes and associated methods. What type of programming
    8·1 answer
  • Give ways on how to effectively save.​
    15·1 answer
  • Fill in the blank
    13·1 answer
  • My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!