0% found this document useful (0 votes)
97 views

Machine Problem 3

This document provides instructions for Machine Problem 3, which involves writing a MATLAB program to calculate compound interest. Students are asked to: 1) Define variables for the principal amount, interest rate, and number of times compounded per year 2) Prompt the user to input the number of years and calculate the final amount 3) Include header comments and display output rounded to two decimal places 4) Submit a zip file containing the MATLAB script and screenshots of code and output
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Machine Problem 3

This document provides instructions for Machine Problem 3, which involves writing a MATLAB program to calculate compound interest. Students are asked to: 1) Define variables for the principal amount, interest rate, and number of times compounded per year 2) Prompt the user to input the number of years and calculate the final amount 3) Include header comments and display output rounded to two decimal places 4) Submit a zip file containing the MATLAB script and screenshots of code and output
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CS10-8L: Computer Programming Laboratory

Machine Problem #3: Variables, Input and Output

Name: Score:

Section: Date:

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_MP3. Ex. Isip_Cheryl_MP3

2. You will submit a zip file containing the following and send it to BB.

a. PDF file of Machine Problem 3 provided with the screenshot of your answers.
b. MATLAB 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: Cheryl Isip
Date: August 27,2021
Time: 2:20pm
Program: BSIE
Course: CS10-8L
Section: B20
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.

MACHINE PROBLEM

Prepared by: Cheryl Mari M. Isip, Mapua University


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

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: Cheryl Mari M. Isip, Mapua University


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

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

Prepared by: Cheryl Mari M. Isip, Mapua University


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

Prepared by: Cheryl Mari M. Isip, Mapua University

You might also like