Assignments will appear before class. (If you have any suggestions
about how to do this better, email them to me at bartlett@umich.edu)
- Sept. 7 (due Sept. 12 at the beginning of class)
- Read Chapter 1 and Chapter 2, section 5 (2.5)
- Take the online quiz at
http://scis.athabascau.ca/html/courses/comp200n/comp_literacy200.htm
- Chapter 1 doesn't have answers to some of the questions -
I know that, so you don't have to worry about it.
- Ignore all the stuff above question 1.
- For each question, click in the circle next to the correct answer.
- When you have answered all the questions, click on the
"Submit Quiz" button at the bottom of the page.
- Your score will be at the bottom of the page that pops up.
- email me (bartlett@umich.edu) your score from the email account
you want to receive emails from me.
- On paper, write a program like the one in DISPLAY 1.8, that takes
2 numbers from the user and computes and displays the sum of the numbers.
Be sure to use good style!
- Lab assignment Sept. 12 (due Sept. 12 at the end of class)
The purpose of this assignment is to show you how stupid the computer
is, and how careful you have to be when writing programs.
If you want to, you may work in a group with one or 2 others. However,
each of you must hand in your own work.
- Pleez rite yer name on PaPer that proF bartleTT has. be4 class starts
fi u get there. oN time or as sun as you Kan;
- Together we will enter the program on p 21 in the text, using the style
required by the course.
- Type in the program you wrote for homework. Make sure it runs correctly
and is written using the required style. On the back of your homework paper,
keep track of the errors you make and the message the computer gives you.
- Draw a line after the last error from the previous step (or get a new
piece of paper). Experiment on the program we entered in 2. Torture it
and see if the compiler gives you any messages.
Describe each torture and write the message the compiler gives you.
Hand in before you leave:
- Your homework due today with the compiler error messages.
- Printout of your homework program you wrote that you typed in, compiled and ran.
- Sept. 14 (due Sept. 19 at the beginning of class)
- Read Chapter 2 and Appendix 2 (pp. 976-977)
- Do Programming Project 10 on page 107.
Be sure to use good style!
Email me your debugged code at sbartle1@emich.edu
- Lab assignment Sept. 19 (due Sept. 19 at the end of class)
The purpose of this lab is to practice using if statements to
do error checking.
You can help each other with compiler errors, but write your
code yourself.
- Hand in your homework due today.
- Type in the program in DISPLAY 2.3 on page 65 of your text.
- Add a header comment and format the program using the class style.
- Add code to do error checking.
- What error checking needs to be done?
- What should the program do if there is an error in the input?
- Use an if/else statement to implement your error checking.
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
- Lab assignment Sept. 26 (due Sept. 26 at the end of class)
The purpose of this lab is to practice using if statements.
Write a program that
- lets the user choose one of at least 4 math operators
(you can implement more for extra credit)
- and then enter 2 numbers to use the operator on.
(the type is your design decision)
- Include appropriate prompts.
- Display the results of the math operation with appropriate
explanatory text.
You can help each other with compiler errors, but write your
code yourself.
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
- Sept. 28 (due Oct. 3 at the beginning of class)
- Read Chapter 3
- Do Programming Project 1 on page 171 and make a hardcopy of your program.
We will have a demo of the programs the first half hour of lab
on Oct. 3. Everyone will vote on the program they like best.
The program that gets the most votes gets 10 extra credit points.
The runner up gets 5.
Be sure to use good style!
- Lab assignment Oct. 3 (due Oct. 3 at the end of class)
There are 2 purposes for this lab.
- Show you that messages to the user are important by having other people
use your program.
- Learn about for loops and get some practice using them.
What to do in the lab:
- Open Visual C++ with your homework assignment and start it up.
- Get a piece of paper and tear it in half.
On one half write your name and leave it on your keyboard.
Use the other half for evaluating other people's programs.
Write the name of the person who wrote each program and notes
about the program so you will know whom to vote for. (This part will
count as a quiz - you get one point for each program you try out, up
to 6 points.)
- After 30-45 minutes (depending on how much fun everyone is having)
circle the name of the person you think had the best program on your
quiz sheet and hand it in to me.
- listen to me explain the for loop.
- Write a program that uses for loops to output the following:
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12
-10 -5 0 5 10 20
A B C D E F G
Z X V T R P N
1.2 1.3 1.4 1.5 1.6
Your Name
YourName
Your Name
Your Name
- Oct. 5 (due Oct. 10 at the beginning of class)
- Read Chapter 3.4 and 7.1
- Do Programming Project 6 on page 173 and make a hardcopy of your program.
If you don't know what complex numbers are, read this, see the
C++ tutor, and/or go to the Math Tutor Lab in 221 Pray-Herrold.
Be sure to use good style!
- Lab assignment Oct. 10 (due Oct. 10 at the end of class)
The purpose of this lab is to practice using loops and switch statements.
Write a "Chinese Horoscope" program that
- Contains at least one switch statement.
- Asks the user's name.
- Asks the user, by name, whose Chinese Horoscope they want to see.
- Asks the user, in what year that person was born.
- Tells the user what aninmal corresponds to that birth year.
- Uses the random number generator to print out one of 4 different horoscopes for that year.
- Let the user do it again, if they want to.
The Chinese characterize each year by one of 12 animals: Rat, Ox, Tiger, Rabbit,
Dragon, Snake, Horse, Sheep, Monkey, Rooster, Dog, and Pig, in this order.
1900 was the
Year of the Rat.
To use the random number generator, you must
- #include <math.h>
(This contains a lot of cool functions like sin, cos, sqrt, pow, etc.)
- declare a variable, with a meaningful name, of type int to hold the random number
- call the function
my_really_fav_random_number = rand();
This gives you a random number between 0 and at least 32,768.
- if you want a random number between 0 and 9, do this:
my_really_fav_random_number = rand() % 10;
- if you want a random number between 1 and 10, do this:
my_really_fav_random_number = rand() % 10 + 1;
You can help each other with compiler errors, but write your
code yourself.
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
- Oct. 12 (due Oct. 17 at the beginning of class)
- Read Chapter 4
- Write a program that takes 10 numbers from the user and stores them in an array.
Then, using one for loop, compute the minimum, the maximum, the sum, and the product of all the
numbers, and output the results to the user. Let the user do it any number of times.
Be sure to use good style!
HINT: It will be easier to debug if you write it for 4 numbers and then change it
to 10 to hand in.
Hand in hardcopy of your debugged, properly styled program.
- Lab assignment Oct. 17 (due Oct. 17 at the end of class)
The purpose of this lab is to practice writing programs that solve math problems.
Write a program that
- lets the user choose one of these 6 "math accessories" using floating point numbers.
(you can implement more for extra credit)
- Miles per gallon calculator.
- Fahrenheit to Celcius calculator.
- Area of a circle calculator.
- Hypotenuse of a right triangle calculator.
- Distance travelled, given the initial velocity, the acceleration, and the time.
- pH, given the concentration of H+
- lets the user do another one,
- includes appropriate prompts, including the units to use,
- displays the results with appropriate explanatory text and proper units,
- does appropriate error checking.
You can help each other with compiler errors, but write your
code yourself.
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
Second exam Oct. 26, 2006
- Oct. 19 (due Oct. 24 at the beginning of class)
- Read Chapters 1 - 4.2 and 7.1 (Study for the exam on Oct. 26)
- Write a program that creates random 3 letter words like bat, cot, etc.,
where the first letter is a random consonent, the second is a random vowel, and the third is
a random consonent. Let the user decide how many random words to show. Let the user
get lists of random words as many times as desired.
The person with the fewest statements in their program, not counting prompts and
explanatory text, gets 10 extra points.
HINT - using arrays will help make your code short.
Be sure to use good style!
- On the back of your program, tell me how many "real" 3 letters words it made in 3 different 10 word lists.
for (int i = 0; i < 3; i++)
{
- Run the program and make 10 words
- Count how many words are actually in the English language.
- Write that number on the back of the hardcopy of your code, with appropriate explanatory text.
} // for
Hand in hardcopy of your debugged, properly styled program.
- Lab assignment Oct. 24 (due Oct. 24 at the end of class)
The purpose of this lab is to practice writing embedded loops and ifs.
Write a program that prints out
multiplication tables for the user and
- lets the user choose which row to start with and which row to end with,
- lets the user choose how many items in each row,
- lets the user do it again,
- displays the results with appropriate explanatory text, and
- does appropriate error checking.
You can help each other with compiler errors, but write your
code yourself.
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
- Oct. 26 - Exam 2
Read Chapter 4
- Lab assignment Oct. 31 (due Oct. 31 at the end of class)
The purpose of this lab is to practice writing functions.
Write a Halloween program that prints out as many random Halloweenish thangs as
the user wants to see. Let them do it as many times as they want.
The program should
- get the user's name,
- let the user choose how many Halloween thangs they want to see,
- let the user do it again,
- have a function to print the program description
- have a function that returns a random scary noise (like "BOOOO" or "Screeeeech")
to print out (Have at least 5 noises)
- have a function that draws a piece of Halloween ASCII art (you can use one from
here or make one up)
- have a function that returns a random Halloween phrase (like "Trick or Treat" or
"gimme candy!") to be used with the user's name (like Fred, gimme candy!) (Have at least 5 phrases)
- does appropriate error checking.
Useful functions for this program
- system("pause");
The computer waits until the user hits enter to continue.
- srand((unsigned)time(NULL));
Put this once at the beginning of your program.
It starts the random number generator in a different place every time.
You will need to #include <time.h> to use the time function.
You can help each other with compiler errors, but write your
code yourself.
Hand in before you leave:
Hardcopy of your debugged, properly styled program,
with your major written on the back.
- Nov. 2 (due Voting Day at the beginning of class)
- Read Chapter 5
- Write the header and the list of jobs for 2 possible projects. Only
hand in one copy, but put all the group members' names at the top.
- Lab assignment Voting Day (due Voting Day at the end of class)
The purpose of this lab is to get more practice writing functions.
- On a piece of paper, write a list of all the jobs Programming Project 9 on page 244 must do.
- Write the program for Programming Project 9 on page 244
You can help each other with compiler errors, but write your
code yourself.
Hand in before you leave:
Hardcopy of your debugged, properly styled program,
with the list of jobs.
- Nov. 9 (due Nov. 14 at the beginning of class)
- Read Chapter 6.1 - 6.3 and add input from a file (or files) to your project. (Anything
the user enters at the keyboard can be read from a file.)
- Write a more detailed job list for your project - include every little thing!
- Design functions to do the jobs on the expanded job list for your project.
- Each person in the group must write a different function definition and a driver
to test it.
Bring the following to lab on Tuesday, Nov. 14:
- Expanded job list - one per group
- Hardcopy of your function and driver - one per person
- Electronic copy of the function - your group will put all the functions together in lab.
- Lab assignment Nov. 14 (due Nov. 14 at the end of class)
The purpose of this lab is to get more practice writing and using functions.
- You have 20 min to take this quiz. Work alone and no talking
until the 20 minutes are up.
- Get together with your group and put all the functions you wrote into one program with
the header you wrote for your program. Debug it and hand it in.
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
- Nov. 16 (due Nov. 21 at the beginning of class)
- Read Chapter 8 and add file I/O to your project
- Write at least one function or block of code in main() that
does file I/O.
On Nov. 21, hand in one copy of your entire project with everyone's name on it
At the beginning of class - the Exam will take the entire time!
Include a copy of the file that your program reads or writes.
- Nov. 21 - Exam 3 in lab
- Nov. 23 - Thanksgiving
- Lab assignment Nov. 28 (due Nov. 28 at the end of class)
The purpose of this lab is to practice using strings
Write a program that uses 25 different string and character thangs that I talked
about today.
- try my examples - 2 points extra credit for every mistake in the examples that you find
- write an example of your own
Hand in before you leave:
Hardcopy of your debugged, properly styled program.
- Nov. 30 (due Dec. 5 at the beginning of class)
- Read Chapter 9
- Add string related bad data checking to your project
- Lab assignment Dec. 5 (due Dec. 5 at the end of class)
Work on your project.
- Dec. 7
- Finish your project
- Study for the exam (Chapters 1-10)
- Lab assignment Dec. 12 (due Dec. 12 at the end of class)
Guests will be arriving after 2:30pm.
- Install your project on 4 computers. (They don't need to be next to each other.)
- Run every other project and fill out an evaluation form for each one.
(Do not do this with your group - do it on your own.)
Hand in before you leave:
- One evaluation of each of the projects, not including your own.
- The source code of your project.
- Dec 14 - FINAL EXAM - 1:30 -3:00pm in lecture room.