Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python coding PEP8 Standards python coding PEP8 Standards Design a class named Person that contains the following: 1. A private string, firstName that store the

python coding PEP8 Standards

python coding PEP8 Standards

image text in transcribed

image text in transcribed

Design a class named Person that contains the following: 1. A private string, firstName that store the first name of a person 2. A private string, lastName that store the last name of a person 3. A private int, idNumber that stores the id number of a person 4. A private int, graduateYear that stores integer for the year student graduates or expects to 5. A constructor method that creates a person instance with the specified firstName, lastName, idNumber, and graduateYear (default O ). - For this constructor, whatever input comes in for the idNumber, convert to a string and add an " S " to the beginning of the id number 6. A printPerson method which will return all the person's attributes Design a class named Student, which is a child class to Person, that contains the following: 1. A constructor method which creates a student instance that does the following: - Inherits all the properties of the Person class - Make sure to handle error if graduateYear is not an int - Initializes a public list, testScores that stores the test scores of the student 2. A calculate function which will calculate a student's overall average grade as well as returns the letter grade based on the average grade using the following grading scheme 3. An updateGrades method to alter a grade in the list. This method should take in two parameters. - The first parameter being a float, the grade. - The second parameter being an int, the place in the list. - You should check to make sure the grade entered is valid (i.e. is a float) - You should check to make sure the index value is valid (i.e. can be a valid int type and the index value exists in the list) - Your code should not crash based on bad inputs (i.e. you need to handle errors) 4. A__str__ method which will return a string with a student's idNumber and grades in this format 'Student \# idNumber : grades' Instantiate the student class with the following information: - Use your first name and last name to fill in firstName and lastName, respectively - idNumber is the day you were born - Create a variable to store this instance Finally, call the printPerson method and then call print () on the instance variable. What do you notice about the idNumber printed when calling printPerson vs just printing the instance variable? Explain. Design a class named Person that contains the following: 1. A private string, firstName that store the first name of a person 2. A private string, lastName that store the last name of a person 3. A private int, idNumber that stores the id number of a person 4. A private int, graduateYear that stores integer for the year student graduates or expects to 5. A constructor method that creates a person instance with the specified firstName, lastName, idNumber, and graduateYear (default O ). - For this constructor, whatever input comes in for the idNumber, convert to a string and add an " S " to the beginning of the id number 6. A printPerson method which will return all the person's attributes Design a class named Student, which is a child class to Person, that contains the following: 1. A constructor method which creates a student instance that does the following: - Inherits all the properties of the Person class - Make sure to handle error if graduateYear is not an int - Initializes a public list, testScores that stores the test scores of the student 2. A calculate function which will calculate a student's overall average grade as well as returns the letter grade based on the average grade using the following grading scheme 3. An updateGrades method to alter a grade in the list. This method should take in two parameters. - The first parameter being a float, the grade. - The second parameter being an int, the place in the list. - You should check to make sure the grade entered is valid (i.e. is a float) - You should check to make sure the index value is valid (i.e. can be a valid int type and the index value exists in the list) - Your code should not crash based on bad inputs (i.e. you need to handle errors) 4. A__str__ method which will return a string with a student's idNumber and grades in this format 'Student \# idNumber : grades' Instantiate the student class with the following information: - Use your first name and last name to fill in firstName and lastName, respectively - idNumber is the day you were born - Create a variable to store this instance Finally, call the printPerson method and then call print () on the instance variable. What do you notice about the idNumber printed when calling printPerson vs just printing the instance variable? Explain

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Social Media Audit And Stats Audit And Statistics For Social Media Platforms

Authors: Virtual Desk Tools

1st Edition

B09JDX8Z9M, 979-8492994938

More Books

Students also viewed these Accounting questions

Question

The First Amendment protects all kinds of speech equally.

Answered: 1 week ago