Question

In: Computer Science

You will need the following variables: ExamAvg, FinalExam, Partication, AssignAvg, MyName, Grade Create lists for Exams...

You will need the following variables:

ExamAvg, FinalExam, Partication, AssignAvg, MyName, Grade

Create lists for Exams and Assignments, ExamList and AssignList.

Assume Participation is 100% for now and assign values to assignments and exams (you'll have to guess at Exam2). Use methods we have learned on lists to calculate the averages.  

Your grade is calculated by the following weighting formula:

Grade = (0.30)*(ExamAvg) + (0.25)*FinalExam + (0.05)*Participation + (0.40)*AssignAvg

Use a series of if-else, and elif statements to calculate (and print) your grade according to the following:

if 90 <= grade <= 100 Congratulations, MyName, you earned an A.  

if 80 <= grade <= 89 Good work, MyName, you earned a B.

if 70 <= grade <= 79 You earned a C, MyName, perhaps a bit more work?

if 60 <= grade <= 69 You earned a D, MyName, come for help if you need it.

if grade < 60 You are failing the course. Please come for help.  

You are free to use different variable names, put values in a list, etc.  

Solutions

Expert Solution

Our task is to find the apropriate grade according to the score we obatined by the given equation,

Grade = (0.30)*(E-xamAvg) + (0.25)*FinalE-xam + (0.05)*Participation + (0.40)*AssignAvg

To do that we need to create two list (E-xam and assignment) and initialize them with values then find avarage avg odf e-xam and assignment and assign it to apropriate variables

Lets see how to code this in python,

Code

(Please raed all comments for the better understanding of the program)

Sample Run

I am also providing the text version of the code in case you need to copy paste

E-xam=[87,95,67,83,75,78,94] #Initialization of list E-xam

Assignment=[65,95,96,90,87,99] #Initialization of list Assignment

FinalE-xam=95 #final e-xam score is initialized as 95

Myname='DiCaprio' #Myname is set

Participation=100


sum=0 #setting sum to zero to fing average
for i in E-xam: #iterating through each element in the list

sum=sum+i #finding sum   
  
E-xamAvg=sum/len(E-xam) #finding average (len()is used to find the length of list)


sum=0
for i in Assignment:
sum=sum+i
  
AssignAvg=sum/len(Assignment) #finding average of assignment


grade= (0.30*E-xamAvg)+(0.25*FinalE-xam)+(0.05*Participation)+(0.40*AssignAvg) #grade finding formula

grade=int(grade) #rounding the grade

if grade>=90 and grade<=100: # if -else ladder to find the apropriate grade
print('Congatulations ',Myname,' You earned an A')
  
elif grade>=80 and grade<=89:
print('Good work ',Myname,' You earned a B')

if grade>=70 and grade<=79:
print('You earned a C ',Myname,' perhaps a bit more work?')
  
if grade>=60 and grade<=69:
print('You Earned a D ',Myname,' come for help if you need it')
  
elif grade <60 :
print('you are failing the course,Please come for help.')
  
  

  


Related Solutions

Using C++, you will create a program, where you will create two doubly linked lists. These...
Using C++, you will create a program, where you will create two doubly linked lists. These doubly linked lists will contain integers within them. Using the numbers in both of these linked lists, you add the numbers together, and insert the addition of the two numbers into a singly linked list. the input can be from the user or you just write the input. for example, if one number in the doubly linked list is 817 and in the other...
The following data lists the grades of 6 students selected at random: Mathematics grade: (70, 92,...
The following data lists the grades of 6 students selected at random: Mathematics grade: (70, 92, 80, 74, 65, 85) English grade: (69, 88, 75, 80, 78, 90) a). Find the regression line. b). Compute and interpret the correlation coefficient.
You are hired to create a database for a Real Estate firm that lists and sells...
You are hired to create a database for a Real Estate firm that lists and sells properties at multiple sales offices . Draw an ER diagram using ERDPlus for the following description of the firm, indicate all primary keys and cardinalities. List any assumptions you made. There are many sales offices in several states. Attributes of a sales office include office number (identifier) and location. Components of location include Address (number & street), City, State and Zip. Each sales office...
Please provide HTML code for the following: - Create a page that lists a set of...
Please provide HTML code for the following: - Create a page that lists a set of audio files and shows their duration - Create a page that lists a set of video files and plays a different video when you click on the play icon
Create a report that lists each topping and also lists the number of pizzas that used...
Create a report that lists each topping and also lists the number of pizzas that used that topping. Order the report in decreasing order of number of pizzas. That is, the most popular toppings will be at the top of the report.2 In each row of the table list: the topping name; the price of the topping; the number of pizzas that used the topping; and, the total value of the topping (number of pizzas times topping price). Since some...
1.     Which of the following is true of variables? a. Variables only need conceptual definitions. b....
1.     Which of the following is true of variables? a. Variables only need conceptual definitions. b. Variables are the same as constants. c. All variables can be manipulated. d. Some variables can be either manipulated or measured. QUESTION 2 When evaluating causal claims, which of the following questions assesses internal validity? a. How well did the experiments manipulate the variables? b. To what populations can we generalize this claim? c. Are the groups large enough to find a significant difference?...
Please implement the java method addInOrder() that allows you to create and maintain the lists in...
Please implement the java method addInOrder() that allows you to create and maintain the lists in the order required. The addInOrder method must work with different external Comparator objects. (Hint: Consider creating and using a private compare method and a private Comparator reference as members of your SLL class. If your SLL is constructed without any parameter, then you should initialize the internal Comparator object reference to null. Otherwise, you should initialize it to the external Comparator object passed as...
Create a C++ program that consists of the following: In maincreate the following three variables:...
Create a C++ program that consists of the following: In main create the following three variables: A char named theChar A double named theDouble An int named theInt Fill each of these variables with data taken as input from the keyboard using a single cin statement. Perform the following task on each variable: Increment theChar by one Decrement theDouble by two Square theInt This should be done on separate lines. Output the value of each variable to the screen on...
The following is a free response question to be used as practice for future exams. You...
The following is a free response question to be used as practice for future exams. You can complete the assignment in this document, using the drawing tools in Word (or any photo editing program) or print this document, and complete the activity by hand, submitting a scan or photo of your work. When you are done, submit the assignment for grading by your instructor. This question will be graded out of 6 points. 1. The table below shows the production...
The following is a free response question to be used as practice for future exams. You...
The following is a free response question to be used as practice for future exams. You can complete the assignment in this document, using the drawing tools in Word (or any photo editing program) or print this document, and complete the activity by hand, submitting a scan or photo of your work. When you are done, submit the assignment for grading by your instructor. This question will be graded out of 6 points. 2012 Quantity 2012 Price (Base year) 2013...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT