Question
Function Name: citizenWatch Inputs: Extra Credit 1. (double) T he current position of the hour hand 2. (double) T he current position of the minute
Function Name: citizenWatch Inputs:
Extra Credit 1. (double) T he current position of the hour hand 2. (double) T he current position of the minute hand 3. (double) A positive or negative number of minutes
Outputs: 1. (double) The position of the hour hand after the specified time 2. (double) T he position of the minute hand after the specified time Background:
The moment is finally here. Youve been saving up your whole life and now you can finally afford a Citizen watch! You decide to go to Ross to buy your very own, brand new Citizen watch. Unfortunately, your friend Sam presses a random button on your Citizen watch and youre worried that he broke it. To make sure he didnt, you decide to write a MATLAB function to determine where the hour and minute hands would be after a certain amount of time has passed so that you can make sure your Citizen watch is still working properly.
Function Description: This function will take in the current position of the hour hand, as an integer between 0 and 11 (0 for noon/midnight), the current position of the minute hand, as an integer between 0 and 59 (0 for "on-the-hour") and a positive or negative number of minutes elapsed. Given this information, determine the new position of the clock hands. You should assume that the hour hand does not move until the next hour has begun. For example, the hour hand stays on 2 from 2:00 until 2:59 and only at 3:00 does the hour hand move to 3.
Example [hour, min] = citizenWatch(11, 30, 122) hour 1 min 32
Notes: The mod() and floor() functions will be useful. As you do this problem, notice the behavior of mod() when the first input is negative.
Hints: Information on using mod in this manner: Khan Academy - Better Explained
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started