3B PROGRAMSExcellence (6 points): Complete KindtsNickname, HailCaesar, and TailCaesar within 50 hours, meeting all program standards.
Advanced (5 points): Complete KindtsNickname and HailCaesar within 50 hours, and TailCaesar by the end of Cycle 3, meeting all program standards. Proficient (4 points): Complete KindtsNickname and HailCaesar by the end of Cycle 3, meeting all program standards. Basic (3 points): Complete KindtsNickname by the end of Cycle 2, and have HailCaesar finished but not functioning. Below Basic (2 points): Complete KindtsNickname by the end of Cycle 3. |
|
KindtsNickname
Write a program to serve as Mr. Kindt's nickname generator. He likes to call you by the first two letters of your first name, followed by the first two letters of your last name. For example:
Your program must take in the first and last names as string variables (not as a series of char variables). The program will not be accepted unless the names are stored in strings.
Write a program to serve as Mr. Kindt's nickname generator. He likes to call you by the first two letters of your first name, followed by the first two letters of your last name. For example:
- Brady Ahmed = BrAh
- Stanley Ewing = StEw
- Norah Oberholtzer = NoOb
Your program must take in the first and last names as string variables (not as a series of char variables). The program will not be accepted unless the names are stored in strings.
HailCaesar
Please view the Khan Academy video shown here first.
Please view the Khan Academy video shown here first.
Caesar utilized a simple ordinal shift in his cipher: shift each letter three down (+3) in the alphabet. Create a program for Julius C. that will ask him for his message (must handle up to 20 characters) and a number to represent his ordinal shift (either negative or positive). Encode and output the message.
Do note that your cipher will work on the ASCII Alphabet and not our alphabet. Thus, you may have non-alphabetic symbols in your encoded message.
TEST DATA:
INPUTS:
Message: LOOK OUT FOR BRUTUS
Shift: -7
OUTPUT:
Encoded Version: EHHD↓HNM↓?HK↓;KNMNL (note...there may be an extra symbol at the end...)
-------------------------------------------------------------------------------------------------------------
INPUTS:
Message: OneOfMySaladsPlease
Shift: 2
OUTPUT:
Encoded Version: QpgQhO{UcncfuRngcug
Do note that your cipher will work on the ASCII Alphabet and not our alphabet. Thus, you may have non-alphabetic symbols in your encoded message.
TEST DATA:
INPUTS:
Message: LOOK OUT FOR BRUTUS
Shift: -7
OUTPUT:
Encoded Version: EHHD↓HNM↓?HK↓;KNMNL (note...there may be an extra symbol at the end...)
-------------------------------------------------------------------------------------------------------------
INPUTS:
Message: OneOfMySaladsPlease
Shift: 2
OUTPUT:
Encoded Version: QpgQhO{UcncfuRngcug
TailCaesar
Caesar's shift is quite simple, so let's make it harder to decipher using a polyalphabetic cipher. Watch the video first.
Caesar's shift is quite simple, so let's make it harder to decipher using a polyalphabetic cipher. Watch the video first.
Copy your code from HailCaesar into a new project file, but this time add the following variation.
After asking Caesar for his message (again, up to 20 characters), ask him to enter a three letter animal with a tail (DOG, CAT, PIG, COW) in all CAPS. Then, the shift will occur by finding the numerical position of each letter in the Alphabet and applying it as the shift.
For example, suppose the message is "ROMEISBURNING" and Caesar selects a shift of CAT. C is the 3rd letter of the alphabet, A the 1st, and T the 20th. The shifts on the characters would be in the order 3-1-20-3-1-20-3-1-20...
See the image at right to demonstrate how CAT would key out ROMEISBURNING. The red letters shift 3, the blue 1, and the green 20.
TEST DATA:
INPUTS:
Message: LOOKOUTFORBRUTUS
Shift: DOG
OUTPUT:
Encoded Version: P↑VO↑\XUVVQYYc\W (Note: there may be extra symbols at the end.)
--------------------------------------------------------------------------------------------------------------
INPUTS:
Message: OneOfMySaladsPlease
Shift: PIG
OUTPUT:
Encoded Version: _wl_oTë\h|jkâYsujzu
After asking Caesar for his message (again, up to 20 characters), ask him to enter a three letter animal with a tail (DOG, CAT, PIG, COW) in all CAPS. Then, the shift will occur by finding the numerical position of each letter in the Alphabet and applying it as the shift.
For example, suppose the message is "ROMEISBURNING" and Caesar selects a shift of CAT. C is the 3rd letter of the alphabet, A the 1st, and T the 20th. The shifts on the characters would be in the order 3-1-20-3-1-20-3-1-20...
See the image at right to demonstrate how CAT would key out ROMEISBURNING. The red letters shift 3, the blue 1, and the green 20.
TEST DATA:
INPUTS:
Message: LOOKOUTFORBRUTUS
Shift: DOG
OUTPUT:
Encoded Version: P↑VO↑\XUVVQYYc\W (Note: there may be extra symbols at the end.)
--------------------------------------------------------------------------------------------------------------
INPUTS:
Message: OneOfMySaladsPlease
Shift: PIG
OUTPUT:
Encoded Version: _wl_oTë\h|jkâYsujzu
ABC: LifePath (+2)
The study of numerology (much like astrology [your horoscope], palm reading, or future telling) is a pseudo-science that works based on beliefs about how important numbers in your life might say something about you or your destiny. You can read a little bit about what certain life numbers will say about an individual.
One of the key numbers in numerology is your Life Path. This number is found by reducing your birth month, birth date, and birth year each down to a single digit...and then taking the sum of those digits. Reducing a number, in this case, refers to adding all of its digits in the place values together.
Example: Born 01/02/2000:
Reduction of Month: 0 + 1 = 1
Reduction of Day: 0 + 2 = 2
Reduction of Year: 2 + 0 + 0 + 0 = 2
Life Path: 1 + 2 + 2 = 5
In some cases, two (on month, day, or year) or even three reductions (on day or year) are necessary on some of your date numbers.
Example: Born 04/29/1999
Reduction of Month: 0 + 4 = 4
Reduction of Day: 2 + 9 = 11
Second Reduction of Day: 1 + 1 = 2
Reduction of Year: 1 + 9 + 9 + 9 = 28
Second Reduction of Year: 2 + 8 = 10
Third Reduction of Year: 1 + 0 = 1
Life Path: 4 + 2 + 1 = 7
You may need to reduce your life path as well, even if you don't reduce any of the original date numbers the first time.
Example: Born 03/04/2003
Reduction of Month: 0 + 3 = 3
Reduction of Day: 0 + 4 = 4
Reduction of Year: 2 + 0 + 0 + 3 = 5
Life Path: 3 + 4 + 5 = 12
Second Reduction of Life Path: 1 + 2 = 3
Write a program that takes in the month, day, and year of someone's birth and outputs their life number.
TEST DATA:
The study of numerology (much like astrology [your horoscope], palm reading, or future telling) is a pseudo-science that works based on beliefs about how important numbers in your life might say something about you or your destiny. You can read a little bit about what certain life numbers will say about an individual.
One of the key numbers in numerology is your Life Path. This number is found by reducing your birth month, birth date, and birth year each down to a single digit...and then taking the sum of those digits. Reducing a number, in this case, refers to adding all of its digits in the place values together.
Example: Born 01/02/2000:
Reduction of Month: 0 + 1 = 1
Reduction of Day: 0 + 2 = 2
Reduction of Year: 2 + 0 + 0 + 0 = 2
Life Path: 1 + 2 + 2 = 5
In some cases, two (on month, day, or year) or even three reductions (on day or year) are necessary on some of your date numbers.
Example: Born 04/29/1999
Reduction of Month: 0 + 4 = 4
Reduction of Day: 2 + 9 = 11
Second Reduction of Day: 1 + 1 = 2
Reduction of Year: 1 + 9 + 9 + 9 = 28
Second Reduction of Year: 2 + 8 = 10
Third Reduction of Year: 1 + 0 = 1
Life Path: 4 + 2 + 1 = 7
You may need to reduce your life path as well, even if you don't reduce any of the original date numbers the first time.
Example: Born 03/04/2003
Reduction of Month: 0 + 3 = 3
Reduction of Day: 0 + 4 = 4
Reduction of Year: 2 + 0 + 0 + 3 = 5
Life Path: 3 + 4 + 5 = 12
Second Reduction of Life Path: 1 + 2 = 3
Write a program that takes in the month, day, and year of someone's birth and outputs their life number.
TEST DATA:
- 03-04-2005: LifePath=5
- 11-11-2011: LifePath = 8
- 12-25-0000: LifePath = 1
- 02-25-1984: LifePath = 4
- 08-02-2007: LifePath = 1