Questions
Please create a python module named homework.py and implement the classes and methods outlined below. Below...

Please create a python module named homework.py and implement the classes and methods outlined below. Below you will find an explanation for each class and method you need to implement. When you are done please upload the file homework.py to Grader Than. Please get started as soon as possible on this assignment. This assignment has many problems, it may take you longer than normal to complete this assignment. This assignment is supposed to represent a group of students in a course. A group of students in a course will be assigned an assignment and produce a collection of assignment results. The results will be used to figure out grade statistics. The grade they receive for their work on the assignment is entirely dependant on the student's energy level. If the student works on many assignments without sleeping their grade will suffer. You will implement four classes (Assignment, AssignmentResult, Student, and Course), they will depend on each other in the order they are listed. Hint: Work on the methods in the order they are found in the documentation below, implement the getter and setter methods before the more complicated methods. Work on the Assignment class, AssignmentResult class, Student class and Course class in that order. Class Assignment This object represents a school assignment that a student will work on.

__init__(self, name: str, difficulty: float):

""" Constructs an assignment with the given assignment name and a float that indicates the level of difficulty of the assignment. :param name: The name of the assignment :param difficulty: The level of difficulty of the assignment

"""

name(self) -> str:

"""

Returns the name of the assignment as specified in the constructor. :return: The assignment name

"""

difficulty(self) -> str:

"""

Returns the level of difficulty of the assignment as specified in the constructor. :return: The assignment level

"""

__str__(self) -> str:

"""

Returns the name of the assignment as specified in the constructor. :return: The assignment name

"""

Class AssignmentResult An object that represents the result of an assignment.

__init__(self, id:int, assignment: Assignment, grade: float):

"""

This will contain the ID of the student, the assignment that the student worked on and the grade the student received on the assignment. :param id: The ID of the student that created this Assignment result :param assignment: The Assignment that the student worked on. :param grade: A number between 0-1 representing the numerical grade the student received

"""

id(self) -> int:

"""

Returns the ID of the student as specified in the constructor. :return: The student's ID

"""

grade(self) -> float:

""" Returns the grade as specified in the constructor. :return: The grade the student received for this assignment

"""

assignment(self) -> Assignment:

""" Returns the assignment as specified in the constructor. :return: The assignment that the student worked on to create this result

"""

Class Student This class represents a single student

__init__(self, id: int, fist_name: str, last_name: str, town:str):

"""

This creates a student object with the specified ID first and last name and home town. This constructor should also create data structure for holding the students grades for all of there assignments. Additionally it should create a variable that holds the student's energy level which will be a number between 0 and 1. :param id: The student's identifiaction number :param fist_name: The student's first name :param last_name: The student's last name :param town: The student's home town

"""

id(self)->int:

"""

Returns the ID of the student as specified in the constructor. :return: The student's ID """ first_name(self) -> str: """ Returns the first name of the student. :return: The student's first name """ set_first_name(self, name:str): """ Changes the student first name to the specified value of the name parameter. :param name: The value that the first name of the student will equal. """ last_name(self) -> str:

"""

Returns the last name of the student. :return: The student's last name """ set_last_name(self, name: str):

"""

Changes the student last name to the specified value of the name parameter. :param name: The value that the last name of the student will equal.

"""

town(self) -> str:

""" Returns the hometown of the student. :return: The student's town name

"""

set_town(self, town: str):

""" Changes the student's hometown to the specified value of the town parameter. :param name: The value that the hometown of the student will equal.

"""

__str__(self) ->str:

"""

Returns a string containing the student's first and last name separated by a space. :return: Returns a string of the full name of the student

"""

grade(self)->float:

"""

Calculates a an average grade based off of the student's past assignment's grades. The lowest grade is not included in the grade calculation if the student has been assigned to two or more assignments in the past. See assign() for more detains. If the student has not been assigned any assignments in the pass this should return 0. :return: A number between 0-1 indicating the student's grade

"""

assign(self, assignment:Assignment) -> AssignmentResult:

