Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function nexthour that receives one integer argument, which is an hour of the day, and returns the next hour. This assumes a 12-hour

image text in transcribed
Write a function nexthour that receives one integer argument, which is an hour of the day, and returns the next hour. This assumes a 12-hour clock; so, for example the next hour after 12 would be 1. Here are two examples of calling this function >> fprintf ('The next hour will be %d" " , nexthour (3) ) The next hour will be 4. >> fprintf 'The next hour will be sd. In',nexthour (12)) The next hour will be 1. Requirements 1) The function must be saved as an m-file and not *.mlx a) the function name must be nexthour 2) The function must have the following block comments a) Description of what the function does b) Format of the function call c) Description of the input argument(s) d) Description of the output arguments(s) e) Programmer name and date written 3) When I call your function I must not see any results displayed in my command window end statement 4) the function must return the correct result Here is a generic example of a typical function format: function [outputArgi,outputArg2- untitled3(inputArg1,inputArg2) %UNTITLED3 Summa % Call the function as % [outputArgl'outputArg2] = untitled3(inputArg 1,inputArg2) % Detailed explanation goes here % Detailed explanation goes here % Detailed explanation goes here % contiguous comment block ry of this function goes here Non-contiguous comments go here outputArgi-inputArg1 ;outputArg2-inputArg2; end %

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 Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

How is the compensation for sales representatives determined?

Answered: 1 week ago

Question

8. Design office space to facilitate interaction between employees.

Answered: 1 week ago