Professional Documents
Culture Documents
Practical Exam # 2 Date JULY 30, 2023 Name Mina, Dianne Joy L. Score Filename: Content: PE - 1surname.m and PE - 2surname.m
Practical Exam # 2 Date JULY 30, 2023 Name Mina, Dianne Joy L. Score Filename: Content: PE - 1surname.m and PE - 2surname.m
docx
V
Practical Exam
2 Date
# JULY 30, 2023
Name MINA, DIANNE JOY L. Score
1.) The Gregorian calendar has the following number of days in a given month.
Sample Output:
1.) Input month (1-12) only: 9
9 is equivalent to September. It has 30 days.
2.) Input month (1-12) only: 2
2 is equivalent to February. It has 28 or 29 days.
3.) Input month (1-12) only:1 2
12 is equivalent to December. It has 31 days.
2.) Create a MATLAB program (using if-elseif-else) that will input time based on a 12-hour
clock and output its corresponding value based on a 24-hour clock. Display an error
message if the time entered is invalid.
Sample Output:
1.) Input time based on a 12-hour clock: 658
Input A or a for [AM] and P or p for [PM]: A
You entered 6:58 AM
The equivalent time based on a 24-hour clock is 6:58
2.) Input time based on a 12-hour clock: 1201
Input A or a for [AM] and P or p for [PM]: A
You entered 12:01 AM
The equivalent time based on a 24-hour clock is 0:01
3.) Input time based on a 12-hour clock: 1251
Input A or a for [AM] and P or p for [PM]: p
You entered 12:51 PM
The equivalent time based on a 24-hour clock is 12:51
4.) Input time based on a 12-hour clock: 809
Input A or a for [AM] and P or p for [PM]: p
You entered 8:09 PM
The equivalent time based on a 24-hour clock is 20:09
5.) Input time based on a 12-hour clock: 1601
Input A or a for [AM] and P or p for [PM]: A
You entered an INVALID time!
6.) Input time based on a 12-hour clock: 1089
Input A or a for [AM] and P or p for [PM]: p
You entered an INVALID time!
7.) Input time based on a 12-hour clock: 1145
Input A or a for [AM] and P or p for [PM]: S
You entered an INVALID time!
Criteria Score
1.1) Comment (Name, Course Code and Section, Date and Program Description) 10
1.2) Correct Program Logic 20
1.3) Correct Output 20
2.1) Comment (Name, Course Code and Section, Date and Program Description) 10
2.2) Correct Program Logic 20
2.3) Correct Output 20
Total 100
_______________________ _______________
Engr. Cheryl Mari M. Isip Date
C:\Users\cmmisip\Downloads\PE1_SetA_1Q1819.docx
V