Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CS10-8L: Computer Programming Laboratory

Machine Problem #5: Conditional

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

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

a. PDF file of Machine Problem 4 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: Raymond Sedilla
Date: August 27,2020
Time: 2:20pm
Program: BSIE
Course: CS10-8L
Section: B20
School: Mapua University
%}

MACHINE PROBLEM

Create a program that will ask input from the user of their age. If the user input value
lower than 18, then you have to display “The user is not of legal age yet” and the
program will then exit. If the user input higher than 17, you have to ask for another input
about gender.

If the user responds “M” then display “Your input is within the range of legal age
for Male” if the input is higher than 20, otherwise display “Your input is not within
the range of legal age for Male”.

If the user responds “F” then display “Your input is within the range of legal age for
Female” automatically.

Clear the window every time you are going to run the script.

Prepared by: Raymond Sedilla, Mapua University


This study source was downloaded by 100000833737567 from CourseHero.com on 06-17-2022 06:51:48 GMT -05:00

https://www.coursehero.com/file/106316174/Machine-Problem-5docx/
CS10-8L: Computer Programming Laboratory
Machine Problem #5: Conditional

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

Prepared by: Raymond Sedilla, Mapua University


This study source was downloaded by 100000833737567 from CourseHero.com on 06-17-2022 06:51:48 GMT -05:00

https://www.coursehero.com/file/106316174/Machine-Problem-5docx/
CS10-8L: Computer Programming Laboratory
Machine Problem #5: Conditional

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

Prepared by: Raymond Sedilla, Mapua University


This study source was downloaded by 100000833737567 from CourseHero.com on 06-17-2022 06:51:48 GMT -05:00

https://www.coursehero.com/file/106316174/Machine-Problem-5docx/
Powered by TCPDF (www.tcpdf.org)

You might also like