T/Th
19:25 – 22:00 Yokosuka Term III (02-03)
Instructor:
Robert Shields (rcshields@ad.umuc.edu) Office
Hours: Before classes and by appointments.
Course
Description: The first
in a sequence of courses in C++. (Taking CMIS 140 and 240 in consecutive
semesters is recommended.) This course is a study of structured programming
using the C++ language. Algorithms and simple data structures are developed and
implemented in C++. The discipline, methodologies, and techniques of software
development are covered. Object-oriented concepts such as classes and
encapsulation are introduced.
Prerequisites:
CMIS 102 or equivalent
knowledge. (Not open to students who have completed CMIS 315.) The student must
feel comfortable working with the materials from Chapters 1—6 of the textbook
listed in the Course Materials.
Course
Objectives: On
successful completion of this course, a student should be able to
·
Understand
the basic syntax and semantics of the C++ programming language
·
Describe
all the steps necessary to develop a working C++ program from a problem
description
·
Apply
design techniques, such as top-down design, to reduce complex problems by
dividing them into component modules that can be implemented as C++ functions
·
Write clear
program documentation
·
Write and
debug C++ programs to implement applications using:
a)
if-else and
switch flow control structures
b) while, do-while, and for loop control
structures
c)
functions
with parameters and return values
d) external disk file input and output
e)
user-defined
data types
f)
structured
data types such as arrays, structures, and classes
·
Understand
the ethics and responsibilities centered around the computing professional
particularly in the areas of software piracy, data privacy and the use of computer
resources
Course
Materials/TextBooks: Simple Program
Design, Robertson, ISBN 61901590X
·
Programming
and Problem Solving with C++,
3rd Ed., Dale, Weems, and Headington, ISBN 0763721034.
·
Microsoft’s
Visual C++ 6.0. (the Dale textbook includes a FREE copy of the Visual C++ 6.0 if
you buy it from UMUC)
Exams: tests or
quizzes may contain
multiple-choice questions, short-answer questions, and short coding problems.
Programming
Assignments: (the
assignments are subject to change)
·
Program #1:
To review the use of logical expressions, arithmetic expressions, looping and
standard I/O.
·
Program #2:
To write and call functions.
·
Program #3:
To use arrays and to use file I/O.
·
Program #4:
To write and use classes.
Note that
·
Late
homework or programs are subject to a 30% deduction because I provide
solutions.
·
The
programs must be done completely on your own.
·
Any and
all copies of
plagiarized or copied programs will receive 0 points!
Exercises: cover the basic concepts discussed in the
textbook. Completing them will prepare you well for the exams. They include
questions similar to or from the end of chapter Exercises.
Grades: Exams – 60%;
Programs – 33%; Homework – 7% = 100% Total. There is no “extra” credit.
I will assign grades as follows: A = 90 -100%; B = 80-89%; C = 70-79%; D = 60-69%; F = 0-59%
Program
Requirements: To receive full credit, you must meet
these requirements for all program and group assignments:
1. Coding and Documentation
A. Avoid excessive comments by using meaningful variable names.
B. Add comments to your code to describe and delimit blocks of code that have different functional purposes.
C. Avoid literals by using named constants.
D. Use consistent indentation (4 spaces) as necessary.
E. In comments at the top of your program, provide all the following information in this order:
/*AUTHOR(s): Harry Potter, Hermione Gringold, and X. Weasley
COURSE: CMIS140
Group Exercise: #1
PURPOSE: provide a brief overall functional description describing what your program does but not how it does it
LIMITATIONS: may include such lacking features as error checking, or that a program only works for certain types of data such as grades 0-100. A limitation, then, is anything you would want to improve upon if given more time. */
2. Grading: Code will be graded for correct output, meeting all requirements, ease of reading, and overall presentation.
3. What to hand in (or email to me) for this and all other assignments:
A. diskette containing your program source code (email just the text contained in the cpp file)
B. program listing (i.e., printed listing of source code)
C. printed program output
Tentative Course Schedule:
(The schedule is
subject to change.) |
Complete reading & assignment by start of class |
|||
Week |
Topic |
Chap. |
Assignments Due |
|
1 |
Assessment Quiz; and review: |
1,2,3,4,5,6 |
|
|
2 |
Functions |
7 |
Tues:
Exercise 2: exam prep. exercises |
|
3 |
Scope, Lifetime, and more Functions |
8 |
Tues: Ex. 3:
exam prep. exercises |
|
4 |
Additional control structures and review |
9 |
Tues: Ex. 4:
exam prep. exercises |
|
5 |
Simple data types: built-in and
user-defined |
10 |
Tues: Ex. 5:
exam prep. exercises |
|
6 |
Structured data types, abstraction and
classes |
11 |
Tues: Ex. 6:
exam prep. exercises |
|
7 |
One dimensional arrays |
12.1-3 |
Tues: Ex. 7:
exam prep. exercises |
|
8 |
Object Oriented Software Development:
Objects |
14.1-4 |
Tues: Ex. 8:
exam prep. Exer. (optional) |
|
Program #1 - Basic Flow Control
1. Educational Purpose: To review the use of logical expressions, while loops, and library functions. If you are unable to do this program, you should take CMIS 102 first and take CMIS140 later.
2. The Problem: Write a program that prompts the user to enter the coefficients a, b, and c of a quadratic equation : ax2 + bx + c = 0 then prints out its roots to 3 decimal places.
3. More Details: Determine the roots (root1 and root2) of the equation using the quadratic formulas shown in chapter 5, Programming warm up exercise #11 of our textbook.
After each calculation, your program should ask the user if he or she wishes to continue. The program continues to another calculation if the user enters 'Y' or 'y' and quits if the user enters 'N' or 'n'.
You will need to use the sqrt(nbr) library function discussed in chapter 2 of the text.
4. Error Checking: Do not attempt to calculate x1 and x2 if the discriminant, b2 - 4ac, is less than zero. In this case, the roots of the equation are imaginary. If the discriminant is negative, then use x1 = Imaginary, x2 = Imaginary
5. Input data: test input of a=1, b=4, c=3. Also create input data that will cause the denominator to be zero, to demonstrate an error message. Design your test cases with care and based on your algorithm.
6. Output: The first 80-character line on your output should consist of:
· your name, left-justified · "CMIS140: Program #1", centered · the due date (mm/dd/yy) for the assignment, right-justified
Each entry in the body of your output should have the following format:
Quadratic Calculator
=============
Enter quadratic coefficients a, b, and c: <User enters, for example: 22.4
5.8 3.6>
The roots of the equation are: root1 = <answer>, root2 = <answer>
Do you want to continue (Y or N)?
________________________________________________________________________________________________
ACADEMIC POLICIES: UMUC policies discuss your
rights and responsibilities regarding such issues as Attendance, Religious
Observances, Examinations, Writing and Mathematics, Plagiarism, and Disabled
Students. See the policies at http://www.ad.umuc.edu/gen/disc/acadpoli.html.
UMUC – Asian Division Student Resources include the Catalog, the Student
Handbook, and Library Resources. The URL describing this material is
http://www.ad.umuc.edu/docs/welcome.html. Please read the about Plagiarism in
the Academic Policies section and Grades & Grading Systems in the Student
Records & Grades section of the Catalog.
Students
who violate UMUC's policy on Academic Dishonesty and Plagiarism will receive a
zero on the assignment in question; further violations of the policy will
result in referral to the Dean's office for further administrative action. The
grade of I (Incomplete) is only given in extraordinary circumstances. Students
requesting an I must have completed at least 60 percent of the course work and
hold a C average.
ATTENDANCE: I expect you to attend
every class on time. If you come to class late, it is your responsibility to
make sure that you have not been marked as absent. Excessive absences may
result in the assignment of the grade F--failure for nonattendance. You are
responsible for anything that is covered in class even if you are not present.
It is wise to arrange with another student to take notes when you might be
absent.
PARTICIPATION
IN CLASS: To
be properly prepared, read each of the assigned chapters and do the assignment
before the class begins. In class, you may be asked to complete exercise
sheets, to look up things on the Internet, to create some web pages. These
exercises are meant to help you learn what you need in this course. Do not skip
class to work on assignments.
EXAMS:
Each examination or test may be a combination of short answer, fill-in the
blank, multiple choice, essay questions, and problems. Be able to discuss and
apply assigned reading materials. Complete assignments and projects to best
prepare for the examinations.
MAKEUP
WORK: If you
miss a test or examination you must submit official documentation stating the
reason for the absence before a make-up examination will be given. Only illness,
TDY, extra duty, or emergencies are valid reasons for missing a scheduled
examination. You must provide documentation showing the reason for the absence;
otherwise, late work is subject to a 30% penalty. If you need to take a test or
exam either earlier or later than its scheduled date (due to some work related
activity), you must contact me immediately to arrange this. You must take the
makeup test or exam within one week of your return to class.
UMUC Databases: The University subscribes to
several on-line library databases that students, faculty, and staff may access
via the WWW. see: http://www.umuc.edu/library/ols.html. Log in with your Social
Security number. As a student of UMUC you may order up to 10 articles per term
(that are not full text). See the Web Databases/MdUSA FAQ or contact a UMUC
reference librarian at umuc-reference@info.umuc.edu.