6B PROGRAMSExcellence (6 points): Complete all three programs within 50 hours.
Advanced (5 points): Complete all three programs by the end of Cycle 6. Proficient (4 points): Complete both programs by the end of Cycle 6. Basic (3 points): Complete one program by the end of Cycle 6 and have one program non-functioning. Below Basic (2 points): Complete one program by the end of Cycle 6. |
|
THIS MODULE'S ALBUMS:
TBD
HoliBirthday
Write a simple program using a CASE statement that will ask the user for the month of their birthday and output the names of all of the federal holidays in their birth month. If there are no federal holidays in the month, tell the person that! There cannot be any IF-THEN or IF-THEN-ELSE statements in this program.
There are three things I expect from your program:
TEST DATA:
Test any three months (at least one with no holiday) to ensure it works.
Write a simple program using a CASE statement that will ask the user for the month of their birthday and output the names of all of the federal holidays in their birth month. If there are no federal holidays in the month, tell the person that! There cannot be any IF-THEN or IF-THEN-ELSE statements in this program.
There are three things I expect from your program:
- It needs to be very sensitive to user errors. February is an easy month to misspell. Keep in mind that June and July both start with J as well! Give the user an easy way to input.
- The entire CASE statement, from the CASE line all the way to the end; line, cannot exceed eleven total semicolons.
- Any user input that is not valid should return the statement "invalid entry".
TEST DATA:
Test any three months (at least one with no holiday) to ensure it works.
SuperFancyCalc
Take your code from FancyCalc and paste it into a new project (named SuperFancyCalc). Re-organize your code so that each menu selection by the user is routed to a CASE statement that, in turn, calls a procedure with the necessary code to complete that function. For example, if FancyCalc asked the user to enter 1 for the Permutations and Combinations calculator. This 1 should go to a CASE statement which tells the program to go to the Permutations and Combinations procedure.
Any variables that are only used within a particular procedure must be made local, while variables that are used within several procedures or the main program must remain global.
Take your code from FancyCalc and paste it into a new project (named SuperFancyCalc). Re-organize your code so that each menu selection by the user is routed to a CASE statement that, in turn, calls a procedure with the necessary code to complete that function. For example, if FancyCalc asked the user to enter 1 for the Permutations and Combinations calculator. This 1 should go to a CASE statement which tells the program to go to the Permutations and Combinations procedure.
Any variables that are only used within a particular procedure must be made local, while variables that are used within several procedures or the main program must remain global.
NFLNumbers
You may have never noticed, but NFL players are restricted in which numbers they are permitted to wear based on their positions. Here are the numerical choices, squads, and primary jobs for the eleven position categories.
Quarterbacks: 1-19
Punters: 1-19
Placekickers: 1-19
Running Backs: 20-49
Defensive Backs: 20-49
Centers: 50-59
Defensive Linemen: 50-79, 90-99
Offensive Linemen (non-Centers): 60-79
Receivers:10-19, 80-89
Tight Ends: 10-19, 80-89
Linebackers: 40-49, 90-99
Write a program using CASE statements as the only form of decision (no IF-THEN or IF-THEN-ELSE) that takes a number as an initial input and, through a series of further yes/no questions, determines a players' position and outputs it. The yes/no questions may NOT ask for the direct name of the position (i.e. Are you a running back?). Do not allow invalid numerical entries.
Hint: Save yourself some time and typing with "div 10".
Note: If you are not knowledgeable about football positions and their roles on the field, please just ask :)
TEST DATA:
PLEASE NOTE: YOUR QUESTIONS DO NOT NEED TO MATCH MINE, but the initial input and final outputs must match.
INPUT: Number = 5
QUESTION: Do you often pass the ball?
INPUT: No
QUESTION: Do you often catch a snap?
INPUT: Yes
OUTPUT: You are a punter.
INPUT: Number = 18
QUESTION: Do you often throw the ball?
INPUT: No
QUESTION: Do you often catch a ball thrown by the QB?
INPUT: Yes
QUESTION: Are you expected to block?
INPUT: No
OUTPUT: You are a wide receiver.
INPUT: Number = 42
QUESTION: Do you play defense?
INPUT: Yes
QUESTION: Do you frequently blitz the quarterback?
INPUT: Yes
OUTPUT: You are a linebacker.
INPUT: Number = 100
OUTPUT: >:-O INVALID ENTRY
You may have never noticed, but NFL players are restricted in which numbers they are permitted to wear based on their positions. Here are the numerical choices, squads, and primary jobs for the eleven position categories.
Quarterbacks: 1-19
Punters: 1-19
Placekickers: 1-19
Running Backs: 20-49
Defensive Backs: 20-49
Centers: 50-59
Defensive Linemen: 50-79, 90-99
Offensive Linemen (non-Centers): 60-79
Receivers:10-19, 80-89
Tight Ends: 10-19, 80-89
Linebackers: 40-49, 90-99
Write a program using CASE statements as the only form of decision (no IF-THEN or IF-THEN-ELSE) that takes a number as an initial input and, through a series of further yes/no questions, determines a players' position and outputs it. The yes/no questions may NOT ask for the direct name of the position (i.e. Are you a running back?). Do not allow invalid numerical entries.
Hint: Save yourself some time and typing with "div 10".
Note: If you are not knowledgeable about football positions and their roles on the field, please just ask :)
TEST DATA:
PLEASE NOTE: YOUR QUESTIONS DO NOT NEED TO MATCH MINE, but the initial input and final outputs must match.
INPUT: Number = 5
QUESTION: Do you often pass the ball?
INPUT: No
QUESTION: Do you often catch a snap?
INPUT: Yes
OUTPUT: You are a punter.
INPUT: Number = 18
QUESTION: Do you often throw the ball?
INPUT: No
QUESTION: Do you often catch a ball thrown by the QB?
INPUT: Yes
QUESTION: Are you expected to block?
INPUT: No
OUTPUT: You are a wide receiver.
INPUT: Number = 42
QUESTION: Do you play defense?
INPUT: Yes
QUESTION: Do you frequently blitz the quarterback?
INPUT: Yes
OUTPUT: You are a linebacker.
INPUT: Number = 100
OUTPUT: >:-O INVALID ENTRY