Write a structural program to calculate the average of 10 students in 3 courses. Hint score < 40 fail

Sure! Here's a structural program in Python that calculates the average score of 10 students in 3 courses:

```python
def calculate_average():
num_students = 10
num_courses = 3
total_average = 0

for student in range(num_students):
student_score = 0
for course in range(num_courses):
score = float(input(f"Enter the score for student {student + 1} in course {course + 1}: "))
if score < 40:
print("Fail")
return

student_score += score

student_average = student_score / num_courses
total_average += student_average

overall_average = total_average / num_students
print("The average score of the 10 students in 3 courses is:", overall_average)

calculate_average()
```

In this program, we define a function called `calculate_average()` which performs the required calculations. We assume that the scores for each student in each course are provided through user input.

The program uses two nested loops: an outer loop for iterating through 10 students, and an inner loop for iterating through 3 courses for each student. Within the loops, the program prompts the user to input the score for each student in each course.

If any score entered is less than 40, the program immediately reports "Fail" and terminates using a `return` statement. Otherwise, it proceeds to calculate the student's average score for the courses and adds it to the total average.

Finally, the program calculates the overall average by dividing the total average by the number of students, and then prints the result.

Note: This program assumes that the input score values are valid and will be entered correctly by the user.