Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

University of Maryland Baltimore County Create a Program Code Python Coding Task

University of Maryland Baltimore County Create a Program Code Python Coding Task

University of Maryland Baltimore County Create a Program Code Python Coding Task

Description

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 

username: snp379

password: Manu1022

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 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

 

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20