CS 140: Computing Languages
University of Nevada, Las Vegas
Course Objectives
After completing this course, you will be able to:
Create programs in the Ruby programming language using sequential, selection, and repetition structures
Utilize object-oriented programming techniques to develop robust programming solutions in the Ruby program-
ming
language
Solve programming tasks by adapting Ruby programming language constructs to a specific solution
Textbooks (Recommended)
Learn to Program (2nd edition), Chris Pine, The Pragmatic Bookshelf, 2013, ISBN-13 9781934356364
The Well-Grounded Rubyist (2nd edition), David A. Black, Manning Publications, 2014, ISBN-13 9781617291692
Schedule of Topics
Ruby Basics
Week 1 Introduction to Command-line Operations & Text Editors Pine, ch. 1
Week 2 Getting Started w/ Ruby, Variables, & Basic Input/Output Pine, ch. 2–5
Week 3 Data Types, Arithmetic Operations, Expressions, & Assignment Pine, ch. 2–5
Selection, Repetition, & Collections
Week 4 Relational Operators, Logical Expressions, & Conditional Statements Pine, ch. 7
Week 5 Looping & Iteration, Arrays, & Hashes Pine, ch. 7–8
Functional Decomposition & Methods
Week 6 Methods, Parameter Passing, & Return Values Pine, ch. 9
Week 7 Methods & Scope Of Variables Pine, ch. 9
Week 8 Review & Mid-Term Exam
Week 9 Methods & Code Blocks Black, ch. 2, 6
Object-Oriented Programming
Week 10 Spring Break Recess
Week 11 Classes & Object-Oriented Programming Black, ch. 2
Week 12 Inheritance, Polymorphism, & Class Methods & Variables Black, ch. 3, 5
Beyond Ruby Basics
Week 13 Modules & Multiple Inheritance Black, ch. 4
Week 14 File Operations & Text Processing Black, ch. 12
Week 15 Error Handling, Exceptions, & Rubygems Black, ch. 6
Week 16 Unit Tests
Final Exam, Mon, May 9, 2016, 3:10–5:10pm, CBC C120
Academic Policies
Assignments Exams
There will be approximately 8-10 assignments
w
orth 40% of overall grade.
There will be a mid-term exam (worth 25%) and a final
exam (worth 35%).
Grade Values
Course grades will be assigned according to the following table (all values will be rounded to the next whole
percentage point, and a maximum curve of 2% will be applied if warranted):
Grade Percent
A 100%—90%
B 89%—80%
C 79%—70%
D 69%—60%
F 59%—0%
Grading Criteria
Each
homework assignment will be worth 100 points. All grades are subject to the discretion of the instructor,
but in general grades will adhere to the following scheme:
All assignments must be turned in on time. Any late assignments are subject to a 10% penalty per day
for each day past the due date. No late assignments will be accepted after the beginning of the class
period following the due date.
All program submissions must be submitted to Moodle via a single file named rebelmailID.rb.
Programming assignments that violate academic integrity standards will be handled in accordance with
the university’s Student Academic Misconduct Policy, located at:
http://studentconduct.unlv.edu/misconduct/policy
.html
Coding style & documentation - 20%
(5 pts) All programs must have the following comment block at the top of their main program file:
#
#
#
#
#
#
#
#
Name: Your name, Class, Assignment number
Partner: Your partner for this assignment (if any)
Description: a brief description of the program
Input: expected input to the program (if any)
Output: expected output of the program (if any)
(5 pts) All programs must utilize proper coding style.
(5 pts) All methods and classes must have the following required documentation immediately above
each
method/class definition:
method_identifier: brief description of what the method does.
parameters: what to pass into the method
return value: what the method returns, if any
2
#
#
#
class_identifier: brief description of the class
public methods: a list of public methods identifiers
instance variables: a list of all public instance variables
(5 pts) All programs must have reasonable comments throughout the progam that adequately convey
what is going on the program (where it is not obvious).
Syntax & general knowledge - 30%
(5 pts) All variables, methods, & classes must have meaningful identfiers.
(5 pts) All programs will refrain from using hard-coded values in the program; use named constants
instead.
Constant identifiers should be meaningfully named and should be in all caps with separate
words using underscores.
(20 pts) Program submissions must contain zero syntax errors and must not generate any exceptions.
Program solution - 50%
(10
pts) You must create reasonable methods/classes for appropriate sections of your program.
(5 pts) Any required output from the program must adhere to the requirements specified in the assign-
ment
handout and must conform to the specified format.
(5 pts) All programs must use all required techniques, data types, and data structures addressed in
each assignment handout.
(30 pts) Any required output must have correct values, and must not have incorrect values.
There will be no make-up exams except as covered under university policies.
Student Collaboration
All students must submit their own work. Apart from formulating an assignment solution by one’s self, acceptable
sources
of problem-solving input are limited to: instructor input, teaching assistant input, in-class examples, class
web site examples, examples from the textbook, and official reference documentation.
Due to the nature of this course, collaboration among students enrolled in the class is allowed on a limited basis,
p
rovided such collaboration adheres to the stipulations in this policy. Student collaboration is defined as two or
more students working together as a group to produce a programming solution. Student collaboration may occur
for a given homework assignment under the following circumstances:
Students enrolled in the class may work in pairs for each assignment on a mutually voluntary basis
No more than two students enrolled in the class may work together for a given assignment
Each student must turn in their own assignment
Each student must indicate the name of their partner, if any, in the comment header section of each
assignment
Each student may work with the same partner for a maximum of three assignments throughout the
semester
Violations
of student collaboration may involve, but are not limited to: working with yet failing to identify a
partner for an assignment, working with the same partner more than three times during the semester, asking
other students to provide solutions for a programming assignment, copying code from other students, distribut-
ing code to other students, or copying, soliciting or distributing programming solutions to or from third-party
sources (online forums or bulletin-boards, outside help from non-students, students from other classes, software
repositories, etc.)
3
Note, this policy does not prohibit or discourage discussion among students involving the material covered in
class. This policy is simply intended to discourage those who are not willing to make an honest effort at learning
the various programming solutions we will encounter during the semester.
The grading policies for this course are designed to take into account the potential for unethical student col-
laboration
should any violations occur. Thus, even if a student successfully violates this student collaboration
policy, does not get caught, and gets perfect marks on his or her programming assignments, that student must
still demonstrate his or her competency to a satisfactory level on the exam portions of the class. This is why the
exams are worth 60% of the class grade. Each student must do his or her own work!
Should the need arise to deal with unethical student collaboration during the semester, the student(s) involved
will be
referred to the Office of Student Conduct under the
Student Academic Misconduct Policy. The general
recommendation in this
course for this policy is for the student to receive a 0 for that assignment for the first
offense and a failing grade for the course for any subsequent offense.
Grading Process
The figure below illustrates the grading process used to apply the listed criteria above in order to arrive at a
grade for
each homework submission:
4
University Policies
The following university policies a
re applicable:
Academic Misconduct—Academic integrity is a legitimate concern for every member of the campus com-
munity; all sha
re in upholding the fundamental values of honesty, trust, respect, fairness, responsibility and
professionalism. By choosing to join the UNLV community, students accept the expectations of the Student
Academic Misconduct Policy and are encouraged when faced with choices to always take the ethical path.
Students enrolling in UNLV assume the obligation to conduct themselves in a manner compatible with UNLVs
function as an educational institution.
An example of academic misconduct is plagiarism. Plagiarism is using the words or ideas of another, from the
Internet or any
source, without proper citation of the sources. See the Student Academic Misconduct Policy
(approved December 9, 2005) located at:
https://www.unlv.edu/studentconduct/student-conduct.
Copyright—The University requires all members of the University Community to familiarize themselves with
and to follow
copyright and fair use requirements. You are individually and solely responsible for violations of
copyright and fair use laws. The university will neither protect nor defend you nor assume any responsibility
for employee or student violations of fair use laws. Violations of copyright laws could subject you to federal
and state civil penalties and criminal liability, as well as disciplinary action under University policies. Additional
information can be found at: http://www.unlv.edu/provost/copyright.
Disability Resource Center (DRC)—The UNLV Disability
Resource Center (SSC-A 143,
http://drc.unlv.edu/,
702-895-0866) provides resources for students with disabilities. If you feel that you have a disability, please
make an appointment with a Disabilities Specialist at the DRC to discuss what options may be available to
you. If you are registered with the UNLV Disability Resource Center, bring your Academic Accommodation
Plan from the DRC to the instructor during office hours so that you may work together to develop strategies
for implementing the accommodations to meet both your needs and the requirements of the course. Any
information you provide is private and will be treated as such. To maintain the confidentiality of your request,
please do not approach the instructor in front of others to discuss your accommodation needs.
Religious Holidays Policy—Any student missing class quizzes, examinations, or any other class or lab work
because of observance
of religious holidays shall be given an opportunity during that semester to make up
missed work. The make-up will apply to the religious holiday absence only. It shall be the responsibility of the
student to notify the instructor no later than the end of the first two weeks of classes of his or her intention
to participate in religious holidays which do not fall on state holidays or periods of class recess. For additional
information, please visit: http://catalog.unlv.edu/content.php?catoid=6&navoid=531.
Incomplete Grades—The grade of Incomplete
(I) can be granted when a student has satisfactorily completed
three-fourths of course work for that semester/session but for reason(s) beyond the student’s control, and
acceptable to the instructor, cannot complete the last part of the course, and the instructor believes that the
student can finish the course without repeating it. The incomplete work must be made up before the end of
the following regular semester for undergraduate courses. Graduate students receiving “I” grades in 500-, 600-,
or 700-level courses have up to one calendar year to complete the work, at the discretion of the instructor. If
course requirements are not completed within the time indicated, a grade of F will be recorded and the GPA
will be adjusted accordingly. Students who are fulfilling an Incomplete do not register for the course but make
individual arrangements with the instructor who assigned the I grade.
Tutoring—The Academic Success Center
(ASC) provides tutoring and academic assistance for all UNLV
students taking UNLV courses. Students are encouraged to stop by the ASC to learn more about subjects
offered, tutoring times and other academic resources. The ASC is located across from the Student Services
Complex (SSC). Students may learn more about tutoring services by calling 702-895- 3177 or visiting the
tutoring web site at:
http://academicsuccess.unlv.edu/tutoring/.
Rebelmail—By policy, faculty
and staff should e-mail students’ Rebelmail accounts only. Rebelmail is UNLV’s
official e-mail system for students. It is one of the primary ways students receive official university commu-
nication such as information about deadlines, major campus events, and announcements. All UNLV students
receive a Rebelmail account after they have been admitted to the university. Students’ e- mail prefixes are
listed on class rosters. The suffix is always @unlv.nevada.edu. Emailing within WebCampus is acceptable.
5
by subject.)
Final Examinations—The University requires that final exams given at the end of a course occur at the time
and
on the day specified in the final exam schedule. See the schedule at: http://www.unlv.edu/registrar/calendars.
Library Resources Students may consult https://www.library.unlv.edu/consultation with a library on
research needs. For this class, the subject librarian is Sue Wainscott
(https://www.library.unlv.edu/contact/librarians
UNLV
Libraries provides resources to support students’ access to information. Access library resources and ask
questions at https://www.library.unlv.edu
Course Communication
Normal class activity will take place on the course web site via the UNLV Moodle Site. The UNLV Moodle Site will be
utilized for assignment postings & submissions, grading, handout information, announcements, and discussion forum
postings. For example, class announcements will be posted in the Discussion Forum area, and assignments will be
posted in the weekly sections of the web site.
Moodle Instructions
Getting Started The
UNLV Moodle Site is located at: http://osserver.cs.unlv.edu/moodle/
Creating An Account Navigate to the UNLV Moodle Site, and in the top right corner click the “Log in” link.
F
ollow the instructions on the right side of the screen. Use your RebelMail information to create your account.
Logging In Navigate to the UNLV Moodle Site, and in the top right corner click the “Log in” link. You will be
taken to the main log in page, where you can input your username and password on the left side of the screen.
Accessing The Course Upon logging in, you’ll be presented with a list of available course; click on the appropriate
course title to view that course’s dashboard. You will need to input an enrolment key the first time you attempt
to access the course, and you will receive the enrolment key during the first week of class.
Using The Discussion Forum The Discussion Forum is the area where students can ask (and answer) questions
rega
rding the course material as well as view class announcements. To access the Discussion Forum, simply click
on the link underneath Announcements, where a page listing all current discussion topics will be displayed.
Each discussion topic may have multiplie replies, so to view the entire discussion, click on the discussion’s title
to
view the original discussion post as well as any replies.
To add a new topic, click on the appropriately labelled “Add a new discussion topic” button at the top of the
main Discussion Forum page, type in the Subject and your Message, and click “Post to forum”.
Downloading Course Content Course content will include homework assignments, selected code examples, and
course information. These files will normally be downloadable from the appropriate week’s section listed on the
main course page. Simply click on the link and select “Save as” (or “Download”) to download and view the file.
Submitting Assignments To submit an assignment, click on the assignment submission link located in the week
the
assignment was posted. This link takes you to a page where you can view your submission status. To add a
new submission, click on the “Add submission” button near the middle of the page and upload your assignment
file. Make sure your file is named according to the grading criteria listed in the syllabus!
Normally an assignment can be submitted up to 3 times, with the most recent submission being the one that
is
graded. To update your submission, navigate to the assignment submission page, and click on the “Edit
submission” button to update the file you originally submitted. You can delete the old file, upload a new file, or
rename your file from within this section.
Viewing Grades To view your current course grade, scroll to the bottom of the menu on the left-hand side of
the
course page, and click on the “Grades” link underneath Course Administration. A summary of your current
course grade is displayed.
To view grades for individual assignments, click on the link to that individual assignment from the Grades view,
and
your assignment grade information will be displayed.
6
Discussion Forum Guidelines
While there are a variety of publicly-available bulletin-board and forum web sites (Stack Overflow, StudyRoom,
etc.), the primary location for such activity is restricted to the UNLV Moodle Site. The Discussion Forum is
there to encourage online discussion for general problem areas and questions over the material covered in class.
This presents a challenge in navigating the necessity of being able to freely discuss the course material while
balancing the requirements of academic integrity standards. Thus, the following guidelines apply for online class
postings in the Discussion Forum area:
Posting code directly from assignments is prohibited, unless that code has already been distributed to the
entire class
Posting general solution steps is prohibited
Asking general questions about how a certain aspect of a program works is allowed
Answering such questions is allowed (and encouraged!)
7