0% found this document useful (0 votes)
137 views7 pages

Lab 2 Section 1 PDF

This document is a lab report for a computer programming course. It provides instructions for an assignment to write a program that accepts a number between 1 and 12 and displays the corresponding month name using a switch statement. The lab report outlines the requirement, analysis, program design, testing process, possible improvements, and comments on the lab session. It directs students to test their program with different inputs and outputs and provide feedback on what they learned.

Uploaded by

Azieman Mustaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views7 pages

Lab 2 Section 1 PDF

This document is a lab report for a computer programming course. It provides instructions for an assignment to write a program that accepts a number between 1 and 12 and displays the corresponding month name using a switch statement. The lab report outlines the requirement, analysis, program design, testing process, possible improvements, and comments on the lab session. It directs students to test their program with different inputs and outputs and provide feedback on what they learned.

Uploaded by

Azieman Mustaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

FAKULTI TEKNOLOGI KEJURUTERAAN

ELEKTRIK DAN ELEKTRONIK


UNIVERSITI TEKNIKAL MALAYSIA MELAKA

COMPUTER PROGRAMMING

BEEA1343 SEMESTER 2 SESI 2018/2019

LAB 2: PROBLEM SOLVING USING SELECTION STATEMENTS

NO. STUDENTS' NAME MATRIC. NO.

1. AZRUL BIN ABD RAZAK B091810433

2. MUHAMAD REDHUAN BIN MAT ROMZI B091810206

3. MUHAMMAD HAZIQ IQMAL BIN MOHD NORDIN B091810257

PROGRAMME BMMD

SECTION /
1/1
GROUP

DATE 11/03/2019

1. PUAN DAYANASARI
NAME OF
INSTRUCTOR(S)
2.

EXAMINER’S COMMENT(S) TOTAL MARKS

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

Input Process Output


Month number - (Answer) Month name

2
3) PROGRAM DESIGN

Start

What month were born?

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

You might also like