Difference between revisions of "CS 500"

From Computer Science
Jump to: navigation, search
(Announcements/Assignments/Quizzes)
(Prerequisite, CS 500 versus CS 510)
Line 81: Line 81:
  
 
=Prerequisite, CS 500 versus CS 510=
 
=Prerequisite, CS 500 versus CS 510=
The prerequisite for CS 500 is admission to the CS MS program or permission of instructor. You should be a competent programmer in some programming language and have studied data structures and algorithms as a part of some course in the past. If your background in programming and CS is too weak, you should start in CS 510 Intro to Programming and Computer Science rather than CS 500. Also note that CS 500 uses the C programming language, while CS 510 uses the python programming language. CS 510 is meant for those with little or no background in CS, and for those outside of CS wanting to take a CS course. CS 510 is also meant to help students with a weak CS background get ready to pass the CS MS admissions interview and to prepare for CS 500. To assist in deciding whether to start in CS 500 or CS 510, those enrolled in CS 500 will take a quiz the first day of class; this will not be for a grade but just to decide whether to start in CS 510 or not. The quiz will be something like the following.
+
The prerequisite for CS 500 is admission to the CS MS program or permission of instructor. You should be a competent programmer in some programming language and have studied data structures and algorithms as a part of some course in the past. If your background in programming and CS is too weak, you should start in CS 510 Intro to Programming and Computer Science rather than CS 500. Also note that CS 500 uses the C programming language, while CS 510 uses the python programming language. CS 510 is meant for those with little or no background in CS, and for those outside of CS wanting to take a CS course. CS 510 is also meant to help students with a weak CS background get ready to pass the CS MS admissions interview and to prepare for CS 500.  
  
* Quiz to be taken closed notes, no internet, on your own, on paper, and should be complete in about 30 minutes (or 50, we'll see whether 30 minutes seems to be enough or not). Note that programming questions ask for a complete working program in whatever programming language you want (most commonly Python, C, C++, Java,  Javascript, C#, or Swift). "Passing" will be getting at least one of the programming questions completely correct (maybe just a typo or two) and at least one of the data structures / algorithms questions completely correct. That is the minimum standard to be considered ready for this course; if you cannot get even one of the programming problems correct then you definitely are not ready for this course (CS 500 does not teach basic programming and debugging concepts and skills, you should have those already).
+
You can check the CS MS admissions programming quiz to gauge your programming level - https://indstate.instructure.com/courses/12565/quizzes/238564
* '''Programming question, nested loops and logic''': a question where the correct program will use some nesting of loops and conditional logic, and where a correct solution can be done with 10-20 lines of code. 
+
If those questions are not relatively easy for you, then you should start with CS 510 rather than CS 500.
** For example: Write a program that asks the user for a word and prints the word out one letter per line. The program should ask for another word, and print the word one letter per line; the program should keep asking until the user types "quit". You can assume the words are all at most 99 characters.
 
* '''Programming question, use recursion''': a question asking for a recursive solution to some basic problem, where a correct solution can be done with 10-20 lines of code.  
 
** For example: Write a recursive function that computes the product of integers between two values. The function should not use any loops. Your program should ask the user for two integers, call your function to get the product between them, and print the result. For example, if the integers entered were 4 and 8, the program would print 6720. The program should contain no loops. If the user enters the numbers in reverse order (e.g., 10 5) then the result should be 0.
 
* '''Programming question, design functions''': a question asking to create and code a set of functions to solve a given problem, where the best solution will have a few functions and take 10-20 lines total.
 
** For example: Write a program that keeps an array of strings that are meant to be times that an alarm is set to go off. The program will give the user the following choices: (a) print all alarms, (b) add new alarm, (c) select alarm and remove it. Your program should make use of a number of functions that you write for for keeping track of the alarms. You can assume there will be at most 10 alarms stored at any given time, and that each alarm string is at most 99 characters. ''Note - this program gets to be a bit long, so you would only need to give the code for the functions, and would not need to give the main program that gets input from the user and calls the appropriate function.''
 
* '''Data structures question, choose the best''': a question where you are asked which data structure is best for a given task. You will choose between unsorted array, sorted array, doubly linked list, singly linked list, stack, queue, balanced binary search tree, non-balancing binary search tree, and hash table.
 
** For example: Suppose you need a data structure to keep track of all facebook accounts. You need to be able to add, remove, and lookup. You will do a bulk add of all current accounts (assume there are 10 billion), and then will need to do around 1 million of each type of operation per day. Choose a data structure to keep track of this information, and justify your choice. You can let n=10,000,000,000 and m=1,000,000 so you can discuss the big-O asymptotic running times.
 
* '''Data structures question, running time''': a question where you are given some pseudocode using one of the data structures above, or given a particular data structure to analyse, and you are asked to analyse the running time.
 
** For example: Consider the same scenario as above (keeping track of facebook accounts). Suppose you use an ordered array to keep track of the accounts. Letting n=10,000,000,000 and m=1,000,000, what is the big-O asymptotic running time of doing the bulk add of 10 billion accounts, and what is the big-O asymptotic running time of doing the 1,000,000 lookups each day? Justify your answers.
 
  
 
=Assignments=
 
=Assignments=

Revision as of 13:27, 16 January 2024

CS 500 Fundamentals of Programming is taken by CS MS students during their first term in the MS program. The main outcomes of the course are proficiency in C programming and data structures and algorithms.

It is assumed that students starting the course have passed the CS MS admissions process (see Graduate Admissions Interview, in particular those taking the course should be proficient in some programming language). Those who are looking for an introductory programming course should consider CS 510 instead.

This page contains the syllabus for CS 500 for the most recent offering (spring 2024).

General Information

Course website - https://cs.indstate.edu/wiki/index.php/CS_500

Your Instructor

Jeff Kinne, jkinne@cs.indstate.edu
Office: Root Hall A-142 and in Microsoft Teams, phone 812-237-2126
Instructor Office Hours: M 12-2:30pm; TR 9:30am-2:30pm; WF 2-2:30pm

Lecture, Exam

Lecture: MWF 11-11:50am, over Zoom (link in Canvas, see below), and recorded
Mid-term exam: TBA
Final exam: Friday May 10, 10am-noon

Prerequisites - admission to the CS MS program or approval of instructor, should be a competent programmer in some programming language. See section below on CS 500 versus CS 510 for helping to decide if you are ready to take this course, and you can contact the instructor as well.

CRN numbers - 11148 for the 001 face to face section, 11636 for the 301 online section

Required text We will use the following free online sources.


Class notes - Notes during class will mostly be kept in the documents in this OneDrive folder. Note that you will need to authenticate with your ISU account to view the notebook. Programs that we develop during lecture will be available on the CS server here: https://cs.indstate.edu/~cs500/. If you are logged into one of the CS systems in a terminal, you can get to these files by doing: cd ~cs500/public_html/.

Announcements/Assignments/Quizzes

Announcements/Assignments/Quizzes

HW and Labs These are posted in Canvas. HWs are normally due 1 week after being assigned. Labs are normally due two days after assigned.

Quizzes Will normally be taken TBD in Canvas.

Announcements Announcements will normally be posted to the course in Canvas.

Course Description and Content

Course Description

The catalog description for this course is: "Review of undergraduate topics in Computer Science including Data Structures, Computer Architecture, and Computer Organization. Review of a computer programming language that students can expect to use in advanced courses." The two main goals are that you leave the course as proficient C programmers and proficient at using and analyzing the most important data structures and algorithms.

Course Outline

  • Getting started - system setup, git, linux, bash, make, apache, math background, development on your personal computer.
  • C programming basics - operators, reserved words, data types, base systems, overflow.
  • C programming strings - manipulation of C strings.
  • C programming memory management - different types of memory in C, how to use them, pros and cons.
  • C programming style - good programming style for reliability, readability, extensibility, security.
  • Data structures - understanding/use of most important data structures - arrays, linked lists, skip list, binary search trees, red black trees, hash tables, heaps, B tree. Implementation of some of these in C.
  • Algorithms - understanding/use of basic algorithms - sorting (various), binary/linear search (and uses), graph algorithms (basic properties, BFS, DFS, MST, shortest path), strings (edit distance) - including some algorithms that are each of - greedy, dynamic programming, heuristic, randomized, brute force / backtracking.
  • Vocab - additional terms, algorithms, concepts at a shallow level.

Learning Outcomes

  • System setup - personal computer setup for both remote (connecting to CS server with terminal, sftp, X windows) and local development (editor, compiler).
  • Git - basic use of git for source code management.
  • Linux - proficient using the Linux terminal for development.
  • Bash - basic use of bash scripts for testing code.
  • Make - basic use of GNU make for compiling code.
  • Apache - able to post content to your CS accounts to be viewable over the web.
  • Math background - proficient in math background needed for data structures and algorithms.
  • Personal computer - is setup for development so you can do coursework from your home computer as well.
  • C programming - understanding of all language features, proficient in writing code using the most common, write code using good programming style.
  • Data structures - understanding of operations, efficiency, use cases, can write code in C for data structure operations.
  • Algorithms - understanding of basic algorithms, arguments for correctness and efficiency, can use the right algorithms to solve problems efficiently.

Course Policies, Grading

See Jeff Kinne Course Policies for course policies and how your overall letter grade will be determined.

Prerequisite, CS 500 versus CS 510

The prerequisite for CS 500 is admission to the CS MS program or permission of instructor. You should be a competent programmer in some programming language and have studied data structures and algorithms as a part of some course in the past. If your background in programming and CS is too weak, you should start in CS 510 Intro to Programming and Computer Science rather than CS 500. Also note that CS 500 uses the C programming language, while CS 510 uses the python programming language. CS 510 is meant for those with little or no background in CS, and for those outside of CS wanting to take a CS course. CS 510 is also meant to help students with a weak CS background get ready to pass the CS MS admissions interview and to prepare for CS 500.

You can check the CS MS admissions programming quiz to gauge your programming level - https://indstate.instructure.com/courses/12565/quizzes/238564 If those questions are not relatively easy for you, then you should start with CS 510 rather than CS 500.

Assignments

Start Assignments and Quiz Studying Early - I suggest attempting an assignment the day it is given, or the day after, so that if you have a problem you can ask early. If you continue to have problems in trying to complete the assignment, you will have time to ask again. Many of the assignments require thought and problem solving, which takes "time on the calendar" not just "time on the clock". By that I mean that spending an hour on 3 consecutive days is likely to be more productive than trying to spend 3 hours at once on the assignment.

Expected Amount of Work - My expectation is that an average student will spend about 5-10 hours OUTSIDE of class each week (that is in addition to class time or viewing lecture videos) WORKING PRODUCTIVELY/EFFICIENTLY (not just staring at the computer) to complete their coursework for this class. Some students may spend less time than this, and some students will spend more.

This is the foundation for the rest of CS, so it definitely pays off to do your best here.

Note - please find a way to spend enough time on this class (the investment will pay off in terms of skills, being able to get a job, etc.).

Grade Meanings

Letter grades in this course are intended to have the following rough meaning.

  • A+/A: You understand everything and probably could teach the course yourself.
  • B+/A-: You understand nearly everything, and should be all set to use this knowledge in other courses or in a job.
  • C/C+/B-/B: Some things you understand very well and others you don't (more towards the former for a B and more towards the latter for a C).
  • D-/D+/C-: You did put some effort in, and understand many things at a high level, but you haven't mastered the details well enough to be able to use this knowledge in the future. Note that the lowest grade for grad courses is a C, so if you fall in the range below C then your letter grade will be an F.
  • F: Normally, students that get an F simply stopped doing the required work at some point.

The default assignment of letter grades will initially be the usual one (90 is an A-, 80 is a B-, etc.), but these cutoffs will be adjusted down (in your favor). I will adjust these cutoffs and let you know where you stand periodically throughout the term.

CS-Specific Items

This section contains items that are generally the same for all CS courses (and in particular those taught by this instructor).

CS Course Policies

Note that this course follows all standard CS course policies. In particular, (a) cheating/plagiarism by graduate students results in an F in the course, (b) and there will be no makeup exams. See http://cs.indstate.edu/info/policies.html for details.

Lab Help

We have a few lab assistants who are available to help students in beginning computer science courses. Please see https://cs.indstate.edu/wiki/index.php/Unix_Lab_and_Help for details. The lab hours are in a calendar on the CS homepage, at http://cs.indstate.edu/info/index.php#lab_hours. You can join the lab when working on your programs. You can ask the lab assistants to look at your programs, and you can work with any other CS students that are there (you could use the lab as a regular meeting place to work with your classmates).

Course Announcements

Announcements regarding the course will be made both during class and via email to your @sycamores.indstate.edu email address. You should regularly check this email account or have it forwarded to an account that you check regularly. You can set the account to forward by logging into your indstate.edu email online (if you aren't able to find the option, try a different browser or search online for things like - outlook online forward email setting).

Classroom conduct

You may not use cell phones, iPods/music players, etc. during class. You should be civil and respectful to both the instructor and your classmates, and you should arrive to class a few minutes before the scheduled lecture so you are ready for lecture to begin on time. You may use your computer during class if you are using it to follow along with the examples that are being discussed. You should avoid spending time on email, Facebook, work on other courses, etc. during the lecture for this class (be fully present wherever you are, make the most of each experience).

Academic Integrity

See also Jeff Kinne Course Policies for additional information for more specifics about how I am handling these things for this course.

Please follow these guidelines to avoid problems with academic misconduct in this course:

Homework: You may discuss the homework assignments, but should solve and finish them on your own. To make sure you are not violating this, if you discuss with someone, you should DESTROY any work or evidence of the discussion, go your separate ways, SPEND at least an hour doing something completely unrelated to the assignment, and then you should be able to RECREATE the program/solution on your own, then turn that in. If you cannot recreate the solution on your own, then it is not your work, and you should not turn it in.

Note on sources: if you use some other source, the web or whatever, you better cite it! Not doing so is plagiarism.

Exams: This should be clear no cheating during exams. Each instructor has different rules for what is allowed on exams in terms of notes, etc. If not noted otherwise, you should assume that a quiz or exam is closed notes, no computer, no calculator.

Projects: You should not copy from the Internet or anywhere else. The project should be your own work. It will be fairly obvious to me if you do copy code from the Internet, and the consequences will be at the least a 0 on the project. If cheating is observed, you will at the least receive a 0 for the assignment (and may receive an F for the course), and I will file a Notification of Academic Integrity Violation Report with Student Judicial Programs, as required by the university's policy on Academic Integrity. A student who is caught cheating twice (whether in a single course or different courses) is likely to be brought before the All University Court hearing panel, which can impose sanctions up to and including suspension/expulsion. See http://www.indstate.edu/sjp/docs/code.pdf and http://www.indstate.edu/academicintegrity/ for more information.

Please ask the instructor if you have doubts about what is considered cheating in this course.

Office hours (using Teams)

Office hours will be through Microsoft Teams by default. If you would like to meet in person you should reserve an appointment using http://cs.indstate.edu/jkinne-meeting to reserve an in person meeting with Jeff Kinne. I am normally in my office during my listed office hours, but by making an appointment you can be more certain. For meeting through Teams, you should start Teams in your browser or start the application. You should be logged in using your ISU credentials. Once you have Teams open you can message me to ask me questions or to ask to talk. We can use Teams to message (better than emailing back and forth repeatedly if you have questions about something that you just want to write about) or to talk and share screens (e.g., to take a look at your code). I normally have Teams open on my computer all of the time, including during my office hours. During my office hours I will normally reply right away; at other times I will reply when I get a chance.

Canvas

The course has a canvas site. Click https://indstate.instructure.com/ to go to canvas. You should see this course listed under your courses for the current term. If you don't you may need to click on the Courses icon and then click the "All courses" link. The canvas site is used for giving you your grades, for quizzes/exams, and for getting to online lectures (which are done using Zoom). Announcements will be sent through canvas and to your university email. Links and such will be kept on this website.

Lectures (using Zoom)

Here at ISU section numbers starting with the number 3 (e.g.3xx: 301, 302, etc.) are generally online sections. There are 2 types of online sections, synchronous online and asynchronous online. Sections that are synchronous should be joined at the regularly scheduled time of the course, whereas sections that are asynchronous generally keep up with the material independently without regularly scheduled meetings. In general async sections are more difficult to stay on top of, and require a great deal of self-discipline (it is much easier to think "I can watch the videos tomorrow" and just get behind). So if you are in one of these sections make sure you get off to a strong start, and ask for help sooner rather than later. If you are in an online section, check your course schedule for course meeting times; if you have a meeting time, then your section is synchronous, otherwise it is asynchronous (or there is an error in the system).

This course has a 301 section (synchronous online) and 001 section (face to face). Students in either section can participate in whatever way you need to.

For ISU's links to information on getting started with Zoom, see https://indstate.teamdynamix.com/TDClient/1851/Portal/KB/ArticleDet?ID=107534. You can also see the information linked at https://www.indstate.edu/services/student-success/cfss. You will get to the lectures for this course by going to Canvas, select this course, click Modules on the menu on the left, and click on the Zoom module. Once there you should see a schedule of lectures and be able to view recorded lectures. Note that you should install the Zoom application for your computer, and you will need to be logged into to Zoom with your ISU credentials to be able to connect. Also note that the lectures are recorded and only available to those in our class. Recorded lectures normally appear later the same day as the lecture.

Note that if you have not used Zoom with your ISU account previously, you need to go to https://indstate-edu.zoom.us and login with your ISU email address and password to get it setup.

Participating online

If you are participating online, please see the information at https://www.indstate.edu/services/student-success/cfss about participating in online courses. You are expected to either join lectures live through Zoom or watch the recordings once they are available. You will complete assignments, quizzes, and exams on the same schedule as the rest of the class.

For quizzes, I will try to find a time each week that works for everyone to take the quizzes at the same time. The mid-term will be scheduled when it gets closer.

For attendance when you are not in the room... If joining by zoom, you need to post a comment in the chat to say if you have any questions about the current assignments, reading, the last lecture, etc. If watching the lecture later, you need to watch it before the next lecture and send me a message by Teams or email saying if you have any questions or want any more examples about a particular topic. So, if not in the room, you have to participate at least as much as "no questions from me right now" to get credit for attendance. Also, if joining by zoom, please set a profile picture so that I will see a picture of you in the list of zoom participants (like mine); or leave your video on - in either case, so I can associate a face with the name; if you have a good reason to not do either of these let me know.

ISU Required Syllabus Items

The items in this section are required and are the same for every ISU course.

COVID-19 Information

Information specific to CS courses - Start of Term Announcements

Standard ISU language required in all syllabi (read this all once, then skim for your other courses)...

Students are expected to adhere to course attendance policies, as stated in the course syllabus. Documented COVID-related absences will be treated like any other serious medical issue. Following University policy, students with a documented, serious medical issue must contact the Office of the Dean of Students for assistance. The Office of the Dean of Students will supply documentation for faculty. Students with a documented serious medical issue should not be penalized and will be given a reasonable chance to complete exams or assignments. Once notification is made, faculty will make reasonable efforts to accommodate the student’s absence and will communicate that accommodation directly to the student. Please note that faculty are not required to accommodate a serious medical issue with virtual content options, like streaming or recorded lectures. To avoid the potential of missing significant class time, students are strongly encouraged to receive the COVID vaccination that has been made available on campus. For more information about the vaccines or to find a vaccination site, go to: https://ourshot.in.gov. The ISU Health Center also administers COVID-19 vaccines by appointment.

Students should contact the Office of the Dean of Students with questions by calling 812-237-3829.

The information provided in this section of the syllabus is subject to modification based on guidance by public health authorities. Changes to Covid-related policies or updated information will, as always, be posted on the ISU website and communicated in multiple ways.

Special Needs / Disability Services

Standard ISU language required in all syllabi...

Indiana State University recognizes that students with disabilities may have special needs that must be met to give them equal access to college programs and facilities. If you need course adaptations or accommodations because of a disability, please contact us as soon as possible in a confidential setting either after class or in my office. All conversations regarding your disability will be kept in strict confidence. Indiana State University's Student Support Services (SSS) office coordinates services for students with disabilities: documentation of a disability needs to be on file in that office before any accommodations can be provided. Student Support Services is located on the lower level of Normal Hall in the Center for Student Success and can be contacted at 812-237-2700, or you can visit the ISU website under A-Z, Disability Student Services and submit a Contact Form. Appointments to discuss accommodations with SSS staff members are encouraged.

Once a faculty member is notified by Student Support Services that a student is qualified to receive academic accommodations, a faculty member is obligated to provide or allow a reasonable classroom accommodation under ADA.

Disclosures Regarding Sexual Misconduct

Standard ISU language required in all syllabi...

Indiana State University Policy 923 strictly prohibits discrimination on the basis of: age, disability, genetic information, national origin, pregnancy, race/color, religion, sex, gender identity or expression, sexual orientation, veteran status, or any other class protected by federal and state statutes in ISU programs and activities or that interferes with the educational or workplace environment.

Title IX of the Educational Amendments of 1972 prohibits discrimination based on sex, including sexual harassment. Sexual harassment includes quid pro quo harassment, unwelcome verbal or physical conduct, sexual assault, dating violence, domestic violence, and stalking.

If you witness or experience any forms of the above discrimination, you may report to:

Office: Equal Opportunity & Title IX; (812) 237-8954; Rankin Hall, Room 426
Email: ISU-equalopportunity-titleix@mail.indstate.edu
Online: https://cm.maxient.com/reportingform.php?IndianaStateUniv&layout_id=10

Disclosures made to the following confidential campus resources will not be reported to the Office of Equal Opportunity and Title IX:
ISU Student Counseling Center: (812) 237-3939; Gillum Hall, 2nd Floor
Victim Advocate: (812) 237-3829; HMSU 7th Floor
UAP Clinic/ISU Health Center: (812) 237-3883; 567 N. 5th Street

Assignments and Exams

Midterm Exam

Some sample questions...

  • Which part of memory would each of the arrays be contained in?
int array1[100];
int main(int argc, char *argv[]) {
  int array2[100];
  int *array3 = (int *)malloc(sizeof(int)*100);
  return 0;
}
  • Which part of memory (stack, data/globals, or heap) is most restricted in how large it can be, and what is a rough estimate?
  • Which part of memory contains the call stack (to keep track of which functions are currently running)?
  • Which part of memory contains local variables?
  • Give C code to demonstrate the error of a buffer overflow for an array declared in BLANK.
  • Give C code to demonstrate the error of using an uninitialized heap pointer.
  • Give C code to demonstrate other errors.
  • Give C code to declare an array of type BLANK that is contained in BLANK part of memory.
  • Give C code to define a structure that is called point_t and contains: double precision floating point values for x, y, and z coordinates, and a label that is a C string.
  • Give C code for a function prototype for a function named BLANK that has BLANK parameters and returns BLANK.
  • Give C code for a function that takes an array of BLANK and does BLANK to the array.
  • Give C code for a function that takes pointers to type BLANK and does BLANK to them.
  • Take h6a/for_loop.c and change it so it runs the is_prime function on any command-line arguments.
  • (Related to h6b) - Give a complete C program to take a filename as command-line argument, take an additional character as command-line argument, read the entire file and output how many times the character occurs in the file. Note - your program should work on any type of file (does not need to be text).
  • (Related to h6c) - Give a complete C program to read a file and print it out with the lines in reverse order. If a command-line argument is given, it is the filename to open; if no argument is given, the program should use stdin (read until EOF, store the lines, then print them in reverse order). You can assume the file will be at most 1000 lines; your program should work regardless of how long the lines will be.
  • (Related to h6d) - Give a complete C program to take a hex command-line argument, print how many bits are in the binary representation, and print the hex representation that would result from flipping all of the bits.
  • (Related to h7a) - Give a complete C program that is a curses program that prints an additional '.' character each second, pauses/unpauses this if the 'p' key is pressed, and stops if the 'q' key is pressed.