Question

In: Computer Science

For Python: In this assignment you are asked to write a Python program to determine the...

For Python:

In this assignment you are asked to write a Python program to determine the Academic Standing of a studentbased on their CGPA. The program should do the following:

  1. Prompt the user to enter his name.
  2. Prompt the user to enter his major.
  3. Prompt the user to enter grades for 3 subjects (A, B, C, D, F).
  4. Calculate the CGPA of the student.

To calculate CGPA use the formula:

CGPA = (quality points * credit hours) / credit hours

            Each subject is worth of 3 credit hours.

                                                

Grade

Quality Points

A

4.0

B

3.0

C

2.0

D

1.0

F

0.0

  1. Once you have calculated the CGPA determine their Academic Standing based on the table below.

CGPA

Academic Standing

2.00 – 4.00

Good

1.75 – 1.99

Warning

1.00 – 1.74

Probation

0.00 – 0.99

Suspension

  1. The output should be in the following format:

Enter student’s name:   

Enter student’s major:

Enter the grade for subject1 (A, B, C, D, F):

Enter the grade for subject2 (A, B, C, D, F)::

Enter the grade for subject3 (A, B, C, D, F)::

#Skip a couple of lines

Student Name:              #All letters should be in uppercase

Major:                          #The major should be displayed in title case

CGPA:

Academic Standing:

The grades entered should belong to the set {A, B, C, D, F}.  After the prompt, check to be sure they are one of those.  Print (display) an error message if they are not and do not prompt the user for the grades again. The program ends.

Sample Output:

Enter student’s name: james smith

Enter student’s major: Electrical Engineering

Enter the grade for subject1 (A, B, C, D, F): A

Enter the grade for subject2 (A, B, C, D, F): B

Enter the grade for subject3 (A, B, C, D, F): A

Student Name: JAMES SMITH

Major: Electrical Engineering

CGPA: 3.76

Academic Standing: Good

Solutions

Expert Solution

#####please refer pic for indentations(tabs)
import math
import sys
name=input("Enter student's name:")
major=input("Enter student's major:")
grades=[0]*3
dict = {"A": 4,"B":3,"C":2,"D":1,"F":0}
for i in range(3):
inp=input('Enter the grade for subject1 (A, B, C, D, F):')
if(inp in dict):
grades[i]=dict[inp]
else:
sys.exit("wrong grade")
g=round(sum(grades)/len(grades),2)
print("student Name:",name.upper())
print("Major:", major)
print("CGPA:",g)
print("Academic standing:",end="")
if (g>=2 and g<=4):
print("Good")
elif (g>=1.75 and g<=1.99):
print("Warning")
elif (g>=1.00 and g<=1.74):
print("Probation")
elif (g>=0.00 and g<=0.99):
print("Suspension")


  


Related Solutions

In python, write a program that asked the user to enter the monthly costs for the...
In python, write a program that asked the user to enter the monthly costs for the following expenses incurred from operating his automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program should display total monthly cost and annual cost. Also, should contain main and calcExpenses functions, calcExpenses should only calculate the expenses and everything else should happen in the main function.
Python Language: The Marietta Country Club has asked you to write a program to gather, then...
Python Language: The Marietta Country Club has asked you to write a program to gather, then display the results of the golf tournament played at the end of March. The Club president Mr. Martin has asked you to write two programs. The first program will input each player's first name, last name, handicap and golf score and then save these records in a file named golf.txt (each record will have a field for the first name, last name, handicap and...
In this assignment, you are going to write a Python program to demonstrate the IPO (Input-Process-Output)...
In this assignment, you are going to write a Python program to demonstrate the IPO (Input-Process-Output) cycle that is the heart of many imperative programs used for processing large amount of data. Daisy is recently hired by a warehouse. One of her job is to keep track the items ordered by all the branches of the company. The company wants to automate the task using a computer program. Being a friend of Daisy, she knows you are a Computer Science...
Description of the Assignment: Write a Python program to (a) create a new empty stack. Then,...
Description of the Assignment: Write a Python program to (a) create a new empty stack. Then, (b) add items onto the stack. (c) Print the stack contents. (d) Remove an item off the stack, and (e) print the removed item. At the end, (f) print the new stack contents: Please use the following comments in your python script: # ************************************************* # COP3375 # Student's full name ( <<< your name goes here) # Week 8: Assignment 1 # ************************************************* #...
1. INTRODUCTION The goal of this programming assignment is for students to write a Python program...
1. INTRODUCTION The goal of this programming assignment is for students to write a Python program that uses repetition (i.e. “loops”) and decision structures to solve a problem. 2. PROBLEM DEFINITION  Write a Python program that performs simple math operations. It will present the user with a menu and prompt the user for an option to be selected, such as: (1) addition (2) subtraction (3) multiplication (4) division (5) quit Please select an option (1 – 5) from the...
Write a program IN PYTHON of the JUPYTER NOOTBOOK Write a Python program that gets a...
Write a program IN PYTHON of the JUPYTER NOOTBOOK Write a Python program that gets a numeric grade (on a scale of 0-100) from the user and convert it to a letter grade based on the following table. A: 90% - 100% B 80% - 89% C 70% - 79% D 60% - 69% F <60% The program should be written so that if the user entered either a non-numeric input or a numeric input out of the 0-100 range,...
Write a beginner's program in Python to determine your car's gas mileage. You should use the...
Write a beginner's program in Python to determine your car's gas mileage. You should use the input variables "miles_traveled" and "gallons_fuel" and the result should be stored in the variable "miles_per_gallon".
You are asking to develop a “Triangle Guessing” game in Python for the assignment. The program...
You are asking to develop a “Triangle Guessing” game in Python for the assignment. The program accepts the lengths of three (3) sides of a triangle as input from a player. The program output should indicate whether the triangle is a right triangle, an acute triangle, or an obtuse triangle. 1.Tips to help you for this assignment: Make sure each side of the triangle is a positive integer. Use try/except for none positive integer input. 2. Validating the triangle. That...
Python This week you will write a program in Python that mimics an online shopping cart...
Python This week you will write a program in Python that mimics an online shopping cart . You will use all the programming techniques we have learned thus far this semester, including if statements, loops, lists and functions. It should include all of the following: The basics - Add items to a cart until the user says "done" and then print out a list of items in the cart and a total price. - Ensure the user types in numbers...
Write the program in C++ The Rebel food truck has asked you to write a program...
Write the program in C++ The Rebel food truck has asked you to write a program for them to do both inventory and sales for their food wagon. Ben and Dave run the food truck and they already have full time day jobs so they could really use your help. The food truck sells: hamburger, hotdogs, chilli, fries and soda. The truck has spots for 200 hamburger patties, 200 hot dogs, 75 hamburger buns, 75 hot dog buns, 500 ounces...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT