Objectives include: . Create and use a class Print information to the console Print plots to the console Read informatio

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Objectives include: . Create and use a class Print information to the console Print plots to the console Read informatio

Post by answerhappygod »

Objectives Include Create And Use A Class Print Information To The Console Print Plots To The Console Read Informatio 1
Objectives Include Create And Use A Class Print Information To The Console Print Plots To The Console Read Informatio 1 (131.11 KiB) Viewed 50 times
Code in Python Please
Objectives include: . Create and use a class Print information to the console Print plots to the console Read information from a csv file Process strings from the input Create a text file as output Use variables and sequence types Use if Statements and loops Use functions . . Hand-in Requirements All projects will be submitted electronically through Blackboard. Zip up your entire project directory/folder to submit. (Right click on the project folder and select zip or compressed files) Use the following naming convention for your submission: << Project2_abc123.zip >> The project folder should include all files necessary to run your program. It must run in Spider version 5.1.5 (the Spider version on the UTSA VDI). Introduction This program aims to help a UTSA instructor manage and generate reports of students' grades. Your program will allow the teacher to: . 0 Input a grade book of students from a csv file (independent of class size). Create a Student Python Class to apply to each student in the grade book. Based on a menu of choices: Display on the console a student's exam scores. Menu choices include: Either all exam scores, the average, the lowest or the highest Create a plot of an individual student's exam scores Create a plot of all the students average grades (Extra Credit) Create an output file of the overall class averages per student Exit the Program . 0 You will be asking your instructor/user a number of questions via the console. In addition, you will load a file into your program for processing. The input file for this assignment is provided on Blackboard (where you found the pdf
instructions). In addition, a test script used to evaluate your program is provided at the end of this document. Finally, a rubric is provided to help you understand the requirements. Detail Requirements The program has three major sections: 1. 2. 3. Create a Python Class called Student for you student information with specific functions. Read in a csv file and use the Student class object to create a list of all the student information. Present a menu to the instructor/user to display information about individual and the overall class exams results. This will include print to the console as well as plots to the console. The overall class exam results plot is extra credit (25 points) and can be skipped with a null menu option if you do not submit the extra credit. Section 1 You will be using a class object you will create in your code. The name of the class object must be Student. This Student Class must, at a minimum include the following attributes (fields): Idinfo -a string field collecting information on the student's abc123 first_name -a string field collecting information on the student's first name last_name - a string field collecting information on the student's last name examl - an integer field collecting the student's first exam score exam2 - an integer field collecting the student's second exam score exam3 - an integer field collecting the student's third exam score In addition, the Class must include functions to: load_std_info - recieves a string input, breaks it into tokens, and assigns them to the class fields cal_ave - returns the average of the three exam scores for the individual student cal_low - returns the lowest exam score of the three for the individual student cal_high-returns the highest exam score of the three for the individual student Section 2 You will open the "section1-students.csv" file. This file can be found as an attachment to the assignment within Blackboard. You should download it into the same folder where you are creating/building your Python script. The file is a csv format which means each field is separated by a coma. Each row is a different student. The columns represent the following information in this order: student's abc123, first name, last name, exam 1 score, exam 2 score, exam 3 score Once open, you will read the csv file using the readlines() method. You will be creating a temporary array to hold a list of string variables collected from the readlines() method. Each element in this temporary array will be one line
of information from the csv file. For example, the first line of the csv will have be in the first element of your new variable Next, you MUST create another new master array/vector where all the student's information will be captured into Student Class objects and stored in this list. You will want to loop through the temporary array you created above and use the load_std_info method you create in your Student Class. At the end of your loop you will append the created Student object to your new Master array/vector. Don't forget to create a blank/empty array before you start! The load_std_info method This method should have a string parameter. You will be passing string arguments from your temporary array (one at a time) to this method. Within the method you will break down the string into tokens based on the separator (0) comas. Each token should be assigned to a class attribute. Section 3 Section 3 of your program will be the most complex as you will be using a menu system with a submenu system. Within the menu system you should use function calls to access different menu activities. Navigating between the menus is your choice. At a minimum, your menus need to include the follow information. If you create/use additional menu items to navigate between the functions, those will not cause you to lose points. The below requirements will provide details on how to meet the minium and extra credit options for this assignment. Minimum Requirements You must include a header. The header must follow the format below. (Insert your full name in the YOURNAME). UTSA - Spring 22 - CS1063 - Section 1 - Project 2 - written by YOURNAME The program will present a menu to the instructor/user, with 5 options. Main Menu 1: Exam Scores 2: Graphs 3: Class Graph: 4: Output Grades File 5: Exit Program Selection an Option: Based on console input from the instructor/user, the program will perform one of the five below activities. It will continue to prompt the instructor/user until option 5 (Exit Program) is selected. Then the program will close with a farewell message. o 0 o Exam scores (which will have a submenu) Graphs Class Graph (extra credit) Output Grades File Exit the Program o Note: If the instructor/user inputs a number outside of 1-5, the program should prompt the user to resubmit due to an error. Value is out of range, please resubmit:
Main Menu 1: Exam scores Option When the instructor/user selects option 1, a new menu will be presented to the instructor/user. Individual Student Exam Menu 1: List All 2: Average 3: Low Score: 4: High Score 5: Exit Selection an Option: Just like the main menu, you should have check to ensure the instructor/user selects a value in the menu and prompt them for a new value if it incorrect. Once the instructor/user selects a correct menu option, you must prompt the user for a way to indentify the student. We will be using the class idinfo field, which is the student's abc123. You will want to capture this value for use in your methods. Provide abc123 of Student: Each time the instructor/user selects a menu choice, you will need to prompt the user for the abc123. The program is not required to maintain a student id between each menu selection. Assumption is that the user will want to change students while in the Individual Student Exam Menu. Submenu 1: List All The List all menu option will search the master class list of Student objects for the matching student and display on the console, the three exam scores. Exam Scores: NNNNNNNNN If the search does not result in a student id match, the program should indicate that the student id provided was not found. Not Found: provided_student_id Submenu 2: Average The Average menu option will search the master class list of Student objects for the matching student and use the Student Class method cal_ave to provide the average exam results. The results will be displayed on the console (floating point with 2 decimals.) Student Average: NN.NN If the search does not result in a student id match, the program should indicate that the student id provided was not found. Not Found: provided_student_id The cal_ave method This method must be defined within the Student class. You do not need to pass any arguments to this method, as it should be able to calculate the value by using the class attributes. Submenu 3: Low Score
The Low Score menu option will search the master class list of Student objects for the matching student and use the Student Class method cal_low to provide the lowest exam results. The results will be displayed on the console. Low Score: NNN If the search does not result in a student id match, the program should indicate that the student id provided was not found. Not Found: provided_student_id The cal_low method This method must be defined within the Student class. You do not need to pass any arguments to this method, as it should be able to calculate the value by using the class attributes. You will want to search the appropriate student scores for the lowest and return that value from the method. Submenu 4: High Score The High Score menu option will search the master class list of Student objects for the matching student and use the Student Class method cal_high to provide the highest exam results. The results will be displayed on the console. High Score: NNN If the search does not result in a student id match, the program should indicate that the student id provided was not found. Not Found: provided_student_id The cal_high method This method must be defined within the Student class. You do not need to pass any arguments to this method, as it should be able to calculate the value by using the class attributes. You will want to search the appropriate student scores for the highest and return that value from the method. Submenu 5: Exit This option should return the user to the main menu. Main Menu 2: Graphs The Graphs menu option will provide a console display to indicate the results will be a graph of the exam scores. This will provide a graph of exam scores. It will also search the master class list of Student objects for the matching student. The user will need to provide the student abc123. Provide abc123 of Student: If the search does not result in a student id match, the program should indicate that the student id provided was not found. Not Found: provided_student_id When a student is found, a plot of the students scores will be displayed in the console.
The plot must include each of the three scores, clearly labeled. It must include a label for the x axis ("Exams") and a label for the y label ("Scores") and a legend with the student's abc123. Below is an example of the appropriate format. Once the plot is completed the program returns to the main menu. 100 abc123 95 90 Scores 85 80 75 Exam 1 Exam 3 Exam 2 Exams Main Menu 3: Class Graph (Extra Credit) This menu option is extra credit if you complete it (25 pts). If you do not want to submit extra credit, display the following prompt when the user selects option 3. And return the user to the main menu. The "Under Construction" option does not get you any additional extra credit points Under Construction To get full extra credit points, when the user selects option 3, the program will first calculate the overall number of student exam averages (using the cal_ave method from the Student class) per letter grade. Letter grades are based on the ranges listed in the table below. Letter A B с D F Range 90 <= grade <= 100 80 <= grade < 90 70 <= grade < 80 60 <= grade < 70 grade <60 Then the program will create a plot with the number of students in each category. The plot must include the letter grades on the x axis and the number of students on the y axis with approprate labels. You must also include a title "Report of Section 1 Grades". The example below only has three scores and they were all As. This is just an example, the real data will be different but the x and y axis format will be the same.
Report of Section 1 Grades 3.0 25 20 Number of Students 15 10 0.5 0.0 А F Letter Grades Help Variable Explorer Plots Files Main Menu 4: Output Grades File When the instructor/user selects option 4, the program will create an output text file. The text file will include one line for each student in the master list. The format of the output will be Last Name, First Name and the student's Average Score. The file will also include a coma between each field in the output. The name of the file to output will be "Section1 Results.txt". The display will notify the user that the file has been created. Output File created in home directory Main Menu 5: Exit When the instructor/user selects option 5, the program will display the below farewell message on the console. Include your name in YOURNAME> Thank you. This program is brought to you by Python Expert: YOURNAME. Test Script When we evaluate your program we will start with this test script to see if you have all of the functions and capabilities required in the minimum requirements. We may use additional menu choices, but if your program can successfully navigate the below script and provide the required information you should get full points (based on the rubric) 1, 1, abc123, 2, aaa123, 3, zzz123, 3, abc123, 4, iii123, 5, 2, abc123, 2, iii123, 3, 4,5
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply