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
andriy [413]
3 years ago
14

2.3 Code Practice: Question 3

Computers and Technology
1 answer:
Tpy6a [65]3 years ago
8 0

Answer:

Code in C++

Explanation:

C++ Code

#include<iostream> //for input and output  

using namespace std;  

int main()  

{  

  int hour;

  int minute;

  cout<<"Enter the hour:";

  cin>> hour;

  cout<<"Enter the minute:";

  cin>>minute;

  minute = minute+15;

  if(minute>=60){

   hour++;

   minute=minute-60;

  }

  if(hour>=24){

   hour=0;

  }

  cout<<"Hours: "<<hour<<endl;

  cout<<"Minutes:"<<minute;

  return 0;  

}

Code Explanation

First we need to declare two int variables to hold hour and minute values input from user.

Check if by adding 15 minutes into minute entered by user is greater then or equal to 60 then increment into hour and subtract 60 from minute.

Another check is that if user enters more then 24 hour or by making increment into hour, the hour values i greater then or equal to 24 then we need to change the hour to 0.

Result

Case 1:

Enter the hour:8

Enter the minute:15

Hours: 8

Minutes:30

Case 2:

Enter the hour:9

Enter the minute:46

Hours: 10

Minutes:1

You might be interested in
(tco 8) when asp.net receives a request for an application that uses forms-based authentication from a user who hasn't been auth
leonid [27]
Hi,

This what you are looking for: "records incorrect prompt"

Hope this helps.
r3t40
7 0
3 years ago
Lol who look at this so funny
seraphim [82]

Answer:

wow my humor is bad then.

6 0
3 years ago
Which of the following is a good question to ask during an informational interview?
grin007 [14]
How do you know your information is valid?
8 0
3 years ago
Read 2 more answers
In what ways is the human brain like a computer? In what ways is it different?
Nana76 [90]

Answer:

it is verry quick

Explanation:

djjdjdjdjdjd

7 0
4 years ago
How are companies protecting their users from internet assault
cluponka [151]

Answer: Companies and organization are taking several steps to secure their user from internet abuse  .The methods are mentioned as follows:-

  • Offering security technologies in the form of package along with the service so that the protection resource is not required to be installed or bought from elsewhere such as antivirus technologies.
  • Using the web servers that are available with high security features
  • Using the websites that persist the built-in feature of giving virus or malicious interruption warnings so that user can become alert
  • Making users aware about internet abuse and provide information so that they can identify such happening in the service.

4 0
4 years ago
Other questions:
  • "​the three legs of a project triangle are _____, scope, and time."
    8·1 answer
  • Which of the following functions sends the the GPA entered by the user to the calling function? A. def get_gpa(): gpa = float(in
    8·1 answer
  • Deciding whether to explode a process further or determine that it is a functional primitive is a matter of experience, judgment
    8·1 answer
  • Which of the following is the shortcut key combination for pasting copied text?
    11·2 answers
  • Which of the following is one way a corporation can raise money?
    14·1 answer
  • a sign is to be hung from the end of a thin pole, and the pole supported by a single cable. your design firm brainstorms the six
    13·1 answer
  • Ba esti prost?<br> Ba esti nebun?<br> Ce ai?
    5·2 answers
  • The Publisher-Subscriber design pattern is used to create __________________ communication between software objects and is used
    13·1 answer
  • Call of duty vanguard, war zone , fornite, gta what’s your favorite
    11·1 answer
  • Part B How could installing new technology, such as scrubber machines, affect the factories required to install them? Name a pos
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!