Lab 2 Section 1 PDF
Lab 2 Section 1 PDF
COMPUTER PROGRAMMING
PROGRAMME BMMD
SECTION /
1/1
GROUP
DATE 11/03/2019
1. PUAN DAYANASARI
NAME OF
INSTRUCTOR(S)
2.
1
LAB REPORT FORMAT FOR BEEA 1343 – COMPUTER PROGRAMMING
SECTION 1:
1) REQUIREMENT
Write a program that accepts a number between 1 to 12 and display the name of the
corresponding month. For example if the user types '1' the program will display 'January',
if the user types '2' the program will display 'February' and so on. If user types in numbers
other than 1 to 12, program will display an invalid message to warn the user. You are
required to use switch for the month selection part.
2) ANALYSIS
2
3) PROGRAM DESIGN
Start
NO
1<month
Invalid month
<12
YES
YES
If 1 JANUARY
NO
YES
If 2 FEBRUARY
NO
YES
If 3 MARCH
NO
YES
APRIL
If 4
NO
YES
If 5 MAY
3
NO
YES
If 6 JUNE
NO
YES
JULY
If 7
NO
YES
If 8 AUGUST
NO
YES
If 9 SEPTEMBER
NO
YES
If 10 OCTOBER
NO
YES
NOVEMBER
If 11
NO
YES
If 12
DECEMBER
End
4
4) TESTING
Show the input you have inserted and also the program output console.
Test 1
Input
Output
Test 2
Input
Output
Test 3
Input
Output
**Repeat no (1) – (4) for all questions (Section 1, Section 2 and Section 3) in lab
sheet.
5) 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?
You might have two different optimization goals that might sometimes conflict
with each other. For example, to optimize the code for performance might
conflict with optimize the code for less memory footprint and size. You might
have to find a balance.
Performance optimization is a never-ending process. Your code might never
be fully optimized. There is always more room for improvement to make your
code run faster.
5
6) COMMENTS
Evaluate the lab. What did you learn from it? Was it too hard? Too easy? Suggest
improvements if you can.
From our observation, this lab session was moderate because at the end of the lab
we can run the coding but we need more time to do it if in individual session. Our
suggestion to improve is we need to do more exercises so that we can improve
ourselves in this subject.
6
7