3A PROGRAMSExcellence (6 points): Complete ASCIINeighbords, CapsShift, and ShuffleAndDeal within 50 hours with all programming standards met.
Advanced (5 points): Complete ASCIINeighbors and CapsShift by the end of Cycle 3 with all programming standards met. Proficient (4 points): Complete ASCIINeighbors and CapsShift by the end of Cycle 3 with all programming standards met. Basic (3 points): Complete ASCIINeighbors and have CapsShift partially finished by the end of Cycle 3. Below Basic (2 points): Complete ASCIINeighbors by the end of Cycle 3. |
|
ASCIINeighbors
Create a program that will ask the user for any character on the ASCII chart. The program should output a right-aligned table that includes the character itself, the ordinal of the character, its first and second predecessor (pred1 and pred2), and its first and second successor (succ1 and succ2).
TEST DATA:
Note: You do not need to output a table of three rows for three characters...only one. I wanted to give you three different options to try.
Create a program that will ask the user for any character on the ASCII chart. The program should output a right-aligned table that includes the character itself, the ordinal of the character, its first and second predecessor (pred1 and pred2), and its first and second successor (succ1 and succ2).
TEST DATA:
Note: You do not need to output a table of three rows for three characters...only one. I wanted to give you three different options to try.
CapsShift
Write a program that will read in five lower-case letters and print the same five letters as UPPER-CASE.
A hint: To allow the user to enter a word instead of letters on five separate lines, Use:\
read(var1);
read(var2);
....
readln(var5); <--THE FINAL INPUT MUST BE READLN.
instead of
readln(var1);
readln(var2); ...
TEST DATA: Input = noway \\ Output = NOWAY
Write a program that will read in five lower-case letters and print the same five letters as UPPER-CASE.
A hint: To allow the user to enter a word instead of letters on five separate lines, Use:\
read(var1);
read(var2);
....
readln(var5); <--THE FINAL INPUT MUST BE READLN.
instead of
readln(var1);
readln(var2); ...
TEST DATA: Input = noway \\ Output = NOWAY
ShuffleAndDeal
Note: You may substitute RecursionCode (below) in place of this as your third program.
This program will simulate the "shuffling" (randomization) and "dealing" (passing out to two players) of five cards from a standard 52 card deck.
Begin the program by asking the players if they are "Ready to deal?". If they indicate they are, output two lines of five cards each. There doesn't need to be a card graphic, but it does need to include the suit and card value, such as ♠3 or ♥Q.
EXAMPLE OUTPUT:
♥5 ♠J ♥10 ♣7 ♦A
♦2 ♦6 ♠K ♦3 ♥7
NOTE: I am not concerned with the repetition of cards (in other words, dealing two ♠A or three ♥Q). This is something we will tackle later on in the course.
Note: You may substitute RecursionCode (below) in place of this as your third program.
This program will simulate the "shuffling" (randomization) and "dealing" (passing out to two players) of five cards from a standard 52 card deck.
Begin the program by asking the players if they are "Ready to deal?". If they indicate they are, output two lines of five cards each. There doesn't need to be a card graphic, but it does need to include the suit and card value, such as ♠3 or ♥Q.
EXAMPLE OUTPUT:
♥5 ♠J ♥10 ♣7 ♦A
♦2 ♦6 ♠K ♦3 ♥7
NOTE: I am not concerned with the repetition of cards (in other words, dealing two ♠A or three ♥Q). This is something we will tackle later on in the course.
ABC: RecursionCode (+2 or +3)
Recursion: The act of finding a new element of a pattern based on past elements of the pattern.
FOR TWO ABC POINTS:
Write an encoder that takes a seven-letter word will be encoded by the following rules and procedures.
TEST DATA (need to double check--ask me if I have before testing):
INPUT: GHOSTLY
OUTPUT: DIQUUJ|
INPUT: CARRIED
OUTPUT: B?URGCC
FOR A THIRD ABC POINT:
Write a second program that reverses the encoded output and outputs the original version (a decoder).
Recursion: The act of finding a new element of a pattern based on past elements of the pattern.
FOR TWO ABC POINTS:
Write an encoder that takes a seven-letter word will be encoded by the following rules and procedures.
- Have the user enter the seven "original" letters into seven char variables using individual readlns (not like in CapsShift). This method will allow you to copy code and not have to make nearly as many changes.
- Create seven NEW char variables to be the "encoded" letters.
- Each encoded letter is created based on the ordinal of the prior original letter, based on these rules:
- If the prior original letter's ordinal is equal to the current ordinal, then encode the current ordinal as unchanged.
- If the prior original letter's ordinal is 1 less than the current ordinal, then encode the current ordinal as its successor.
- If the prior original letter's ordinal is 1 more than the current ordinal, then encode the current ordinal as its predecessor.
- If the prior original letter's ordinal is 2 to 10 less than the current ordinal, then encode the current ordinal as its second successor.
- If the prior original letter's ordinal is 2 to 10 more than the current ordinal, then encode the current ordinal as its second predecessor.
- If the prior original letter's ordinal is 11 to 25 less than the current ordinal, then encode the current ordinal as its third successor.
- If the prior original letter's ordinal is 11 to 25 more than the current ordinal, then encode the current ordinal as its third predecessor.
- IMPORTANT: The first original letter will be encoded based on the seventh original letter.
TEST DATA (need to double check--ask me if I have before testing):
INPUT: GHOSTLY
OUTPUT: DIQUUJ|
INPUT: CARRIED
OUTPUT: B?URGCC
FOR A THIRD ABC POINT:
Write a second program that reverses the encoded output and outputs the original version (a decoder).