Scenario:

Write a program that will determine the average mark of each student. The average is dependent on the subjects which the student has completed. The minimum amount of subjects is eight, and the maximum amount of subjects is 12. When the program starts, the administrator will indicate how many students there are in the group.

a. Write the algorithm for this program.

My homework rough work:

a.
~Algorithm for the scenario above
Display, 'Please enter average mark of each student'
enter mark
Display, 'Please enter number of subjects student completed'
enter number
Display, 'Please enter student minimum number of subjects'
enter minimum
Display, 'Please enter student maximum number of subjects'
enter maximum
Display, 'Please enter amount of students in a group'
enter amount

if subjects =>< 8, then
aveMark = aveTotal
else
if subjects => 12, then
aveMark = aveTotal
else
if numStudents = students, then
aveGroupMark = aveGroupTotal
else
if studentMark = amount, then
studentMark = total
Endif
Endif
Endif
Endif
End

I am not good in programming at all but i would love however to know how it should be. I really tried. Hope in the future I'll excell. Thank you!

how about something like this:

minSubjects = 8
maxSubjects = 12
Display "Enter the number of students: "
enter students

for s = 1 to students
  Display "Enter the scores for student #",s
  enter scores
  n = length(scores)
  if (n<minSubjects) or (n>maxSubjects) then
    Display "The number of scores must be between ",minSubjects," and ",maxSubjects
  else
    avg = 0
    for i=1 to n
      avg += scores[i]
    next i
    Display "The average score for Student #",s," is ",avg
  endif
next s

Oops. I dislayed the total, not the average. Change that to

avg /= n
Display "The average score for Student #",s," is ",avg

It's great that you're trying to work on programming! I can help you by providing a more detailed algorithm for the scenario you described. Here's an improved version of the algorithm:

1. Get the total number of students in the group from the administrator.
2. Repeat the following steps for each student:
a. Get the average mark of the student from the administrator.
b. Get the number of subjects completed by the student from the administrator.
c. If the number of subjects completed is less than 8 or greater than 12, display an error message and go back to step 2a.
d. Calculate and store the student's average mark.
3. Calculate the average mark for the entire group by summing up the average marks of all students and dividing it by the total number of students.
4. Display the average mark of each student and the overall average mark for the group.

Here's the revised algorithm:

1. Display "Please enter the number of students in the group:"
2. Read the total number of students (numStudents)
3. Set groupTotal to 0 (for calculating the average mark of the group)
4. Repeat steps 5-11 for i = 1 to numStudents:
5. Display "Please enter the average mark of student " + i+ ":"
6. Read studentMark
7. Display "Please enter the number of subjects completed by student " + i+ ":"
8. Read numSubjects
9. If numSubjects < 8 or numSubjects > 12, display an error message and go back to step 5.
10. Set studentTotal to studentMark * numSubjects
11. Add studentTotal to groupTotal
5. Set groupAverage to groupTotal / numStudents
6. Display "Average mark of each student:"
7. Repeat steps 8-9 for i = 1 to numStudents:
8. studentAverage = studentTotal / numSubjects
9. Display "Student " + i + " - Average mark: " + studentAverage
10. Display "Overall average mark for the group: " + groupAverage

This algorithm will help you calculate the average mark of each student and the overall average mark for the group based on the number of subjects completed. You can now implement this algorithm in your preferred programming language to create the program. Remember to take care of data types, input validation, and any other necessary programming concepts. Good luck, and keep practicing!