Programming Sprints to Try
Prompts:
- Program 1: prints a user-inputted number
- Program 2: prints sum of two user-inputted numbers
- Variation 1 entirely in
main - Variation 2, with a function responsibly for entering a number,
enterNumber - Variation 3, with two functions,
enterNumberandgetSum
- Variation 1 entirely in
- Program 3: prints quotient and remainder of two user-inputted numbers
- Variation 1 entirely in
main - Variation 2, with two function,
getQuotientandgetRemainder - Variation 3, with a function
getSolutionwhich returns a vector containing quotient and remainder
- Variation 1 entirely in
- Program 4: prints whether a user-inputted year is a leap year
- Variation 1 entirely in
main - Variation 2 entirely in
main, but checks if a valid year is entered - Variation 3 entirely in
main, but continues asking until a valid year is entered
- Variation 1 entirely in
- Program 5: prints the
10x10multiplication table - Program 6: checks if a user-inputted char is a vowel or consonant
- Variation 1, with an
ifstatement - Variation 2, with an array
- Variation 3, with a vector
- Variation 4, with a function responsible for vowel-checking
- Variation 1, with an
- Program 7: counts how many vowels and how many consonants in an entered sentence
- Variation 1, with
isVowelfunction - counts non-letters as consonants - Variation 2, considers only letters by checking ASCII ranges in
isLetterfunction - Variation 3, considers only letters by
isalphafunction inisLetterfunction
- Variation 1, with
Program 1
Write a program that prints a number entered by the user. (5 minutes)