Question: Exercise 1 - Nested Loop Exercise Objectives Nested Loops Examples ( such as printing patterns ) Problem Description Write and run a C program that

Exercise 1- Nested Loop
Exercise Objectives
Nested Loops
Examples (such as printing patterns)
Problem Description
Write and run a C program that finds the minimum grade for a number of sections (the minimum for each section separately and then the minimum for all sections together). Begin by asking the user about the number of sections. For each section, ask the user about the number of students:
Define a function called float compute_min_sections(int n) that takes an integer arguments n, where n is the number of sections. Using nested loops, the function asks about number of students for each section, then it asks the user to insert the grades for those students. It prints the minimum grade for each section. It also finds and returns the minimum grade of all sections.
In the main:
Ask and prompt the user to insert an integer number called no_sections.
Call compute_min_sections function to find and display the minimum grade for each section and all sections, as shown below.
Sample Output:
please insert number of sections:
3
Enter the number of students for section # 1: 3
Enter grade in the range [35-100] for student # 1: 68.3
Enter grade in the range [35-100] for student # 2: 50.7
Enter grade in the range [35-100] for student # 3: 55.2
minimum grade =50.7
Enter the number of students for section # 2: 2
Enter grade in the range [35-100] for student # 1: 78.2
Enter grade in the range [35-100] for student # 2: 56.8
minimum grade =56.8
q,
Enter the number of students for section # 3: 4
Enter grade in the range [35-100] for student # 1: 61.2
Enter grade in the range [35-100] for student # 2: 92.2
Enter grade in the range [35-100] for student # 3: 74.9
Enter grade in the range [35-100] for student # 4: 85.8
minimum grade =61.2
minimum grades in the all sections =50.7
Exercise 1 - Nested Loop Exercise Objectives

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!