HNDIT1103
BAT/IT/2016/F/0015
1.To calculate s=(a+b+c)/y
Begin
Read a,b,c,y
S = (a+b+c)/y
Display S
End
2.To convert from Celsius to Fahrenheit
Begin
Read cel
Fahrenheit = 1.8 * cel + 32
Display Fahrenheit
End
Start
Input a,b,c,y
S= (a+b+c)/y
Output S
Stop
Start
Input cel
Fah = 1.8 * cel + 32
Output Fah
Stop
3.To read a marks from student and display “pass” if
the marks greater than or equal to 50. “fail”
otherwise.
Begin
Read marks
If marks > 100 Then
Display “Error”
Else:
If marks >= 50 Then
Display “Pass”
Else:
Display “Fail”
End if
End if
End
Start
Input marks
Output “Fail”
If
mark>
100
No
If
mark
>=50
Output “Pass”
Yes
Output “Error”
Yes
Stop
No
4.To read 3 numbers from user and display maximum.
Begin
Read x,y,z
If x > y Then
If x > z Then
Display x
Else:
Display z
Else:
If y > z Then
Display y
` Else:
Display z
End if
End if
End if
End
Start
If x
> y
No
If x
> z
Yes
Stop
No
If y
> z
Input x,y,z
xy
zz
Yes
No
Yes
5.To read any 10 numbers and display the total and
average.
Begin
C = 0
Tot = 0
Avg = 0
While C < 10 Then
Read num
Tot = num + Tot
C = C + 1
End while
Avg = Tot / 10
Display Avg
Display Tot
End
Start
Input num
Yes
C = 0
Tot = 0, Avg = 0
While
C < 10
Tot = num + Tot
C = C +1
No
Avg = Tot / 10
Output Tot, Avg
Stop
6.To accept numbers until the user enters a “o” and
output the sum of the given numbers.
`Begin
T = 0
Read n
While n != 0 Then
T = T + n
Read n
End while
Display T
End
Start
T = 0
Input n
While
n != 0
No
Yes
T = T + n
Input n
Output T
Stop
7.To read any 10 numbers from user and display the
maximum
Begin
C = 1
Max = 0
Read num1
Max = num1
While c < 10 Then
Read num2
If num2 > Max Then
Max = num2
C = C + 1
End while
Display Mas
End
Yes
Stop
Start
c = 1, Max = 0
Input num1
While
c < 10
Max = num1
Read num2
If
num2
> Max
Max = num1
c = c +1
No
Yes
No
Output Max
8.To output the number of even numbers among the
users entered by the user
Begin
C = 0
Read ran_num
If ran_num > 0 Then
While C < ran_num Then
C = C + 2
Display C
End while
Else:
Display “Invalid entry”
End if
End
Stop
Input ran_num
Yes
Start
c = 0
If
ran_num
> 0
While c <
ran_num
Yes
c = c + 2
Output c
No
Invalid Entry
No
Flow chart and pseudo code

Flow chart and pseudo code

  • 1.
  • 3.
    1.To calculate s=(a+b+c)/y Begin Reada,b,c,y S = (a+b+c)/y Display S End 2.To convert from Celsius to Fahrenheit Begin Read cel Fahrenheit = 1.8 * cel + 32 Display Fahrenheit End Start Input a,b,c,y S= (a+b+c)/y Output S Stop Start Input cel Fah = 1.8 * cel + 32 Output Fah Stop
  • 4.
    3.To read amarks from student and display “pass” if the marks greater than or equal to 50. “fail” otherwise. Begin Read marks If marks > 100 Then Display “Error” Else: If marks >= 50 Then Display “Pass” Else: Display “Fail” End if End if End Start Input marks Output “Fail” If mark> 100 No If mark >=50 Output “Pass” Yes Output “Error” Yes Stop No
  • 5.
    4.To read 3numbers from user and display maximum. Begin Read x,y,z If x > y Then If x > z Then Display x Else: Display z Else: If y > z Then Display y ` Else: Display z End if End if End if End Start If x > y No If x > z Yes Stop No If y > z Input x,y,z xy zz Yes No Yes
  • 6.
    5.To read any10 numbers and display the total and average. Begin C = 0 Tot = 0 Avg = 0 While C < 10 Then Read num Tot = num + Tot C = C + 1 End while Avg = Tot / 10 Display Avg Display Tot End Start Input num Yes C = 0 Tot = 0, Avg = 0 While C < 10 Tot = num + Tot C = C +1 No Avg = Tot / 10 Output Tot, Avg Stop
  • 7.
    6.To accept numbersuntil the user enters a “o” and output the sum of the given numbers. `Begin T = 0 Read n While n != 0 Then T = T + n Read n End while Display T End Start T = 0 Input n While n != 0 No Yes T = T + n Input n Output T Stop
  • 8.
    7.To read any10 numbers from user and display the maximum Begin C = 1 Max = 0 Read num1 Max = num1 While c < 10 Then Read num2 If num2 > Max Then Max = num2 C = C + 1 End while Display Mas End Yes Stop Start c = 1, Max = 0 Input num1 While c < 10 Max = num1 Read num2 If num2 > Max Max = num1 c = c +1 No Yes No Output Max
  • 9.
    8.To output thenumber of even numbers among the users entered by the user Begin C = 0 Read ran_num If ran_num > 0 Then While C < ran_num Then C = C + 2 Display C End while Else: Display “Invalid entry” End if End Stop Input ran_num Yes Start c = 0 If ran_num > 0 While c < ran_num Yes c = c + 2 Output c No Invalid Entry No