3C PROGRAMSExcellence (6 points): Complete One2K2One, TempConvert, and TempGuess within 50 hours, meeting all program standards.
Advanced (5 points): Complete One2K2One and TempConvert within 50 hours, and TempGuess by the end of Cycle 3, meeting all program standards. Proficient (4 points): Complete One2K2One and TempConvert by the end of Cycle 3, meeting all program standards. Basic (3 points): Complete One2K2One by the end of Cycle 3, and have TempConvert finished but not functioning. Below Basic (2 points): Complete One2K2One by the end of Cycle 3. |
|
One2K2One
(one to one-thousand to one)
Write a program that writes the numbers from 1 to 1000 in order, and then backwards down to one. In this program:
(one to one-thousand to one)
Write a program that writes the numbers from 1 to 1000 in order, and then backwards down to one. In this program:
- There are no inputs from the user.
- There should be one variable.
- There should be ten numbers per line, each with a field width of 8 so no numbers run together. Because the default field width of the window is 80, you will automatically get ten numbers per line! Hint: write instead of writeln.
- There must be at least one FOR…TO…DO loop.
TempConvert
Write a program that will produce a table that shows corresponding temperatures in Fahrenheit and Celsius.
Ask the user if they would like to convert Fahrenheit temperatures to Celsius, or vice versa. Let the user enter the minimum and maximum values for the table.
The table should show all whole number values of the original temperature scale, and show the other temperature to the nearest tenth of a degree.
Keep in mind that a very large range may cause more lines than are available in the window (300 lines scrollable). Please ensure that your table can handle at least from boiling to freezing in both scales.
The conversion formulas are as follows (careful with parentheses!):
°C = 5/9 * (°F – 32)
°F = 9/5 * °C + 32
TEST DATA: Here is are the first and last lines of the output table you should have, as well as one random line in the middle. The ellipsis (...) means a break in the table.
INPUTS
User chooses Fahrenheit ➪ Celsius
Minimum: 25
Maximum: 85
OUTPUTS
F C
25 -3.9
.... ....
59 15.0
.... ....
85 29.4
INPUTS
User chooses Celsius ➪ Fahrenheit
Minimum: -64
Maximum: 80
OUTPUTS
C F
-64 -83.2
.... ....
0 32.0
.... ....
80 176.0
Write a program that will produce a table that shows corresponding temperatures in Fahrenheit and Celsius.
Ask the user if they would like to convert Fahrenheit temperatures to Celsius, or vice versa. Let the user enter the minimum and maximum values for the table.
The table should show all whole number values of the original temperature scale, and show the other temperature to the nearest tenth of a degree.
Keep in mind that a very large range may cause more lines than are available in the window (300 lines scrollable). Please ensure that your table can handle at least from boiling to freezing in both scales.
The conversion formulas are as follows (careful with parentheses!):
°C = 5/9 * (°F – 32)
°F = 9/5 * °C + 32
TEST DATA: Here is are the first and last lines of the output table you should have, as well as one random line in the middle. The ellipsis (...) means a break in the table.
INPUTS
User chooses Fahrenheit ➪ Celsius
Minimum: 25
Maximum: 85
OUTPUTS
F C
25 -3.9
.... ....
59 15.0
.... ....
85 29.4
INPUTS
User chooses Celsius ➪ Fahrenheit
Minimum: -64
Maximum: 80
OUTPUTS
C F
-64 -83.2
.... ....
0 32.0
.... ....
80 176.0
TempGuess
This is a short one-player game in which a user gets five tries to guess a random number from 1 to 50. The feedback received after each guess is HOT, WARM, or COLD.
Generate a random number from 1 to 50, then allow the user five tries to guess the random number.
This is a short one-player game in which a user gets five tries to guess a random number from 1 to 50. The feedback received after each guess is HOT, WARM, or COLD.
Generate a random number from 1 to 50, then allow the user five tries to guess the random number.
- If the user is 10 or more away from the number, tell the user he/she is COLD.
- If the user is 3-9 away from the number. tell the user he/she is WARM.
- If the user is 1-2 away from the number, the the user he/she is HOT.
- If the user is correct, congratulate him/her and allow no more guesses.
- If the user needs all five guesses and doesn't get it right, show them the number and say better luck next time.
ABC: FactorIt (+1 or +2)
Write a program in which a positive integer is input and all positive factor pairs of that number are output. You may format the output any way you wish.
For +1, it is acceptable to list the pairs twice, which is what I have done in the test data.
For +2, each pair should only be listed once.
TEST DATA:
Input: 5
Outputs:
1, 5
5, 1*
Input: 36
Outputs:
1, 36
2, 18
3, 12
4, 9
6, 6
9, 4*
12, 3*
18, 2*
36, 1*
*Cannot be listed for the +2 option.
Write a program in which a positive integer is input and all positive factor pairs of that number are output. You may format the output any way you wish.
For +1, it is acceptable to list the pairs twice, which is what I have done in the test data.
For +2, each pair should only be listed once.
TEST DATA:
Input: 5
Outputs:
1, 5
5, 1*
Input: 36
Outputs:
1, 36
2, 18
3, 12
4, 9
6, 6
9, 4*
12, 3*
18, 2*
36, 1*
*Cannot be listed for the +2 option.