On This Page
Overview
There are three parts to this assignment:
- Review Exercises:
First make sure you have completed and turned in the exercises from lesson 3. Then complete the Review Exercises in CodeLab 3. These exercises will help prepare you for the problem-solving program and should be completed first.
- Problem Solving Programs:
Complete the programming projects following the Program Specifications listed below.
- Tutorial Exercises:
Complete the Tutorial Exercises in CodeLab 3 before the specified due date. Refer to the assigned reading for the next lesson to help you understand the problems. Also, you can use the online lecture notes for more information as the notes become available. You can look at solutions if you miss your first attempt by clicking the "Solution" tab.
^ top
Program Specifications
General
- Note that you must complete these programs either by yourself or by working with one other student of this class following the rules of Pair Programming for Homework Assignments.
- Remember to follow all the style rules from the last assignments as well as the new rules we covered including:
- Spaces before and after operators. (See: Spacing Around Operators
- Indentation in
if statements and placement of curly braces. (See: Indentation and if-else-if-else Formatting
- No tab characters in your code.
You can remove tab characters by either setting up TextPad correctly (see here) or by running a program named astyle (see here).
- Submit your files to Blackboard as explained in the section of this document: What to Turn In.
Converting Meters to Other Units of Length
- Complete Exercise P2.3 on page 75 of the textbook.
- The name of the source code file for this program must be
length.cpp and all your code must be in this file.
Be careful of the spelling, including capitalization, as you will lose points for a misspelled name.
- Your program must operate like this:
Enter the distance in meters: 10
10 meters is 0.00621371 miles,
or 32.8084 feet
or 393.701 inches.
Playing Card Notations
- Complete Exercise P3.5 on pages 126-127 of the textbook.
- The name of the source code file must be
cards.cpp and all your code must be in this file.
Be careful of the spelling, including capitalization, as you will lose points for a misspelled name.
- Your program must operate as shown in the book. Note that when you enter a card with a rank that is numeric, you must print a number like this:
Enter the card notation: 10C
10 of Clubs
Mad Libs
- Write a program that plays the game of Mad Libs.
- Your program must prompt the user to enter the following information as strings in this order:
- Your first name
- Your instructor's last name
- A food
- A number between 100 and 120
- An adjective
- A color
- An animal
- After the strings are entered, substitute the strings into the following story and output the story to the console:
Dear Instructor [Instructor Name]
I am sorry that I am unable to turn in my homework today. First I ate a rotten [food], which made me turn [color] and extremely ill. I came down with a fever of [number]. Next, my [adjective] pet [animal] must have smelled the remains of the [food] on my homework, because my pet ate my homework.
I knew I should not have ordered that [animal] on eBay!
I know you do not accept late homework but I am hoping you
will make an exception in my case.
Sincerely,
[Your name]
- The program must operate just like the example: madlibs.exe
If you are using a Mac or Linux computer, download and run the example on a classroom computer to see how the program works.
- The name of the source code file must be
madlibs.cpp and all your code must be in this file.
Be careful of the spelling, including capitalization, as you will lose points for a misspelled name.
^ top
Extra Credit
The following are worth extra credit points:
- Complete the assignment using pair programming. (1 point)
- Write another Mad Libs game and save the file as
mymadlibs.cpp. (2 points)
Make certain that your README.txt file describes any extra credit attempted.
^ top
Grading Criteria
The instructor will evaluate your assignment using the following criteria. Each criteria represents a specific achievement of your assignment and has a scoring guide. The scoring guide explains the possible scores you can receive.
Some scoring guides have a list of indicators. These indicators are a sign of meeting, or a symptom of not meeting, the specific criterion. Note that a single indicator may not always be reliable or appropriate in a given context. However, as a group, they show the condition of meeting the criterion.
For information on grading policies, including interpretation of scores, see the course information page.
Lesson Exercises
- 2: All lesson exercises attempted and turned in
- 1: Some lesson exercises completed and turned in
- 0: No lesson exercises completed or turned in
Problem Solving Programs (x3)
- 5: Demonstrates mastery of the program
- Applies concepts from the lessons appropriately
- Meets all specifications (see above)
- Runs to completion with no abnormal error conditions
- Generates correct output given correct input
- Correct file name
- 4: Has most of the functionality expected of the program
- Demonstrates some techniques from the lesson
- Attempts to meet all but one of the specifications (see above)
- Implementation seems more complicated than necessary.
- May have one minor error
- 3: Has some of the functionality expected of the program
- Demonstrates some techniques from the lesson
- Attempts to meet at least 1/2 of the specifications (see above)
- Implementation seems excessively complicated.
- May have 2-3 minor errors
- 2: Serious functional problems but shows some effort and understanding
- Attempts to meet less than 1/2 of the of the specifications (see above)
- Has a major error or many minor errors
- Implementation seems very convoluted
- Demonstrates few techniques from the lesson
- 1: Does not compile or wrong file turned in
- 0: Not turned in
Problem Solving Programs Style
- 3: Code is well-documented including:
- 2: Code has a minor documentation error
- 1: Code has some documentation errors
- 0: No apparent attempt to follow documentation standards or write documentation comments
CodeLab Exercises
- Number CodeLab completed correctly / number exercises * 8 and rounded up to the nearest integer.
README.txt File
- 2:
README.txt file submitted following the instructions
- 1:
README.txt file submitted but some information was missing
- 0: No
README.txt file submitted
Total possible: 30, plus extra credit
^ top
What to Turn In
Submit your assignment to Blackboard, in the assignment folder that matches the name of this assignment, following the instructions for submitting homework. Include the following items for grading:
README.txt file
- All the exercise files from Lesson 3
length.cpp
cards.cpp
madlibs.cpp
- Optionally,
mymadlibs.cpp (extra credit)
You must submit all the files needed to complete your assignment. Your assignment must work as submitted.
^ top
Home
| Blackboard
| Day Schedule
| Eve Schedule
Syllabus
| Help
| FAQ's
| HowTo's
| Links
Last Updated: March 13 2010 @12:12:49
|