IN501_Unit6_EricaRLuberisse

docx

School

Wilmington University *

*We aren’t endorsed by this school

Course

IN501

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

9

Uploaded by CommodoreNeutron12017

Report
Programming Project Erica Luberisse IN501 - Fundamentals of Computer Programming Dr. Yamiah Torrence Purdue Global University October 22, 2023
Part 1 – IPO Chart and Flow Chart IPO Chart Flow Chart Input Student ID Student First Name Student Last Name Student Grade Student Degree Processing Inputed data is sorted into categories and prepared for selection. Output Avg Grade for All Students Avg Grade for each Program Highest Grade record Lowest Grade Record Students in MSIT Students in MSCM Students sorted by Student ID Invalid Records BADRECORDS.TXT Exit
Part 2 – Program Code #Programming Project #Erica Luberisse #IN501 Fundamentals of Computer Programming #importing CSV File import csv # csv file name filename = "STUDENTDATA.TXT" #field names stu_ID = (int) stu_first = ( str ( 10 )) stu_last = ( str ( 20 )) GPA = (int) degree = ( str ( 5 )) # Read data from the file and store into a data structure try : with open ( './STUDENTDATA.txt' , 'r' ) as file : reader = csv . reader ( file ) for row in reader : student = { stu_ID , stu_first , stu_last , GPA , degree } except : print ( "Could not locate file." ) #Students defined stu1 = ( 1001 ,STEVIE,NICKS, 63 ,MSCM) stu2 = ( 2020 ,ANN,WILSON, 94 ,MSIT) stu3 = ( 3100 ,WHITNEY,HOUSTON, 99 ,MSCM) stu4 = ( 1500 ,BRUCE,SPRINGSTEEN, 110.9 ,MSCM) stu5 = ( 2100 ,BILLY,JOEL, 64 ,BSIT) stu6 = ( 3500 ,TRENT,REZNER, 72 ,MSCM) stu7 = ( 1075 ,CHER, '' , 99 ,MSIT) stu8 = ( 2345 ,EDDIE,VANHALEN, 57 ,MSIT) stu9 = ( 3133 ,DAVID,BOWIE, 59 ,MSCM) stu10 = ( 2743 ,MICHAEL,JACKSON, 69.8 ,MSCM) stu11 = ( 1010 ,PATTI,SCIALFA, 80.3 ,MSIT) stu12 = ( 3020 ,TINA,TURNER, 95 ,MSIT) stu13 = ( 1723 ,ELTON,JOHN, 90.4 ,MSCM) stu14 = ( 1800 ,MADONNA, '' , 75.3 ,MSCM) stu15 = ( 1723 ,NANCY,WILSON, 87 ,MSIT)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
# Get input from user userInput = input ( "Make selection: " ) while not quit_program : choice = int ( input ( 'Enter choice: ' )) if choice == 10 : print ( 'Goodbye' ) quit_program = True else : print ( 'Order: ' , end = '' ) if choice == 1 : print ( 'Avg Grade for All Students' ) elif choice == 2 : print ( 'Avg Grade for each Program' ) elif choice == 3 : print ( 'Highest Grade record' ) elif choice == 4 : print ( 'Lowest Grade Record' ) elif choice == 5 : print ( 'Students in MSIT' ) elif choice == 6 : print ( 'Students in MSCM' ) elif choice == 7 : print ( 'Students sorted by Student ID' ) elif choice == 8 : print ( 'Invalid Records' ) elif choice == 9 : print ( 'BADRECORDS.TXT' ) elif choice >= '11' : print ( "Invalid choice!" ) print () # Invalid choice # Function for Calculating Avg Grade for all Students all_GPA = ( stu1 ( GPA ) + stu2 ( GPA ) + stu3 ( GPA ) + stu4 ( GPA ) + stu5 ( GPA ) + stu6 ( GPA ) + stu7 ( GPA ) + stu8 ( GPA ) + stu9 ( GPA ) + stu10 ( GPA ) + stu11 ( GPA ) + stu12 ( GPA ) + stu13 ( GPA ) + stu14 ( GPA ) + stu15 ( GPA )) Avg_Grade_All = ( all_GPA / 15 ) # Function for calculating Avg Grade for each program avg_grade_MSCM = ( stu1 ( GPA ) + stu3 ( GPA ) + stu4 ( GPA ) + stu6 ( GPA ) + stu9 ( GPA ) + stu10 ( GPA ) + stu13 ( GPA ) + stu14 ( GPA )) / 8 ;
avg_grade_MSIT = ( stu2 ( GPA ) + stu7 ( GPA ) + stu8 ( GPA ) + stu11 ( GPA ) + stu12 ( GPA ) + stu15 ( GPA )) / 6 ; avg_grade_BSIT = stu5 ( GPA ) / 1 ; # Function to display Students in MSIT my_MSIT_stu = [ stu2 ( stu_first , stu_last ), stu7 ( stu_first , stu_last ), stu8 ( stu_first , stu_las t ), stu11 ( stu_first , stu_last ), stu12 ( stu_first , stu_last ), stu15 ( stu_first , st u_last ),] # Function to display Students in MSCM my_MSCM_stu = [ stu1 ( stu_first , stu_last ), stu3 ( stu_first , stu_last ), stu4 ( stu_first , stu_las t ), stu6 ( stu_first , stu_last ), stu9 ( stu_first , stu_last ), stu10 ( stu_first , stu_ last ), stu13 ( stu_first , stu_last ), stu14 ( stu_first , stu_last )] # Function to sort students by Student ID all_stu_ID = [ stu1 ( stu_ID ), stu2 ( stu_ID ), stu3 ( stu_ID ), stu4 ( stu_ID ), stu5 ( stu_ID ), stu6 ( stu_ID ), stu7 ( stu_ID ), stu8 ( stu_ID ), stu9 ( stu_ID ), stu10 ( stu_ID ), stu11 ( stu_ID ), stu12 ( stu_ID ), stu13 ( stu_ID ), stu14 ( stu_ID ), stu15 ( stu_ID )] sort_by_stu_ID = all_stu_ID . sort () # Function for Highest Grade all_stu_GPA = ( stu1 ( GPA ), stu2 ( GPA ), stu3 ( GPA ), stu4 ( GPA ), stu5 ( GPA ), stu6 ( GPA ), stu7 ( GPA ), st u8 ( GPA ), stu9 ( GPA ), stu10 ( GPA ), stu11 ( GPA ), stu12 ( GPA ), stu13 ( GPA ), stu14 ( GPA ), stu15 ( GPA )) maxVal = all_stu_GPA .sort( max ) highest_grade = maxVal # Function for Lowest grade all_stu_GPA = ( stu1 ( GPA ), stu2 ( GPA ), stu3 ( GPA ), stu4 ( GPA ), stu5 ( GPA ), stu6 ( GPA ), stu7 ( GPA ), st u8 ( GPA ), stu9 ( GPA ), stu10 ( GPA ), stu11 ( GPA ), stu12 ( GPA ), stu13 ( GPA ), stu14 ( GPA ), stu15 ( GPA )) minVal = all_stu_GPA .sort( min ) lowest_grade = minVal # Function to Display invalid records no_stu_last = ( stu7 , stu14 ) no_MSIT_MSCM = (stu5) displayInvalidRecords = [ no_stu_last , no_MSIT_MSCM ]
# Function to create new file with invalid records called BADRECORDS.TXT. Display a message that says BADRECORDS.TXT has been created. f = open ( "BADRECORDS.txt" , "w" ) print ( f . write ( displayInvalidRecords )) #Defining display_menu print ( " \n Menu:" ) print ( ' 1) Avg Grade for All Students' ) print ( ' 2) Avg Grade for each Program' ) print ( ' 3) Highest Grade record' ) print ( ' 4) Lowest Grade Record' ) print ( ' 5) Students in MSIT' ) print ( ' 6) Students in MSCM' ) print ( ' 7) Students sorted by Student ID' ) print ( ' 8) Invalid Records' ) print ( ' 9) BADRECORDS.TXT' ) print ( ' 10) Exit \n ' ) exit_program = False # Get input from user userInput = input ( "Make selection: " ) while not quit_program : choice = int ( input ( 'Enter choice: ' )) if choice == 10 : print ( 'Goodbye' ) quit_program = True else : print ( 'Order: ' , end = '' ) if choice == 1 : print ( 'The Average Grade for All Students is:' , Avg_Grade_All ) elif choice == 2 : print ( 'The Average Grade for each Program is the following:' ) print ( 'Average grade for MSCM degree:' , avg_grade_MSCM ) print ( 'Average grade for MSIT degree:' , avg_grade_MSIT ) print ( 'Average grade for BSIT degree:' , avg_grade_BSIT ) elif choice == 3 : print ( 'The Highest Grade record is:' , highest_grade ) elif choice == 4 : print ( 'The Lowest Grade Record is:' , lowest_grade ) elif choice == 5 : print ( 'The Students in MSIT are:' , my_MSIT_stu ) elif choice == 6 :
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
print ( 'The Students in MSCM are:' , my_MSCM_stu ) elif choice == 7 : print ( 'The list of Students sorted by Student ID:' , sort_by_stu_ID ) elif choice == 8 : print ( 'The Invalid Records are:' , displayInvalidRecords , 'because they have only one name or a degree not in either MSCM OR MSIT.' ) elif choice == 9 : print ( 'A BADRECORDS.TXT has been created to include the following:' , displayInvalidRecords ) print () ## End of program
Part 3 - Feedback I worked with Marion Roper who was very helpful and patient with me. I had some struggles with personal issues and with figuring out my program and she was patient to provide me time to understand it. I also found her program well written and even though I could not get her program to run, she did write it in a different system than I did. Overall Marion had a great program that was well written. As for the feedback Marion provided me, this is what Marion had to say: Your code is a good start, but there are things to improve. You did well opening and reading the file, and the menu is organized. But it's missing important parts, like calculating averages and sorting students. I think and I want to say from me just taking a look at it. I am not sure though. Did you try sending it to other students in the class? I did advise that I send it to the professor for feedback on another matter in the program. Test Plan Input Output Pass or Fail 1 Displays Average grade for all student PASS 2 Displays Average grade for each Degree Program PASS 3 Display Highest Grade Record PASS 4 Display Lowest Grade Record PASS 5 Display Students in MIST Program PASS 6 Display Students in MSCM Program PASS 7 Display Students sorted in order by Student ID# PASS 8 Display Students with Invalid Records PASS 9 Write and Print Student that have been written to BADRECORDS.TXT file PASS 10 Exit Program PASS 11 Invalid Choice FAIL Any number other than 1-10 Invalid Choice FAIL
Link for Debugging Program Video via Zoom https://zoom.us/clips/share/A2F3MSD2bTDvWypo3V4P7I8yQDlhg321TH5PIz00qM3Mwz8Yi w Lessons Learned I have learned from this course and from this assignment to create a menu program that allows for a user to open data that is read from a file and compiled into options. I learned how to write loops and tuples as well as functions for calculating and sorting. This process has made me a better writer in terms of writing programs. I have learned that there is still more for me to learn in this program as far as how to correct issues and fix problems within the program code. I hope that going forward in my courses I will improve on this successfully.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help