Question: #Create Three Python Modules - One for classes, one for your functions and one for your main program #In your classes module: #Define a Student
#Create Three Python Modules One for classes, one for your functions and one for your main program #In your classes module: #Define a Student class with a initialization method that initializes firstname, lastname and middlename. #Define a method that returns a neatly formatted string of the Student's information. #Include a getfullname method in the Student class to return the full name of the student, including the middle name if provided. #This method should handle cases where the student does not have a middle name. You might consider a conditional ifelse statement to satisfy this requirement. #Your method should return either firstname, middlename, lastname or firstname, lastname #Define the Undergrad Class Inherits from Student: #Create a class named Undergrad that inherits from the Student class. #Implement an init method in the Undergrad class to initialize attributes such as level, major, and concentration, in addition to those inherited from Student. #Add a method named createundergradstudent to the Undergrad class to format and return the information of an undergraduate student. #Define the GradStudent Class Also Inherits from Student: #Create a class named GradStudent as a subclass of Student. #Implement an init method in the GradStudent class to initialize attributes such as level, major, concentration, and thesis topic, in addition to those inherited from Student. #Add a method named creategradstudent to the GradStudent class to format and return the information of a graduate student. # #In your functions module: #Function Definition and User Input: #Define a nonparameterized function named createstudent. #Display a prompt asking the user to enter the student's level as either undergrad or gradstudent using input #Convert the input to lowercase using lower to ensure caseinsensitivity. #Processing for Undergraduate Students: #If the student level entered is 'undergrad' after converting to lowercase set the level variable to the inputted studentlevel. #Prompt the user to enter the first name, last name, middle name, major, and concentration using input Convert each input to lowercase. #Store the entered values in respective variableslevel 'firstname', 'lastname', 'middlename', 'major', 'concentration' #Return a dictionary where keys are level, firstname, lastname, middlename, major, and concentration. What will your values be They are right in front of your face. #Processing for Graduate Students: #If the student level is 'gradstudent' after converting to lowercase set the level variable to studentlevel. #Prompt the user to enter the first name, last name, middle name, major, concentration, and thesis topic using input Convert each input to lowercase. #Store the entered values in respective variables level 'firstname', 'lastname', 'middle name', 'major', 'concentration', 'thesistopic' #Return a dictionary where keys are level, firstname, lastname, middlename, major, concentration, and thesistopic. What will your values be They are right in front of your face. #If the entered student level is neither 'undergrad' nor 'gradstudent', return None. # #In you main module: #Import Statements: #Begin by importing the required classes and functions using the import statements provided: #Import Undergrad and GradStudent classes from classmodule. #Import the createstudent function from functionsmodule. #Main Function Definition: #Define a function named main. #Calling createstudent Function: #Inside the main function, call the createstudent function from functionsmodule to prompt the user to enter student information. #Store the returned student information in a variable named studentinfo. #Checking for Valid Student Information: #Check if the studentinfo variable is not None, which indicates that valid student information was entered. #Creating Undergraduate Student Object: #If the student level in studentinfo is 'undergrad': #Create an instance of the Undergrad class using the provided student information level first name, last name, middle name, major, concentration #HINT studentinfolevel studentinfofirstname' REMEMBER ONE WAY TO UPDATE A DICTIONARY???? #Print a message indicating the creation of a new undergraduate student. #Call the createundergradstudent method on the Undergrad instance and print the formatted student information. #Creating Graduate Student Object: #If the student level in studentinfo is 'gradstudent': #Create an instance of the GradStudent class using the provided student information level first name, last name,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
