Saturday, April 22, 2023

Multiple selections flowchart and Pascal Program

ICT Past Paper Questions and Answers

Question:

The following flow chart is drawn to calculate average marks (avg) and display the grades when marks (M1, M2, M3) of three subjects are given as input. The grades are decided according to the following table.

Average marks (avg) Grade
Greater than or equal to 80A
Less than 80 and greater than or equal to 65B
Less than 65 and greater than or equal to 50C
OtherwiseNo Grade


Multiple if in Pascal with flowchart

  • Fill the blank indicated by ? according to the given scenario.
  • Convert the flow chart to Pascal Program.


Answer:
1:


Multiple if flowchart and Pascal answer

2:
program Multipleif;
var
m1,m2,m3:integer;
avg:real;
begin
  writeln ('Enter three Marks');
  readln(m1);
  readln(m2);
  readln(m3);
  avg:=(m2+m3+m3)/3;
  if (avg>=80) then
  writeln('A')
  else
  if(avg>=65) then
  writeln('B')
  else
  if (avg>=50) then
  writeln('C')
  else
  writeln('No Grade')
end.

  

No comments:

Post a Comment