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. You’ve 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 you’re worried that he broke it. To make sure he didn’t, 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
function [hour, min] = citizenWatch(hour,min,minsPassed)
totalMins=hour*60+min;
mins=totalMins+minsPassed;
hour=floor(mins/60);
min=mod(mins,60);
if mins<0
hour=12+hour;
end
if hour>=12
hour=mod(hour,12);
end
end
Function Name: citizenWatch Inputs: Extra Credit 1. (double) T he current position of the hour hand...
MATLAB code help! Function Name: chemTimer Inputs: 1. (double) The current position of the hour hand 2. (double) The 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) The position of the minute hand after the specified time Background: Oh no, you were running late to your Chem lab and completely forgot your reaction timer! It's a good thing...
MATLAB code help! Function Name: jackSparrow Inputs: 1. (double) A 1x2 vector describing your hand 2. (double) A 1x2 vector describing Jack Sparrow's hand 3. (double) A vector with the next cards to be drawn from the deck Outputs: 1. (char) A description of the game outcome Background: You're out at sea with the infamous Jack Sparrow, and it's a pretty calm day. Without anything better to do, Jack Sparrow challenges you to his favorite card game: BlackJack (Sparrow edition)...
Function Name: fluxCapacitor Inputs: 1. (double) The current year 2. (double) Destination year 3. (double) Speed, in miles per hour Outputs: 1. (char) String stating whether you’re going back or forward into the future Background: Doc Brown has invited you on an adventure through time. As you two hop into the time-travelling Delorean, he inputs the current year and the destination year. As the Doc steps on the gas, he reminds you that you can’t interact with ANYONE, or you’ll...
Using MATLAB, please read question well Function Name: stPaddysFeast Example search- Inputs 1 (struct) A MxN structure array 2. double) A 1x2 vector of your starting position: [row, column] next: [1, 3] next: [1, 1] next: [2, 1) food: 'potato food potato next: 2, 3] step 2 food: start next: [2, 2] food: 'potato' step 3 Outputs next [1, 21 food: food: 1. (ohar)A descriplion of how mary potatoes you found ad where you stopped looking step 4 (stop) Background...
MATLAB code help!!! Function Name: sportsStats Inputs: 1. (double) An Nx5 array representing the stats of different football teams 2. (double) The cutoff for total penalties Outputs: 1. (double) An Mx5 array representing the updated stats Background: You just finished watching the Patriots defeat the Rams in Super Bowl LIII, and you just can't wait for the next season to start. However, instead of waiting around for the next football season, you decide to take matters into your own hands...
Write in C++ please In Chapter 10, the class clockType was designed to implement the time of day in a program. Certain applications, in addition to hours, minutes, and seconds, might require you to store the time zone. Derive the class extClockType from the class clockTypeby adding a member variable to store the time zone. Add the necessary member functions and constructors to make the class functional. Also, write the definitions of the member functions and the constructors. Finally, write...
Name: ___________________________________ N241 Human Reproduction & Sexuality Thinking Critically Worksheet Answer the following questions. Please be descriptive in your answers. (4 points) During a prenatal class, you are going to teach the women and their partners about the process of labor and how it progresses. You decide the best approach is to discuss the Ps of labor. Describe what you will present related to the Ps. (4 points) Cindy is in early labor and has a few questions for the...
Function name: crazy_scrabble Parameters : word (string), current points (int), double word score (boolean) Returns: int Description: You are playing scrabble with a friend, and you thought you knew how to calculate how many points you have, but your friend suddenly starts making up all these crazy rules. Write a function that helps keep track of how many points you have with these new rules: ●Each 'k', 'm', 'p', 'x', 'y', and 'z' earns you 7 points. ●'c' and 's'...
Santa Monica College CS 20A: Data Structures with C++ Spring 2019 Name: True/False: Circle one Assignment 1 ID: 1. True / False 2. True / False 3. True / False 4. True / False 5. True / False 6. True / False 7. True / False 8. True / False 9. True / False 10. True / False Variable and functions identifiers can only begin with alphabet and digit. Compile time array sizes can be non-constant variables. Compile time array...