"""

This function is to simulate the process of the student receiving an assignment, then working on the assignment, then submitting the assignment and finally receiving grade for the assignment. This function will receive an assignment then a grade should be calculated using the following formula: grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0) After the grade is calculated the student's energy should be decreased by percentage difficulty. Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0) Finally the grade calculated should be stored internally with in this class so it can be retrieved later. Then an Assignment Result object should be created with the student's ID, the assignment received as a parameter, and the grade calculated. This newly created Assignment Result object should be returned. :return: The an AssignmentResult outlining this process

"""

sleep(self, hours:float):

"""

This function restore the student's energy as a rate of 10% per hour. So if they sleep for 8 hours there energy will be restored by 80%. If they have 50% (.5) energy and sleep for 8 hours the will wake up with 90% energy = (.5 * (1+.8)). The max energy a s student may have is 100% (1) :param hours: The number of hours a student will sleep for. Example: .2 is equal to 12 minutes or 20% of an hour. :return: None

"""

energy(self):

"""

Returns the current energy of the student. A number between 0 and 1 :return: The energy of the student.

"""

Class Course This class represents a course that a group of students is enrolled in. They will be assigned assignments when enrolled in this course. This object will be used to calculate aggregate student statistics. __init__(self, students: list): """ Constructs a course with the specified list of students :param students: A list containing one or more students

"""

mean_grade(self) -> float:

"""

Returns the numerical value of the class mean (average) grade. :return: The average student grade

"""

max_grade(self) -> float:

"""

Returns the highest grade in the class. The grades used in the calculation come from the student.grade(), it does not care if a grade was earned when the student was in another class. :return: The highest grade in the class

"""

min_grade(self):

"""

Returns the highest grade in the class. The grades used in the calculation come from the student.grade(), it does not care if a grade was earned when the student was in another class. :return: The highest grade in the class

"""

median_grade(self) -> float:

"""

Calculates and returns the median (middle value) of all the student's grades in this course The grades used in the calculation come from the student.grade(), it does not care if a grade was earned when the student was in another class. :return: The median grade

"""

grade_variance(self) -> float:

"""

Calculates and returns the sample variance of all the student's grades in this course The grades used in the calculation come from the student.grade(), it does not care if a grade was earned when the student was in another class. :return: The sample variance of the grades

"""

grade_std_dev(self) -> float:

"""

Calculates and returns the sample standard deviation of all the student's grades in this course. The grades used in the calculation come from the student.grade(), it does not care if a grade was earned when the student was in another class. :return: The sample standard deviation of the grades

"""

assign(self, name: str, difficulty: float) -> None:

"""

This creates an assignment using the parameters specified, then assigns it to all of the students in this course, by calling the assign method on each student. Subsequent invocations to the statistics methods above should reflect the changes made by this method after it is called. In other words if a very difficult assignment is assigned the course mean should be less after. :param name: The name of the assignment :param difficulty: The level of difficulty of the assignment :return: None

"""

can someone help me on this Q with some explanation ? thank you in advance!

In: Computer Science

List the exact order of flow of bile and pancreatic juice as it flows out of...

List the exact order of flow of bile and pancreatic juice as it flows out of the Liver, Pancreas, and the Gallbladder. List all ducts and any sphincters. Use modern and classical terminology.


List the order in text and not flow chart.

In: Anatomy and Physiology

Write a Python module that must satisfy the following- Define a function named rinsert. This function...

Write a Python module that must satisfy the following-

Define a function named rinsert. This function will accept two arguments, the first a list of items to be sorted and the second an integer value in the range 0 to the length of the list, minus 1. This function shall insert the element corresponding to the second parameter into the presumably sorted list from position 0 to one less than the second parameter’s index.  

Define a function named rinsort. This function will accept two arguments, the first a list of items to be sorted and the second an integer value in the range 0 to the length of the list, minus 1. This function shall sort the elements of the list from position 0 to the position corresponding to the second parameter, in ascending order using insertion sort. This function must be recursive.

In: Computer Science

I can not get the summary report to show in the output it just keeps running...

I can not get the summary report to show in the output it just keeps running after i enter the names, scores, and then / /. Can someone help me I am using codeblocks but I might be able to figure out even if you use another IDE>

