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
posledela
3 years ago
15

Please help! Use the function written in the last lesson to calculate a student's GPA. Ask them how many classes they are taking

, then ask them to enter the grades for each class and if it is weighted. Your program should then output the averaged GPA including the decimal place. Your main program must call the function. Sample Run HOw many classes are you taking? 7 Enter your Letter Grade: C Is it weighted? (1 = yes) 1 Your GPA Score is: 3 Enter your Letter Grade: D Is it weighted? (1 = yes) 0 Your GPA Score is: 1 Enter your Letter Grade: A Is it weighted? (1 = yes) 1 Your GPA score is: 5 Enter your Letter Grade: B Is it weighted? (1 = yes) 1 Your GPA Score is: 4 Enter your Letter Grade: C Is it weighted? (1 = yes) O Your GPA Score is: 2 Your weighted GPA is a 3.0
Computers and Technology
1 answer:
matrenka [14]3 years ago
8 0

We have that the resultant code  is mathematically given as

 print("Your GPA score is: %.2f" %GPAcalc(grade, resp)) #printout r

       sum += GPAcalc(grade, resp)

   print("You <em>weighted</em> GPA is a %.2f")

   main()

   input()

<h3>Program Code</h3>

Generally the code is given below

if response != 1 and response != 0:

       return sys.exit("Invalid")

   elif grade=="A" and response==1:

       return 5

   elif grade=="A" and response==0:

       return 4

   elif grade=="B" and response==1:

       return 4

   elif <em>grade</em>=="B" and response==0:

       return 3

   elif grade=="C" and response==1:

       return 3

   elif grade=="C" and response==0:

       return 2

   elif grade=="D" and response==1:

       return 2

   elif grade=="D" and response==0:

       return 1

   elif grade=="F" and response==1:

       return 1

   elif grade=="F" and response==0:

       return 0

   else:

       return sys.exit("Invalid Grade!")

def main():

   sum = 0

   num_classes = int(input("classes being taken? "))  

   for x in range(num_classes):

       grade = input("Enter your Letter Grade: ") = int(input("Is it weighted? (1 = yes) "))

       print("Your GPA score is: %.2f" %GPAcalc(grade, resp)) #printout

       sum += GPAcalc(grade, resp)

   print("You weighted GPA is a %.2f")

   main()

   input()

For more information on Coding visit

brainly.com/question/950632

You might be interested in
write an expression taht evaluated to true if and only if the variable s does not contain the string 'end'
natima [27]

Answer:

//check which string is greater

if(strcmp(name1,name2)>0)

//assign name1 to first, if the

    //name1 is greater than name2

    first=name1;

else

    //assign name2 to first, if the

    //name2 is greater than name1

    first=name2;

5)

//compare name1 and name2

    if(strcmp(name1,name2)>0)

   

         //compare name1 and name3

         if(strcmp(name1,name3)>0)

       

             //assign name1 to max, becuase

             //name1 is greater than name2 and name3

             max=name1;

       

Explanation:

7 0
3 years ago
When you sustain program implementation by staying true to the original design, it is termed A. Goals and objectives B. Program
Naya [18.7K]

Answer:

Program fidelity

Explanation:

7 0
3 years ago
All of the following are examples of software, except:
Bezzdna [24]
Speakers is your answer
7 0
3 years ago
Read 2 more answers
Chelsea wants to know about the requirements for being a lab technician. Where could she find that information?
7nadin3 [17]
On a job application.
5 0
3 years ago
What is the easiest computer programming language​
RideAnS [48]

Answer:

Ther are 8 easiest computer programming language :

• HTML

• CSS

• Javascript

• Python

• Ruby

• Java

• PHP

• C/C++

5 0
3 years ago
Other questions:
  • A report formatted where the page is taller than it is wide is formatted in ____.
    12·1 answer
  • A ____ is a collection of computers and users that are identified by a common security database. workgroup controller segment do
    7·1 answer
  • The master system database stores a database template that is used as a blueprint when creating a new user database.
    10·1 answer
  • Olivia creates a personal budget. She enters her current savings account balance in cell D3. In cell A3, she calculates her inco
    8·1 answer
  • The process of searching for a special pattern of symbols within a larger collection of information is called pattern ____.
    12·1 answer
  • A server that provides data transfer and storage space at remote locations is called a
    7·1 answer
  • Write a program segment with a do-while loop that displays whether a user-entered integer is even or odd. The code should then a
    5·1 answer
  • You are a network technician for a small corporate network. It's been decided that the office needs a wireless network for emplo
    6·1 answer
  • I need help now I really do what is the answer thank you
    5·1 answer
  • What are the benefits of a relationship in RDBMS <br>​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!