Question

In: Computer Science

write an algorithm and python program using the following information. also can y How much should...

write an algorithm and python program using the following information. also can y

How much should I study outside of class?

           

            Issue:

Your fellow students need help. This is their first year in college and they need to determine how many hours they need to study to get good grades.

Study Hours Per Week Per Class                    Grade

15                                                           A

12                                                           B

9                                                             C

6                                                             D

0                                                             F

Project Specifications:

  1. The user enters their full name and the number of credits they are taking.
  2. The user will then enter the grade they want assuming the same grade for all classes.
  3. The program displays for each student: student’s name, number of credits, total number of weekly study hours, and grade they should expect to receive. In the following format –

Name: FirstName LastName

Credits: 12

Study Hours: 60

Grade: A

  1. At the end of the program, the program displays the total number of students who used the program, the average credits taken, and the average study hours. In the following format –

Total Students: 3

Average Credits: 9

Average Study Hours: 20

ou please run the program?

Solutions

Expert Solution

Answer: Hey!! Kindly find your solution here. If you have any queries, feel free to ask me. Thanks.

In this program study hours calculated according to grade and multiply to 4 classes. Suppose a student assume grade A, study hours should be 15 and total hours = 15*4. If you want calculation change just commen me . I'll update the program. Just check average also and tell me.

studentsName = [""] * (10)
grade = [""] * (10)
credits = [0] * (10)
hours = [0] * (10)
sum_hours = 0

creditSum = 0
avgHours = 0
for i in range(1, 2 + 1, 1):
print("Enter student's name")
studentsName[i] = input()
print("enter credits")
credits[i] = int(input())
creditSum = credits[i] + creditSum

print("enter grade")
grade[i] = input()
if grade[i]=="A":
hours[i] = 15*4
sum_hours = sum_hours+hours[i]
elif grade[i]=="B":
hours[i] = 12*4
sum_hours = sum_hours+hours[i]

creditSum = float(creditSum) / 4
for i in range(1, 2 + 1, 1):
print("Student Name:" +studentsName[i])
print("Credits:" +str(credits[i]))
print("Grade:" +grade[i])
print("Study Hours:" +str(hours[i]))

print("Total Students:" + str(i))
print("Average Credits:" + str(creditSum))
print("Average Study Hours:" + str(sum_hours/4))



Related Solutions

write an algorithm program using python or C++ where a0=1, a1=2 an=an-1*an-2, find an ,also a5=?
write an algorithm program using python or C++ where a0=1, a1=2 an=an-1*an-2, find an ,also a5=?
For this problem you should describe the algorithm using a flowchart and then write Python code...
For this problem you should describe the algorithm using a flowchart and then write Python code to implement the algorithm. You are to create a Python program file for your code. Include in your HW document a photo of your flowchart and a screenshot of your program file and the output in IDLE that results when you run the program. The algorithm: Ask the user to input their annual salary and then calculate and print the weekly salary (annual/52). I...
Deadlock Avoidance using Banker’s Algorithm Q2: Use the following information and complete the Table, also write...
Deadlock Avoidance using Banker’s Algorithm Q2: Use the following information and complete the Table, also write down the safe sequence if exist? Three Resources (R1=4, R2=9, R3=11) Processes Allocated Resources R1   R2    R3 Maximum Required Resources R1   R2    R3 Currently Available Resources R1   R2    R3 Remaining Need R1   R2    R3 Safe Sequence P1 1      4      2 2      4      6 P2 2      1      1 3      2      8 P3 0      0      1 1      2      3 P4 0      0      0 4      4      2...
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...
Create a program called DualPivotQuickSort.java that implements the QuickSort algorithm using Yaroslavskiy’s algorithm. The program should...
Create a program called DualPivotQuickSort.java that implements the QuickSort algorithm using Yaroslavskiy’s algorithm. The program should be able to do the following: accepts one command line parameter. The parameter specifies the path to a text file containing the integers to be sorted. The structure of the file is as follows: There will be multiple lines in the file (number of lines unknown). Each line will contain multiple integers, separated by a single whitespace. reads the integers from the text file...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the following requirements: Reads in a series of positive integers,  one number at a time;  and Calculate the product (multiplication) of all the integers less than 25,  and Calculate the sum (addition) of all the integers greater than or equal to 25. Use 0 as a sentinel value, which stops the input loop. [ If the input is 0 that means the end of the input list. ]...
Write a design algorithm and a python program which asks the user for the length of...
Write a design algorithm and a python program which asks the user for the length of the three sides of two triangles. It should compute the perimeter of the two triangles and display it. It should also display which triangle has the greater perimeter. If both have the same perimeter it should display that the perimeters are the same. Formula: Perimeter of triangleA = (side1A + side2A +side3A) See the 2 sample outputs. Enter side1 of TriangleA: 2 Enter side2...
Python English algorithm explanation Write a program that asks the user for the name of a...
Python English algorithm explanation Write a program that asks the user for the name of a file in the current directory. Then, open the file and process the content of the file. 1)If the file contains words that appear more than once, print “We found duplicates.” 2)If the file does not contain duplicate words, print “There are no duplicates.”
Python English algorithm explanation Write a program that asks the user for the name of a...
Python English algorithm explanation Write a program that asks the user for the name of a file in the current directory. Then, open the file and process the content of the file. 1)If the file contains words that appear more than once, print “We found duplicates.” 2)If the file does not contain duplicate words, print “There are no duplicates.”
I need a python program and a flowchart please!! Problem #1:    How much should I...
I need a python program and a flowchart please!! Problem #1:    How much should I study outside of class?                         Issue: Your fellow students need help. This is their first year in college and they need to determine how many hours they need to study to get good grades. Study Hours Per Week Per Class                    Grade 15                                                           A 12                                                           B 9                                                             C 6                                                             D 0                                                             F Project Specifications: The user enters their full name and the number of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT