Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Put all answers in a MATLAB script Problem 7: Write a function days_in _month.m to display the number of days in a givern month. The

Put all answers in a MATLAB script

image text in transcribed

Problem 7: Write a function days_in _month.m to display the number of days in a givern month. The function should have the header: function days-days in month(month, leap) where the input month is an all-lower-case string denoting the first three letters of the month. The input leap has logical value (0 or 1) indicating the leap year. The output days displays the number of days in the input month. February has 28 days (29 days in leap year). The following months have 30 days: April, June, September and November. Other months have 31 days. In cases where the inputs are invalid, the output days should be the string 'Invalid inputs'. The function should include a description. Use nested switclh statements (a) Set p7a-evalc('help days in month') (b) Set p7b-days_in month('jan',0) (c) Set p7c-days in month('feb',0) (d) Set p7d-days_in month('feb',1) (e) Set p7e-days in month('apr',0) (f) Set p7f-days in month('aug',1) (g) Set p7g-days_in month('oct',0) (h) Set p7h-days in month('nov',1) (i) Set p7i-days in month('Dec',0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions