Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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):

  1. She can enter how many bundt cakes she wants and the program will print out that many flavors

  1. 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
  2. The program should continue until she decides to exit
  3. 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

  1. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

What three issues have engaged developmental psychologistspg15

Answered: 1 week ago

Question

What does it mean to isolate the technical core of a business?

Answered: 1 week ago

Question

Determine Leading or Lagging Power Factor in Python.

Answered: 1 week ago

Question

Evaluate employees readiness for training. page 275

Answered: 1 week ago