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

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,...
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...
PYTHON PYTHON Recursive Functions. In this problem, you are asked to write three recursive functions. Implement...
PYTHON PYTHON Recursive Functions. In this problem, you are asked to write three recursive functions. Implement all functions in a module called problem1.py. (10 points) Write a recursive function called remove char with two parameters: a string astr and a character ch. The function returns a string in which all occurrences of ch in astr are removed. For example, remove char("object oriented", ’e’) returns the string "objct orintd". Your implementation should not contain any loops and may use only the...
Need this program Using Classes , Objects, Save to file, and Printbill Simple python assignment Write...
Need this program Using Classes , Objects, Save to file, and Printbill Simple python assignment Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until...
Program must be in Python Write a program in Python whose inputs are three integers, and...
Program must be in Python Write a program in Python whose inputs are three integers, and whose output is the smallest of the three values. Input is 7 15 3
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT