answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
11Alexandr11 [23.1K]
2 years ago
7

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

es a 12-hour clock; so, for example, the next hour after 12 would be 1. Here are two examples of calling this function.
Computers and Technology
1 answer:
Alexandra [31]2 years ago
4 0

COMPLETE QUESTION:

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.\n', nexthour(3))

the next hour will be 4

>> fprintf('The next hour will be %d.\n', nexthour(12))

the next hour will be 1

Answer:

The following CODE in MATLAB will accomplish this

<em>>> nexthour = input('Please enter a time here: ');</em>

<em>if (nexthour >= 1) && (nexthour< 12)</em>

<em>nexthour = nexthour+ 1</em>

<em>elseif (nexthour == 12)</em>

<em>nexthour = 1</em>

<em>else </em>

<em>disp('You entered an invalid time')</em>

<em>end</em>

Explanation:

In the Matlab code above, the input function is used to receive a value for time in hours (1-12) next we use the if statement to check that the time entered is between 1 and 11 and add 1 as the next hour, else if the value entered is 12, we assign 1 as the next hour. For every other inputs an error message is displayed.

You might be interested in
Lucas put a lot of thought into the design for his company's new white paper. He made sure to include repeating design elements
Alenkasestr [34]
C. provide consistency
8 0
2 years ago
Read 2 more answers
____ is a program placed on a computer without the user's knowledge that secretly collects information about the user
Scrat [10]
<span>Spyware is a program placed on a computer without the user's knowledge that secretly collects information about the user.
</span><span>The spyware gathers information and can send this information to another program or entity which can take control over the device or use personal information to harm the user. </span>
7 0
1 year ago
QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
IgorLugansk [536]

Answer:

yes cuz 25x8=200

Explanation:

3 0
2 years ago
Read 2 more answers
Given sphereRadius and piVal, compute the volume of a sphere and assign to sphereVolume. Look up the equation online (e.g., http
fenix001 [56]

Answer:

  1. #include <stdio.h>
  2. int main()
  3. {
  4.    const double piVal = 3.14159;
  5.    double sphereVolume = 0.0;
  6.    double sphereRadius = 0.0;
  7.    
  8.    sphereRadius = 1.0;
  9.    sphereVolume = 4.0/ 3.0 * piVal * sphereRadius * sphereRadius * sphereRadius;
  10.    
  11.    
  12.    printf("Sphere volume: %lf\n", sphereVolume);
  13.    return 0;
  14. }

Explanation:

Firstly we can identify the formula to calculate volume of sphere which is

Volume = 4/3 \pi r^{3}

With this formula in mind, we can apply this formula to calculate the volume of sphere in Line 10. This is important to perform floating-point division 4.0/3.0 to ensure the resulting value is a floating value as well. Since we have been given piVal and sphereRadius, we can just multiply the result of floating-point division with piVal and sphereRadius and get the sphereVolume value.

At last, display the sphere volume using printf method (Line 13).

6 0
2 years ago
Which of the following corresponds to the computer interface technology that uses icon, etc?
Aleksandr [31]

Answer:

D) GUI

Explanation:

GUI an acronym for Graphical user interface, is a type of user interface where a user interacts with a computer or an electronic device through the use of graphics. These graphics include icons, images, navigation bars etc.

GUIs use a combination of technologies and devices to create a layout that users can interact with and perform tasks on. This makes it easier for users who do have basic computer skills to utilize.

The most common combination of these elements is the windows, icons, menus and pointer paradigm (WIMP) . GUIs are used in mobile devices, gaming devices, smartphones, MP3 players etc.

6 0
1 year ago
Other questions:
  • If you want to present slides to fellow students or coworkers which productivity software should you use to create them A. Word
    14·2 answers
  • Which of the following best describes the concept behind Web 2.0
    5·1 answer
  • Gabe wants to move text from one document to another document. He should _____.
    10·2 answers
  • Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
    6·2 answers
  • Software code is tested, debugged, fixed, verified, and then:
    11·1 answer
  • ______ is a statistic that measures how quickly the staff corrected a network problem after they arrived at the problem site. MT
    9·1 answer
  • "Suppose there is a class Alarm. Alarm has two class variables, code which contains a String value representing the code that de
    10·1 answer
  • Sara is having a tough time finding the cause of a problem on a computer she is troubleshooting. She found a possible problem bu
    15·1 answer
  • Write an expression to print each price in stock prices.
    15·1 answer
  • The maximum number of times the decrease key operation performed in Dijkstra's algorithm will be equal to ___________
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!