Question
C Language program. Please follow the instructions. Thank you. Asmahan lives in Arlington and loves to eat Nothing Bundt Cakes (note this is a real
C Language program. Please follow the instructions. Thank you.
Asmahan lives in Arlington and loves to eat Nothing Bundt Cakes (note this is a real place with a website). She wants to create a program that will allow her the following functionality (sample run below-your program must exactly match the sample run BUT DO NOT HARDCODE SINCE WE WILL TRY OTHER SAMPLE RUNS-0 POINTS IF YOU ARE HARDCODE):
- She can enter how many bundt cakes she wants and the program will print out that many flavors
- She can enter a name and see if any of the bundt cake flavors start with the same letter as that name. If any of the flavors have the same matching first letter (case shouldnt matter), the program should print out the words: Flavor match! along with the name of the matching flavor
- The program should continue until she decides to exit
- Any user choice that does not have to do with any of the preceding functionality should let the user know that. For example, if a user enters 100, the program should let them know this is not a valid choice.
Step 1: Using the following function declarations, define the functions:
/* This function should take two parameters-a number and an array of char pointers. The function should go through the array of char pointers and print out as many values as indicated by the number parameter. Nothing is returned.*/
void print_out(int *num, char* f[])
/* This function should take three parameters-a letter, an array of char pointers and a number. The value returned should be the number of times the first letter of a value held in the array of char pointers has the same value of the letter given in the parameters. In addition, every time a first letter matches a value in the array of char pointers, it is indicated by outputting Flavor match! to screen along with the matching value in the array of char pointers.*/
int name_flavors(char *n, char* f[], int *s)
Step 2: Using the functions you defined above, create a program that fits the functionality expected (sample run below). 0 POINTS IF YOU DO NOT USE THE FUNCTIONS YOU DEFINED ABOVE IN YOUR PROGRAM.
Sample Run:
***Menu: ***
1-pick how many you want
2-see if any match the first letter of your name
3-to exit
1
How many do you want? 3
- Flavors: Red velvet Cinnamon Chocolate
***Menu: ***
1-pick how many you want
2-see if any match the first letter of your name
3-to exit
2
Enter a name:
carrie
Flavor match! Cinnamon
Flavor match! Chocolate
Flavor match! Classic Vanilla
Flavor match! Carrot
Number of matches: 4
***Menu: ***
1-pick how many you want
2-see if any match the first letter of your name
3-to exit 3
Bye
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started