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 Problem Problem 1: In this problem you are asked to write a Python program to...
Python Problem Problem 1: In this problem you are asked to write a Python program to find the greatest and smallest elements in the list. The user gives the size of the list and its elements (positive and negative integers) as the input. Sample Output: Enter size of the list: 7 Enter element: 2 Enter element: 3 Enter element: 4 Enter element: 6 Enter element: 8 Enter element: 10 Enter element: 12 Greatest element in the list is: 12 Smallest...
(PYTHON) Write a program: This assignment will give you more experience on the use of: 1....
(PYTHON) Write a program: This assignment will give you more experience on the use of: 1. integers (int) 2. floats (float) 3. conditionals 4. iteration The goal of this project is to make a fictitious comparison of the federal income. You will ask the user to input their taxable income. Use the income brackets given below to calculate the new and old income tax. For the sake of simplicity of the project we will only consider individuals and not married...
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...
In this programming assignment, you are asked to write a multi-threaded program using JAVA to compute...
In this programming assignment, you are asked to write a multi-threaded program using JAVA to compute the sum of an arithmetic series from 1 to 200 using pthreads.   The main thread is responsible for creating two child threads The first child thread should compute the partial sum of the series from 1 to 100 and the second computes the partial sum of another series from 101 to 200. The main thread should accumulate the partial sums computed by the child...
Using Python, Assignment Write a program that plays a game of craps. The program should allow...
Using Python, Assignment Write a program that plays a game of craps. The program should allow the player to make a wager before each “turn”. Before each turn, allow the user to either place a bet or exit the game. After each turn display the player’s current balance. Specifics Each player will start with $500.00. Initially, and after each turn give the user the option of betting or leaving the program. Implement this any way you wish, but make it...
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...
Sketch! This assignment is to write a Python program that makes use of the OpenGL graphics...
Sketch! This assignment is to write a Python program that makes use of the OpenGL graphics library to make an interactive sketching program that will allow the user to do line drawings. The user should be able to choose from a palette of colors displayed on the screen. When the user clicks the mouse in the color palette area, the drawing tool will switch to using the color selected, much like dipping a paint brush into a new color of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT