CS10-8L: Computer Programming Laboratory
Machine Problem #5
Name: Diuyan, John Gabriel C. Score:
Section: A2 Date: September 20, 2024
OBJECTIVES
● To familiarize the students with the MATLAB interface.
● To enable the students to use some basic operations.
Instructions:
1. Save your file as Surname_Firstname_MP8. Ex. Santos_Jared_MP8
2. You will submit a zip file containing the following and send it to BB.
a. PDF file of Machine Problem 8 provided with the screenshot of your
answers.
b. MATLAB function script with .m extension.
3. Your program must have comments for each section.
Header Comments:
%{
This demo program shows how good a MATLAB program is
Written by: Raymond Sed
Date: August 27,2021
Time: 2:20pm
Program: BSIE
Course: CS10-8L
Section: B20
School: Mapua University
%}
MACHINE PROBLEM:
Using a repetition, write a program that will ask the user to enter a character from left or right. Then, the user will enter a number. The program
should generate a ladder of an integer from 1-9 only, wherein the level depends on the number entered, and the character should dictate whether
it faces right or left.
SAMPLE OUTPUT:
Input a Character: R
Input a Number: 3
Output
22
333
Input a Character: R
Input a Number: 6
Output:
22
Prepared by: Bon Ryan Fran
Prepared Date: Jan 17, 2024
333
4444
55555
666666
Input a Character: L
Input a Number: 5
Output:
MATLAB Assignment Rubric 1
21
1. File Naming 321
a. File is4321
correctly named with Surname_Firstname_MP4.
2. Header Comments
54321
a. Comprehensive header comments with a clear program
description, author information, and details.
3. Comments in Code
a. Thorough comments for each section of the code, including the
purpose and functionality.
4. Functionality
a. Code executes correctly and produces accurate results.
5. Output Formatting
a. Output is correctly displayed, rounded to two decimal places.
Prepared by: Bon Ryan Fran
Prepared Date: Jan 17, 2024
Prepared by: Bon Ryan Fran
Prepared Date: Jan 17, 2024