Professional Documents
Culture Documents
COMPUTER PROGRAMMING
LAB 2: PROGRAM ON REPETITION USING while, do-while and for LOOP CONTROL
STRUCTURE (PROBLEM SOLVING)
DATE 17/11/2020
2.
3.
TOTAL MARKS
1) Analysis
3)
Program Development - Coding (Courier New, 10pt, 1sp, 3pt before & 3pt after)
2
4) Testing
Show the input you have inserted and also the program output console.
Test 1
Input 2
Output
Test 2
Input 4
Output
Test n
Input 6
3
Output
4
SECTION 2: PROGRAM DESIGN 2
3) Analysis
5)
Program Development - Coding (Courier New, 10pt, 1sp, 3pt before & 3pt after)
5
4) Testing
Show the input you have inserted and also the program output console.
Test 1
Input 3
Output
Test 2
Input 5
Output
Test n
Input 7
Output
6
POSSIBLE IMPROVEMENTS
Describe how you could improve your program if you had more time. What
improvements would make the program faster, more general, simpler, or easier to
understand?
Use variety of looping control to execute the command, while displaying the output
that we want. Show more result in the output other than given task in the lab session.
COMMENTS
Evaluate the lab. What did you learn from it? Was it too hard? Too easy? Suggest
improvements if you can.
From the lab session I learn how to use while, do-while and for loop control in
order to solve problem from the coding we create. It is not easy but we can practice by
do a lot of example problem solving regarding looping control structure.