Question: write in c 4. Write a function that reads student names and their scores from a user and displays the following: the average score, the
4. Write a function that reads student names and their scores from a user and displays the following: the average score, the minimum score, the maximum score, and the students who received the minimum and maximum scores. The function repeatedly prompts the user to enter the names and the scores of students. The user enters the name and the score separated by blank in one line. The name is a single word and the score is a positive integer. The user enters q in lower or upper case to quit. The user does not enter score after q. The outputs are displayed with appropriate messages. The function prototype is void process_scores ( ). Arrays should not be used except three strings. 5. Write a function that determines the tax amount according to the following tax rules. The tax rate depends on the income, the marital status, and the state residency. For in state residents, the following rates apply. If single and income is less than 30000 then tax rate is 20%. If single and income is greater or equal to 30000 then tax rate is 25%. If married and income is less than 50000 then tax rate is 10%. If married and income is greater or equal to 50000 then tax rate is 15%. For out of state residents, the similar rules apply except the tax rate is 3% less than the tax rate of the corresponding in state residents. The function prototype is double compute_tax (int income, char *status, char state). The income is positive integer. The status is string single or married in lower or upper case letters. The state is character i oro in lower or upper case letters. The function computes and returns the tax amount. If any input is invalid then the function returns - 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
