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
FrozenT [24]
3 years ago
11

Write a program that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result. Example 1: Enter t

he hour: 8 Enter the minute: 15 It displays: Hours: 8 Minutes: 30 Example 2: Enter the hour: 9 Enter the minute: 46 It displays: Hours: 10 Minutes: 1
Computers and Technology
1 answer:
Liula [17]3 years ago
5 0

Answer:

Explanation:

C++ Code

#include <iostream>

#include <cstdlib>

using namespace std;

int main(){

double hour,minute;

cout<<"Enter Hours :";

cin>>hour;

cout<<"Enter Minutes :";

cin>>minute;

minute = minute+15;

if(minute >=60){

 hour++;  

 minute = minute-60;

}

if(hour>23){

 hour = 0;

}

cout<<"Hour: "<< hour<< " Minutes: "<<minute;

return 0;  

}

Code Explanation

First take hours and minutes as input. Then add 15 into minutes.

If minutes exceeds from 60 then increment into hours and also remove 60 from minutes as hours already incremented.

Then check if hours are greater then 23 then it means new day is start and it should be 0.

Output

Enter Hours :9

Enter Minutes :46

Hour: 10 Minutes: 1

You might be interested in
The following method is intended to remove all values from the ArrayList a that have the same value as val; however, this method
Alona [7]

Answer:

ArrayList a contains [2, 3, 3, 3, 4, 5, 3, 2, 1]

Explanation:

Given

The removeValue method

Required

The content of ArrayList a, after the method is called

From the question, we understand that arraylist a is:

a= [2, 3, 4, 3, 3, 4, 4, 5, 4, 3, 2, 1]

val =4

The function fails when the value to be removed appear consecutively in the list.

4 appears in index 5 and 6 of the list. Only one of the 4's will be removed

So, the updated list will be: [2, 3, 3, 3, 4, 5, 3, 2, 1]

6 0
3 years ago
Which of the following qualifies as a teamwork skill? A. Free associating B. Multitasking C. Listening D. Problem solving
NeX [460]

There are certain skills that are required to be a good team member or team leader. A main characteristic of the required skills would be those that can be used in interacting with other people, since that is a main feature when working in teams.

From the given options, only one skill would be most suitable to be used when dealing with other people, which is (C) listening.  

4 0
3 years ago
Tipos de lenguajes relacionados con c++?
Ber [7]

Answer:

Programación Java, Programación Python, Ruby

Explanation: Porque ellas son ...

3 0
3 years ago
<img src="https://tex.z-dn.net/?f=%5Cmathcal%7B%5Cfcolorbox%7Bblue%7D%7Byellow%7D%7B%5Cred%7BQUESTIONS%3A%7D%7D%7D" id="TexFormu
Paraphin [41]

Answer:

1. A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other.

2. A computer network comprises two or more computers that are connected—either by cables (wired) or WiFi (wireless)—with the purpose of transmitting, exchanging, or sharing data and resources

3. LANs are only designed to connect devices. ... In comparison, WANs can connect all of these same devices as well as LANs. In other words, a WAN can connect multiple LANs together so that all of their respective devices can communicate with each other. WANs are also more difficult to set up and maintain than LANs

Explanation:

hope this helps u

4 0
3 years ago
Read 2 more answers
Ask what kind of pet the user has. If they enter cat, print "Too bad...", if they enter dog, print "Lucky you!" (You can change
nirvana33 [79]

Answer:

Explanation:

a = input("what kind of pet the user has")

if a == 'cat':

  print("Too bad")

elif a == 'dog':

   print("Lucky you!")

8 0
3 years ago
Other questions:
  • A prime number is a number that is only evenly divisble by itself and 1.
    12·1 answer
  • What are 2 main differences betweenarrays andstructs?
    7·1 answer
  • In an oblique drawing, which lines can be measured accurately, if there is no foreshortening?
    10·1 answer
  • How does design influence the product's function?
    5·1 answer
  • Computer science practical on VB.NET. program 1. program to find the square of a number. write the code achieve it​
    6·1 answer
  • Assume a large shared LLC that is tiled and distributed on the chip. Assume that the OS page size is 16KB. The entire LLC has a
    8·1 answer
  • The process of sending a result back to another part of the program is
    14·1 answer
  • Ứng dụng 1 số phần mềm cho quá trình kiểm tra đánh giá
    7·1 answer
  • With _________, it is easy to target a specific geographic location. Which answer completes the blank in the sentence?
    5·1 answer
  • PLS HELP subject (Microsoft Excel ) True or False:
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!