Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ENGR 1731B-Computing for Engineers Homework #7 Assigned: Mar 1. 2023 (Wed) Due: Mar 6.,2023(Mon) Print this sheet and include all your work. 1. Use if/else

image text in transcribed
ENGR 1731B-Computing for Engineers Homework \#7 Assigned: Mar 1. 2023 (Wed) Due: Mar 6.,2023(Mon) Print this sheet and include all your work. 1. Use if/else to solve this problem: If x is greater than or equal to zero, then assign the square root of x to the variable sqrt_ x and print out the result. Otherwise, print out an error message about the argument of the square root function and set sqrt_ x equal to zero. (MATLAB code and screenshot required) 2. Switch/Case Problem (MATLAB code and screenshot required) Write a program that allows a user to enter a string containing a day of the week ("Sunday," "Monday," "Tuesday," etc.) and uses a switch construct to convert the day to its corresponding number, where Sunday is considered the first day of the week and Saturday is considered the last day of the week. Print out the resulting day number. Also, be sure to handle the case of an illegal day name! (Note: Be sure to use the ' s ' option on function input so that the input is treated as a string.)

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

=+1 What would you do if you were the IHR manager?

Answered: 1 week ago