Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Language Define the function given below: /*This function takes a list of people (the parameter all_people) and the number of people in that list

C Language

Define the function given below:

/*This function takes a list of people (the parameter all_people) and the number of people in that list (size). It asks the user to enter a certain amount of money greater than a minimum amount per person (the minimum is based on the length of the persons name) (11 points). The user should be re-prompted until given an acceptable amount (8 points) (see sample run). It should return the number of times the user didnt enter an amount greater than the minimum(1 point) (and had to be re-prompted)*/

int payment(char **all_people,int size);

Sample run

-How much for bob? (min $3): 2 /*Minimum is 3 since bob has 3 letters*/ Not enough. Must be a minimum of $3. Enter again: $4 /*1 time to re-prompt*/

-How much for carrie? (min $6): 3 /*Minimum is 6 since carrie has 6 letters*/ Not enough. Must be a minimum of $6. Enter again: $2 /*2 times to re-prompt*/ Not enough. Must be a minimum of $6. Enter again: $9 /*3 times to re-prompt*/

-How much for jonathan? (min $8): 9 /*Minimum is 8 since jonathan has 8 letters*/ /*function should return 3 since there were two times the user had to be re-prompted*/

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

write a code to find the sum of 3 values

Answered: 1 week ago

Question

Explain the key areas in which service employees need training.

Answered: 1 week ago

Question

Understand the role of internal marketing and communications.

Answered: 1 week ago