You are on page 1of 4

CS10-8L: Computer Programming Laboratory

Machine Problem #5: Variables, Input and Output

Name: Orcio, Sheena Nicole M. Score:

Section: C3 Date:06/16/2021
6/2021

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_MP5. Ex. Santos_Jared_MP5

2. You will submit the following and send it to BB.

a. PDF file of Machine Problem 5 provided with the screenshot of your answers.
b. MATLAB script with .m extension.

3. Your program must have comments for each section.


Header Comments:
%{
Short Description of the Program
Written by: Your Name
Date: June 13, 2021
Time: 2:20pm
Program: BSIE
Course: CS10-8L
Section: B2
School: Mapua University
%}
4. Your output should be displayed rounded to two decimal places.

5. You’re not allowed to use conditional or repetition statements.

6. Follow the output design as shown below.

7. Submission is on or before Thursday (June 17), 11:59pm.

Prepared by: Engr. Cheryl Mari Isip, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #5: Variables, Input and Output

MACHINE PROBLEM

1. The formula for computing the final amount if one is earning compound interest is given on Wikipedia as

Write a MATLAB program that assigns the principal amount of 10000 to variable P, assign to n the value 12, and
assign to r the interest rate of 8% (0.08). Then have the program prompt the user for the number of years, t, that the
money will be compounded for. Calculate and print the final amount after t years.

In the editor window, take a screenshot and paste your output:

Prepared by: Engr. Cheryl Mari Isip, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #5: Variables, Input and Output

In the command window, take a screenshot and paste your output:

Prepared by: Engr. Cheryl Mari Isip, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #5: Variables, Input and Output

Prepared by: Engr. Cheryl Mari Isip, Mapua University

You might also like