In this
lesson:
You will learn how to do arithmetic calculations.
You will learn what Mod means and how to use it.
You will learn about the functions, and how to use them.
1. Print and read the lesson.
(Punch, staple, put in your binder.)
2. Run each of the demos, flowcharts or other materials
from the lesson.
Drill on MOD, Drill
on Operators, Drill on
order of operations
3. Write each of the programs in the lesson. To get the
most out of these programs
- Following the instructions, get the program to work.
- Experiment with it: make little changes and see what happens, make
sure you understand it.
- Erase it - now try to write it without looking at your notes!
4. All of the programs from the lesson are in an executable
zip file. When you click on this link, save the zip file to your disk.
Double click on the EXE file and unzip all of the files to a directory created
for this lesson. Program: Taxes
Compare the code in the programs to the ones you wrote.
Code from lesson 6: 1, 2, 3, 4, 5, 6, 7
5. Do the self test questions and check your answers.
6. Using the sample programs as a model, write a completely
new program that uses the same techniques.
- Indent each statement inside a block about 2 spaces. All of the
statements should line up.
- Use good variable names and comments: if you look at the program
in a year, will you know what the program does?
Programming Exercise:
Create the program below:
- Two scroll bars are used to select a numerator and denominator.(Make sure
the denominator cannot be 0!)
- When either value changes display both the value as a fraction, the decimal
value and the remainder.
Example: the numerator is 3, the denominator is 4. Display
3/4, 0.75, and the remainder 3
(3 divided by 4 is 0 with a remainder of 3)
Use your imagination to create a useful application!
|