Question
Number B (23 points: tables, basic statistic) (no functions yet) Write a program in C whose main function includes the declarations and initializations of the
Number B (23 points: tables, basic statistic) (no functions yet) Write a program in C whose main function includes the declarations and initializations of the following 3 tables: extension: character tables with the values P, P, O, P, P, A, O, A ("A" for analyst, "P" for programmer, "O" for operator) nbCafe: array of integers with the values 2, 1, 7, 0, 5, 4, 0, 3 age: array of integers with the values 25, 18, 47, 26, 69, 44, 56, 29 Add to the function main the declarations and the statements in C allowing 1. to display the content of these three tables 2. to count and display the number of analysts 3. to count and display the number of secretaries (position S which does not exist in the data) 4. to determine and display the maximum consumption coffee analysts 5. determine and display the minimum age for programmers; 6. calculate and display the operators' average coffee consumption; 7. calculate and display the average age of all employees; 8. sort by age and display the 3 tables again after sorting. (sorting is not internal)
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