0% found this document useful (0 votes)
56 views4 pages

MATLAB Loops Machine Problem Guide

The document outlines the objectives and instructions for Machine Problem #14 in a Computer Programming Laboratory course, focusing on loops in MATLAB. Students are required to create a program that identifies odd and even numbers from a user-inputted integer, calculates the sum of even numbers, and the product of odd numbers. Submissions must include a PDF with screenshots and a MATLAB script, both properly commented.
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)
56 views4 pages

MATLAB Loops Machine Problem Guide

The document outlines the objectives and instructions for Machine Problem #14 in a Computer Programming Laboratory course, focusing on loops in MATLAB. Students are required to create a program that identifies odd and even numbers from a user-inputted integer, calculates the sum of even numbers, and the product of odd numbers. Submissions must include a PDF with screenshots and a MATLAB script, both properly commented.
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

CS10-8L: Computer Programming Laboratory

Machine Problem #14: Loops

Name: MINA, DIANNE JOY L. Score:

Section: FOPI01 Date: JULY 30, 2023

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_MP13. Ex. Isip_Cheryl_MP13

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

a. PDF file of Machine Problem 14 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
%}

Prepared by: Cheryl Mari M. Isip, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #14: Loops

Problem Statement:

The program will ask for a number. Then will display the odd numbers on that number, Then on
the next line will show the even numbers from the number we have input.
Then Add up all Even numbers…..and Multiply all the Odd numbers

Input Validation:
Input an integer.
In the editor window, take a screenshot and paste your output:

Sample Run:
Input a number: 15
Odd Number: 1 3 5 7 9 11 13 15
Even Number: 2 4 6 8 10 12 14
Sum of Even Numbers: 56
Product of Odd Numbers: 2027025

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 #14: Loops

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 #14: Loops

Prepared by: Cheryl Mari M. Isip, Mapua University

You might also like