SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array.
The program defines method printGrades() that takes a signal-dimensional array of integer scores as a parameter and processes the scores to print letter grades based on the following scale:
Grade is A if score >= 90 and score <= 100
Grade is B if score >= 80 and score <= 89
Grade is C if score >= 70 and score <= 79
Grade is D if score >= 60 and score <= 69
Grade is F if score < 60
Document your code and organized your output following these sample runs.
Sample run 1:
Class size: 5
Entered grades: 90, 67, 78, 89, 60
Student 0 score is 90 and grade is A
Student 1 score is 67 and grade is D
Student 2 score is 78 and grade is C
Student 3 score is 89 and grade is B
Student 4 score is 60 and grade is D
Sample run 2:
Class size: 3
Entered grades: 77, 50, 81
Student 0 score is 77 and grade is C
Student 1 score is 50 and grade is F
Student 2 score is 81 and grade is B
def determine_grade(score):
if score < 60:
letter = 'F'
elif score < 70:
letter = 'D'
elif score < 80:
letter = 'C'
elif score < 90:
letter = 'B'
else:
letter = 'A'
return letter
def main():
n = int(input("Class size: "))
grades = input("Entered grades: ")
lst = [int(x) for x in grades.split(", ")]
for i in range(n):
print("Student",i,"score is",lst[i],"and grade is",determine_grade(lst[i]))
main()
SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes...
Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array. The program...
Having a bit of trouble in my c++ class, was wondering if anyone can help.Write a program to calculate students' average test scores and their grades. You may assume the following input data:Johnson 85 83 77 91 76Aniston 80 90 95 93 48Cooper 78 81 11 90 73Gupta 92 83 30 68 87Blair 23 45 96 38 59Clark 60 85 45 39 67Kennedy 77 31 52 74 83Bronson 93 94 89 77 97Sunny 79 85 28 93 82Smith 85 72...
PSEUDOCODE and PYTHON source code! Program 4: Design (pseudocode) and implement (source code) a program (name it MinMaxAvg) to determine the highest grade, lowest grade, and the average of all grades in a 4-by-4 two-dimensional arrays of integer grades (representing 4 students’ grades on 4 tests). The program main method populates the array (name it Grades) with random grades between 0 and 100 and then displays the grades as shown below. The main method then calls method minMaxAvg()that takes a...
Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...
Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...
SOLVE IN PYTHON: Exercise #2: Design and implement a program (name it CompareArrays) that compares the content of 2 single-dimensional arrays of the same size. The program prompts the users to enter the array size. Then prompts the user to initialize each array with integer values. The program defines method Compare() that takes two signal-dimensional arrays of type integer. The method compares the content of the arrays and returns true (Boolean type) if the arrays store same values in the...
Please do in C# with the code available to copy :) Program 4: Design (pseudocode) and implement (source code) a program (name it MinMaxAvg) to determine the highest grade, lowest grade, and the average of all grades in a 4-by-4 two-dimensional arrays of integer grades (representing 4 students’ grades on 4 tests). The program main method populates the array (name it Grades) with random grades between 0 and 100 and then displays the grades as shown below. The main method...
Write a program that uses the keys(), values(), and/or items() dict methods to find statistics about the student grades dictionary. Find the following: Print the name and grade percentage of the student with the highest total of points. Also print the grade as per the below grading scale 90 to 100 A 80 to 89 B 70 to 79 C 60 to 69 D Below 60 F Find the average score of each assignment. Use the following data:...
C++ Use C++ functions and build a program that does the most basic job all students have to contend with, process the grades on a test and produce a summary of the results. The big wrinkle is, it should be a multi-file program. -Requires three simple things: Figure out the best score of all scores produced Figure out the worst score of all scores produced Assign a letter grade for each score produced Complete this lab by writing three functions....
Design Java (source code) a program (name it IndexOfLargest) to find the index of the first largest value in the array. Note that the largest value may appear more than once in the array. The program main method defines a single-dimensional array of size 10 elements and prompts the user to enter 10 integers to initialize the array. The main method then calls method findIndex() that takes a single-dimensional array of integer values and return the index of the first...