This is my code

#include <iostream>

using namespace std;

int main()
{
string name;
double score =0;
int totalStudents = 0;
int A=0,B=0,C=0,D=0,F=0;
cout << "Enter student name" << endl;
cin >> name;

while (name!="//"){
cout << "Enter student score" << endl;
cin >> score;
if(score>=90){
A++;
cout<<name<<" "<<score<<" A"<<endl;
}
else if(score>=80&&score<90){
B++;
cout<<name<<" "<<score<<" B"<<endl;
}
else if(score>=70&&score<80){
C++;
cout<<name<<" "<<score<<" C"<<endl;
}
else if(score>=60&&score<70){
D++;
cout<<name<<" "<<score<<" D"<<endl;
}
else if (score>=0&&score<60) {
F++;
cout<<name<<" "<<score<<" F"<<endl;
}
cout << "Enter student name" << endl;
cin >> name;
totalStudents++;
}
cout << "Enter student name" << endl;
cin >> name;
cout << "Summary Report" << endl;
cout << "Total Students count " << totalStudents << endl;
cout << "A student count " << A << endl;
cout << "B student count " << B << endl;
cout << "C student count " << C << endl;
cout << "D student " << D << endl;
cout << "F students " << F << endl;
return 0;
}


This was the question

Topics

Loops

while Statement

Description

Write a program that computes the letter grades of students in a class from knowing their scores in a test. A student test score varies from 0 to 100. For a student, the program first asks the student’s name and the student’s test score. Then, it displays the student name, the test score and the letter grade. It repeats this process for each student. The user indicates the end of student data by entering two consecutive forward slashes ( // ) when asked for the student name. At the end, the program displays a summary report including the following:

·       The total number of students.

·       The total number of students receiving grade “A”.

·       The total number of students receiving grade “B”.

·       The total number of students receiving grade “C”.

·       The total number of students receiving grade “D”.

·       The total number of students receiving grade “F”.

The program calculates a student's the letter grade from the student's test score as follows:

A is 90 to 100 points

B is 80 to 89 points

C is 70 to 79 points

D is 60 to 69 points

F is 0 to 59 points.

Requirements

Do this exercise using a While statement and an If/Else If statement.

Testing

For turning in the assignment, perform the test run below using the input data shown

Test Run (User input is shown in bold).

Enter Student Name

Alan

Enter Student Score

75

Alan 75 C

Enter Student Name

Bob

Enter Student Score:

90

Bob 90 A

Enter Student Name

Cathy

Enter Student Score

80

Cathy 80 B

Enter Student Name

Dave

Enter Student Score:

55

Dave 55 F

Enter Student Name

Eve

Enter Student Score

85

Eve 85 B

Enter Student Name

//

Summary Report

Total Students count 5

A student count 1

B student count: 2

C student count 1

D student 0

F students 1

Sample Code

string name;

double score;

//Initias setup

cout << "Enter student name" << endl;

cin >> name;

//Test

while (name != "//")

{

    cout << "Enter student score" << endl;

    cin >> score;

    //more code here

    //Update setup

    out << "Enter student name" << endl;

    cin >> name;

}

//display summary report

In: Computer Science

explain how the study of a course in communication benefits students at the university as they...

explain how the study of a course in communication benefits students at the university as they prepare for their professional lives

In: Finance

Write a health issue goal for the topic of mental health/mental illness in college students.

Write a health issue goal for the topic of mental health/mental illness in college students.

In: Nursing

what are 2 peer reviewed research articles about students mental health and wellbeing ?

what are 2 peer reviewed research articles about students mental health and wellbeing ?

In: Nursing

What is Response to Intervention (RTI) and how is it used to support students? Explain your...

What is Response to Intervention (RTI) and how is it used to support students? Explain your response.

In: Nursing

Can I have research tools to assess students' perceptions regarding online teaching?

Can I have research tools to assess students' perceptions regarding online teaching?

In: Nursing

Discuss why education is a man made trap from the perspective of students, parents and teachers.

Discuss why education is a man made trap from the perspective of students, parents and teachers.

In: Economics