Question
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
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