Assignment 9 part 0 Part 0 (Warm-Up This program relies on a series of data files. Simply right-click on the links below (control-click on a Mac) and select Save-As to save these files to your...

1 answer below »
here you go


Assignment 9 part 0 Part 0 (Warm-Up This program relies on a series of data files. Simply right-click on the links below (control-click on a Mac) and select Save-As to save these files to your computer. Ensure that these files are stored in a folder that contains your source code file (i.e. 'LastnameFirstname_assign9_part1.py') for this project as well. • class_data.txt • enrollment_data.txt These files have already been uploaded to your individual Ed workspaces to save some time! You've been hired by NYU's Computer Science department to create a tool that will allow professors to look up their course rosters online. Currently course registration data is stored using two different text files. class_data.txt Stores the course ID and the title of each course. There will always be one record in this file for every course that the CS department is currently offering. Here's what this file looks like: CS0002,Introduction to Computer Programming CS0004,Introduction to Web Design and Computer Principles CS0060,Database Design and Implementation CS0061,Web Development CS0101,Introduction to Computer Science CS0102,Data Structures CS0201,Computer Systems Organization CS0380,Special Topics in Computer Science enrollment_data.txt Stores the course ID, last name and first name of each student enrolled in the course. Note that there are multiple records per course (one per student enrolled). For example, here's the beginning of this file showing six students enrolled in CS0002: CS0002,Hiner,Judith CS0002,Mcmahon,Ludivina CS0002,Trusty,Beatrice CS0002,Brinn,Jacqulyn CS0002,Hintzen,Floria CS0002,Amyx,Randolph Your task is to write a program that asks the user for a course ID. The program will then determine if the course ID is valid or not -- if https://cs.nyu.edu/courses/fall21/CSCI-UA.0002-003/assignments/assignment09/class_data.txt https://cs.nyu.edu/courses/fall21/CSCI-UA.0002-003/assignments/assignment09/enrollment_data.txt it is not, the program can safely end. If it is valid, the program should report the full title of the course, how many students are enrolled in the course and the names of each student enrolled. You cannot hard code your program to only work with the values contained within these files. When we test your work we will be using completely different data files that are organized in the same way as these sample files. Your program should work flawlessly using this new data. I've broken up this program into smaller tasks that you should attempt one at a time as a group. Do these in order. Task #1 • Begin by asking the user for a course. • Next, open the file class_data.txt for reading and obtain all data from the file. • You'll need to parse this file so you can access the data you care about. Take a look at how the file is being organized: COURSE_NUMBER_1,COURSE_DESCRIPTION_1 • COURSE_NUMBER_2,COURSE_DESCRIPTION_2 • COURSE_NUMBER_2,COURSE_DESCRIPTION_2 • Each line contains information about a course. On each line you have two values to work with - the course number and the course description. These values are separated by commas. • The first step is to isolate the individual lines from one another. • Hint: the split method may be useful here! • After this, you need to examine each line and identify if that line contains the course number that the user typed in. This will require you to isolate the course number from the course description. • Hint: a for loop along with another call to the split method may be useful here! • Store the title somewhere (an accumulator variable?) so you can access it later. • Finally, generate some output to let the user know if (a) the course cannot be found or (b) the course can be found, along with the title. Do this outside of the loop that you used to find the course. Hint: you may need to set a variable to indicate that you found the course, along with the course title to do this. At the end of task #1 your program should operate as follows: Enter a course: pikachu That course is not running this semester Enter a course: CS That course is not running this semester Enter a course: CS0002 The title of this class is: Introduction to Computer Programming Task #2 Next you will need to see how many students are enrolled in the course (if it exists). Here's how to get started: • If the course is running you will need to open up the enrollment_data.txt file and read in the contents of this file as a string. • This file is organized as follows: COURSE_NUMBER,STUDENT_LAST_NAME,STUDENT_FIRST_NAME • COURSE_NUMBER,STUDENT_LAST_NAME,STUDENT_FIRST_NAME • COURSE_NUMBER,STUDENT_LAST_NAME,STUDENT_FIRST_NAME • COURSE_NUMBER,STUDENT_LAST_NAME,STUDENT_FIRST_NAME • Each line contains information about a student. On each line you have three values to work with - the course number, the last name of the student and the first name of the student. These are all separated by commas. • Begin by isolating the individual records from one another (the lines). Then examine each line to see if that line contains a student enrolled in the desired course. • When examining a line of data you will need to further process that line it (to extract the course number and the student name) • If that line contains the course number in question you should make a note of it. Hint: an accumulator list may be useful to store all of the students enrolled in this course. • Finally, after you've finished examining each line you should print out your final report (how many students are enrolled and each of their names) At the end of task #2 your program should operate as follows: NYU Computer Science Registration System Enter a course ID (i.e. CS0002, CS0004): PIKACHU Cannot find this course NYU Computer Science Registration System Enter a course ID (i.e. CS0002, CS0004): CS Cannot find this course NYU Computer Science Registration System Enter a course ID (i.e. CS0002, CS0004): CS0002 The title of this class is: Introduction to Computer Programming The course has 6 students enrolled * Hiner,Judith * Mcmahon,Ludivina * Trusty,Beatrice * Brinn,Jacqulyn * Hintzen,Floria * Amyx,Randolph NYU Computer Science Registration System Enter a course ID (i.e. CS0002, CS0004): CS0004 The title of this class is: Introduction to Web Design and Computer Principles The course has 7 students enrolled * Woodman,Tilda * Schneiderman,Saran * Conn,Glayds * Cales,Edgar * Hiner,Judith * Lukens,Refugio * Alfrey,Jerrica NYU Computer Science Registration System Enter a course ID (i.e. CS0002, CS0004): CS0201 The title of this class is: Computer Systems Organization The course has 0 students enrolled Some hints to get you started: • Ensure that your source code file ('LastnameFirstname_assign9_part1.py') is saved in a folder along with the data files linked above. • Begin by asking the user for a course name. You will need to consult with the 'class_data.txt' file to check to make sure the course is valid, as well as determine the title of the course. This most likely will involve reading the file and examining each line in the file to see if the name on that line matches the name the user supplied. • Hint: How can you isolate each line in the file? What separates each line? How can you break each line apart into a list (split!) • Hint: You will need a loop to examine each line once they have been isolated. Next you will need to identify if the course name matches the user input. What separates each value on this line? You might need to split the line again to isolate these values. • If you find a valid course you will then nee to interface with the 'enrollment_data.txt' file to find all students enrolled in this course. The process for examining this file will be similar to the one you went through for the 'class_data.txt' file. This program should be named as follows: LastNameFirstName_assign9_part0.py (for example, "KappCraig_assign9_part0.py"). You do not need to turn in any of the data files - just turn in your Python source code file. Assignment 9 part 1 Part 1 Note that the programs you will be writing build on one another. You will want to attempt these parts in order. You can also feel free to save all of your work in one big file (call it "LastNameFirstName_assign9_part1.py") You have just been hired by a tech startup that is planning on releasing a new e-mail service to its clients. They have asked you to create a prototype of this service using your Python skills. The final version of this prototype should do the following: • Allow the user to register for a new account. When they register, they will supply a username and password, which will need to be validated. The username will also need to be unique (i.e. only one person can have a given username). If the user registers successfully their information will need to be stored in a permeant storage mechanism (in this case, a file) • The user should also be able to log into their account. This part of the system will ask the user for a username and password and match it up against the one the company has on file for them. Note that the company plans on having millions of clients, so this information must be cross- referenced against a file and cannot be 'hard-coded'. • The user should be able to send messages to any other user on the system. To send a message the system will ask the user for the name of a recipient and a message to send (one line of text). If the recipient is registered the message will be delivered through a file. • The user should be able to read messages that have been sent to them (and only them) • The user should be able to delete all of the messages that have been sent to them (and only them) In order to do this the software engineers at the company have outlined a series of functions that will need to be build to create the prototype. Your job is to build these functions and test them as you go - don't skip ahead! When all of the necessary functions are built you will use them to construct the prototype e-mail system Part 1a Begin by writing functions that conform to the following IPO
Answered Same DayNov 29, 2021

Answer To: Assignment 9 part 0 Part 0 (Warm-Up This program relies on a series of data files. Simply...

Kondalarao answered on Nov 30 2021
116 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here