Group 1 Laboratory 3
Group 1 Laboratory 3
Start
NARRATIVE Integer marks1
Integer marks2
Integer marks3
Start collecting the marks of first Integer marks4
subject. Collect the marks of second INPUT marks1
subject. Collect the marks of third INPUT marks2
subject. Collect the marks of the INPUT marks 3
fourth subject. Add the marks o al INPUT marks4
subjects to find total marks. Divide total<-
total marks by four to find the marks1+marks2+marks3+marks4
avera. If Average is greater than or average <- total/4
equal to 75 then you are pass. If OUTPUT " you are pass!"
average is lesser than 75 then you IF average >= 75 THEN
are fail and end . OUTPUT "You are pass!"
ELSE
OUTPUT average
END
QUESTIONS
1. What statement in the program that determines that the average is passing?
The statement if (average>=75) determines that the average is passing.
money, she would like to determine which type of account that she will chose. The amount of
interest that her money earns depends on which type of account the money is in. The bank has 6
Mary Jane as a programmer would like to make a program that computes automatically the interest
Presentation by GROUP 1
FLOWCHART
Big
Business
SCREEN DISPLAY
QUESTIONS
1. What are the data needed for the solution of the program to produce
the desired output?
The data required for the program's solution to produced the
desired output are the interest rate, the principal sum and the time.
2.What statements in the program that determine interest earned of each
type of account?
The following are the statement programs:
amount *0.015 = totalPersonalFinancial
amount *0.02 = totalPersonalHomeOwner
amount *0.025 = totalPersonalgold
amount *0.03 = totalSmallBusiness
amount *0.035 = totalBigBusiness
amount * 0.04 = totalgoldBusiness
3.What was the condition applied to satisfy the requirement?
The conditions used as index numbers for the options for
each account type are referred to as requirements. The
index number for interest and account type are identical.
A student took four quizzes in a term and would like to compute their average. He also would like to
know what will be the remarks. Follow the range of grades and its equivalent remarks, and then fill-
up the table below:
ALGORITHM
NARRATIVE PSEUDOCODE
int a,b,c,d;
• Input mark of 4 quiz
int tot= a+b+c+d;
• Add the remarks of 4 quiz to get total (tot)
double avg = tot/4;
• Divide the add value by 4 to get the average (avg)
If (avg>=95 && avg<=100)
• Use an if statement
print "Excellent"
• If avg greater than or equal to 95 and less than or
If (avg>=90 && avg<=94)
equal to 100, print "Excellent"
print "Very Satisfactory"
• If avg greater than or equal to 90 and less than or
If (avg>=85 && avg<=89)
equal to 94, print "Very Satisfactory"
print "Satisfactory"
• If avg greater than or equal to 85 and less than or
If (avg>=80 && avg<=84)
equal to 89, print "Satisfactory"
print "Fine"
• If avg greater than or equal to 84 and less than or
If (avg>=75 && avg<=79)
equal to 80, print "Fine"
print "Fair"
• If avg greater than or equal to 75 and less than or
If (avg>=74)
equal to 79, print "Fair"
print "Poor"
• If avg greater than or equal to 74, print "Poor"
SCREEN DISPLAY
QUESTIONS
1. What statement in the program that determines that the average is
passing
• double avg = tot/4;
If (avg>=80 && avg<=84)
If (avg>=95 && avg<=100)
print "Fine"
cout<<"Excellent"
If (avg>=75 && avg<=79)
If (avg>=90 && avg<=94)
print "Fair"
print "Very Satisfactory"
If (avg>=74)
If (avg>=85 && avg<=89)
print "Poor"
print "Satisfactory"
• We cannot use switch-case here because in switch case, every case takes a constant value
but here the values are ranged in a specific way to producue the exact average grade
remark. So if-else statements can be used instead of using any other better execution.
All variables are using data type int. Note that num1=3, num2=5, and num3=7.
if (num2> num3)
if (num1 > num2)
valueNum =num2;
else
valueNum =num3;
else
if (num2 > num3)
valueNum =num1;
else
valueNum = num3;
Record the output screen display:
The largest value of num1, num2 and num3