Fifty students of a class appear in the examination. Write a Pseudocode and Algorithm? Also draw a FLOW CHART for the algorithm to calculate and print the percentage marks obtain by each student

Write a pseudocode algorithm that will ask the student to enter his/her name, age and registration number and print the student details.

Pseudocode:

1. Initialize a variable "total_students" as 50.
2. For each student, repeat steps 3 to 6:
3. Prompt the user to enter the marks obtained by the student.
4. Initialize a variable "total_marks" as 0.
5. Calculate the "total_marks" by adding the marks obtained by the student.
6. Calculate the "percentage" by dividing the "total_marks" by 100 and multiplying by 100.
7. Print the "percentage" obtained by the student.

Algorithm:

1. Set "total_students" to 50.
2. For "student" in range 1 to "total_students", do steps 3 to 7:
3. Prompt the user to enter the marks obtained by the student.
4. Set "total_marks" to 0.
5. Add the marks obtained by the student to "total_marks".
6. Calculate the "percentage" as (total_marks / 100) * 100.
7. Print the "percentage" obtained by the student.

Flowchart:

```
+-----------------+
| Start |
+-----------------+
|
|
+-----------------+
| Initialize |
| total_students |
+-----------------+
|
|
+-----------------+
| For each +----------------------+
| student | Prompt user to enter |
| | marks obtained |
+-----------------+----------------------+
|
|
+-----------------+
| Initialize |
| total_marks |
+-----------------+
|
|
+-----------------+
| Add marks |
| obtained to |
| total_marks |
+-----------------+
|
|
+-----------------+
| Calculate |
| percentage |
+-----------------+
|
|
+-----------------+
| Print |
| percentage |
+-----------------+
|
|
+-----------------+
| Repeat for |
| next student |
+-----------------+
|
|
+-----------------+
| End |
+-----------------+
```

Sure! Let's start with the pseudocode:

```
BEGIN
DECLARE marks[50]
DECLARE percentage[50]

FOR i = 0 to 49
READ marks[i]
percentage[i] = (marks[i] / 100) * 100

FOR i = 0 to 49
PRINT "Student " + (i+1) + ": " + percentage[i] + "%"

END
```

And now let's break it down into an algorithm:

1. Start the program.
2. Declare an array called "marks" of size 50 to store the marks obtained by each student.
3. Declare another array called "percentage" of size 50 to store the percentage marks obtained by each student.
4. Use a loop that iterates from i = 0 to 49 to read the marks obtained by each student and store them in the "marks" array.
5. Inside the loop, calculate the percentage marks for each student by dividing their marks by the maximum marks (100) and multiply the result by 100. Store the result in the corresponding index of the "percentage" array.
6. Use another loop to iterate from i = 0 to 49 to print the percentage marks obtained by each student.
7. Inside the loop, print the student number (i+1), followed by a colon (:), and then the percentage marks obtained from the "percentage" array.
8. End the program.

Now, let's draw the flowchart for this algorithm:

```
+---------------------+
| START |
+---------------------+
|
|
V
+---------------------+
| DECLARE marks[] |
+---------------------+
|
|
V
+-----------------------------------+
| DECLARE percentage[] |
+-----------------------------------+
|
|
V
+------------------------+
| FOR i = 0 TO 49 |
| READ marks[i] |
| percentage[i] = (marks[i] / 100) * 100 |
+------------------------+
|
|
V
+------------------------+
| FOR i = 0 TO 49 |
| PRINT "Student " + (i+1) + ": " + percentage[i] + "%" |
+------------------------+
|
|
V
+---------------------+
| END |
+---------------------+
```

This flowchart represents the step-by-step process of calculating and printing the percentage marks obtained by each student in the class.

for each student {

pct = correct / total
print pct
}