1answer.
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]
4 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]4 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
Last semester, Henri bought his textbooks over the Internet and saved a considerable amount of money. Classes start in a few day
castortr0y [4]

Answer:

limited problem solving

Explanation:

Henri will probably use a limited problem-solving process, we reach this conclusion due to two factors:

  1. The time he has to take the decision is short, therefore he can calmly evaluate his options
  2. His past positive experience in buying books online will influence his decision

I hope you find this information useful and interesting! Good luck!

3 0
3 years ago
Read 2 more answers
Reputable firms often ask recent graduates to pay an up-front fee for a job.
wolverine [178]

Answer:

What is your question?

Explanation:

7 0
3 years ago
Read 2 more answers
In the past, data was transferred from OTLP databases to data warehouses periodically, say once a month or even once a week. Now
Vinvika [58]

Answer:

Active is the correct answer of this question.

Explanation:

In active database is a database that contains a tournament-driven infrastructure that can adjust to circumstances within the database and beyond. Alternate  include safety tracking, contacting, collecting and approving information.A move is towards active or real-time data storage so that applications can evaluate and help decision making use of current data.

3 0
4 years ago
WHAT ARE THE CONTENTS THAT WE SHOULD USE FOR THE PRESENTATION OF DIGITAL WORLD
Lana71 [14]

Answer:

Introduction

Importance

Advantages

Disadvantages

Effects

Conclusion

8 0
3 years ago
Now write a program named GreenvilleRevenue that prompts a user for the number of contestants entered in last year’s competition
ss7ja [257]

Answer:

The c# program is given below.

using System;

class GreenvilleRevenue  

{

   static void Main() {

       // variable declared and initialized simultaneously

       int fees = 25;

       int last, present, rev;

       Console.WriteLine( "Enter the number of contestants participating in last year’s competition " );

       last = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine( "Enter the number of contestants participating in this year’s competition " );

       present = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine( "Number of Participants in last year's competition  \t\t" + last);

       Console.WriteLine( "Number of Participants in present year's competition   \t" + present);

       rev = present*fees;

       Console.WriteLine( "Revenue expected in this year’s competition is \t\t\t$" + rev );

       if(last < present)

           Console.WriteLine( "Participants are more this year" );

       else if(last > present)

           Console.WriteLine( "Participants are less this year" );

       else if(last == present)

           Console.WriteLine( "Participants are same both years" );

   }

}  

OUTPUT

Enter the number of contestants participating in last year’s competition  

111

Enter the number of contestants participating in this year’s competition  

123

Number of Participants in last year's competition    111

Number of Participants in present year's competition    123

Revenue expected in this year’s competition is   $3075

Participants are more this year

Explanation:

This program takes input from the user. The input is not validated as this is not mentioned in the question.

1. An integer variable is declared and initialized by the fees of this year’s competition.

2. Integer variables are declared to store participants for last year, present year and revenue earned in the present year.

3. User enters the number of participants in last year’s competition.

4. User enters the number of participants in this year’s competition.

5. All the input from the user is displayed.

6. The revenue earned in this year’s competition is computed and displayed.

7. The message is also displayed whether number of participants this year is greater or not than the last year.

8. Also, if participants are same in both years, the message is displayed accordingly.

6 0
4 years ago
Other questions:
  • Can some one please help The term career is usually applied to a what PLEASEEEEEEEEEEEE HEEEEELLLLLPPPPP MEEEEEE
    7·1 answer
  • Rather than a single address, you can refer to an array using their first (top/Left) and last (bottom/right) addresses separated
    15·1 answer
  • What is the systems development life cycle?1) Involves describing the desired features and operations of the system. 2) Involves
    15·1 answer
  • Write a single if-test using Boolean operators and relaional operators to determine if a double variable x is between zero (excl
    11·1 answer
  • 2) Show the decimal equivalent of each of the numbers if they are interpreted as (4 answers): 11001101 01101001 a. Unsigned bina
    15·2 answers
  • What are the economic, social, political and cultural effects of the West Indian Day Parade
    12·1 answer
  • Anybody got a quisten
    12·1 answer
  • Which work habits should you follow to increase work efficiency and avoid health issues?
    6·1 answer
  • ___1. my1st JavaProgram<br> A. valid <br> B. invalid
    13·1 answer
  • Limited time only for christmas give yourself free 100 points YES YES yes yes yes
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!