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
Select the two true statements about functions with parameters:
kondor19780726 [428]

Answer:

Option (B) and (C) is the correct option to the following question.

Explanation:

Because the function is the module of the program and we call that function again and again anywhere whenever we need that function in the program.

Function is used to carry out any operation which is used in the program many times and it creates the program short and simple.

<u>For example</u>: if we need to add or multiply two numbers many times in the program then, we create one or two functions for addition and subtraction or one program for both, when we need them we call them.

4 0
3 years ago
In Java, when a numeric variable is concatenated to a String using the ____, the entire expression becomes a String. a. string s
Anon25 [30]

Answer:

b) Plus sign

Explanation:

The plus sign or addition operator (+) accomplishes concatenation. This is a greatly used in the Java's output Statement to combine values coming from different data types into a formatted output

consider the code snippet below  which uses concatenation to output information about an individual

public class Name {

   public static void main(String[] args) {

   int age =18;

   String name = "John";

       System.out.println("His name is "+name +" and his age is "+age);

   }

}

The + operator has been used to concatenate the int value age and the String value stored in name to the output

5 0
3 years ago
Which statement is true?
Klio2033 [76]

Answer:

You need to import the deque methods in order to use a deque.

Explanation:

the correct option is B

You need to import the deque methods in order to use a deque.

Please mark me as brainliest

5 0
3 years ago
Read 2 more answers
Introduction to Programming Workbook
Lapatulllka [165]
Haije jiôes 1w mòé si aimx
3 0
3 years ago
Ingredient Adjuster
Semenov [28]

Answer:

#include <iostream>

using namespace std;

int main(){

float cookies=0;

float sugar=1.5;

float butter=1;

float flour=2.75;

cout<<"how many cookies do you want: "<<endl;

cin>>cookies;

float num = cookies/48;

cout<<num<<endl;

cout<< "to make " << cookies<<"cookies you need: "<<endl;

cout<<"sugar cups: "<<num*sugar<<endl;

cout<<"butter cups: "<<num*butter<<endl;

cout<<"flour cups: "<<num*flour<<endl;

return 0;

}

7 0
2 years ago
Other questions:
  • A resistor bank is connected to a controller with conductor insulation rated 75 °C. The resistors are not used in conjunction wi
    15·1 answer
  • Assuming that we only support BEQ and ADD instructions, discuss how changes in the given latency of this resource affect the cyc
    7·1 answer
  • The most useful index fossils are of organisms that are still alive today.
    11·2 answers
  • Only technical managers needs to know about programming, web view source code and about technology issues.
    12·1 answer
  • Hi! This is python coding. Please don't take advantage, actually, answer!
    11·1 answer
  • What is the name of the FOLDER in which the file named "script" is contained?
    13·1 answer
  • Explain the role of a computer in education​
    9·1 answer
  • Will give brainlyist
    7·2 answers
  • Characteristics of RAM​
    5·1 answer
  • Name at least three real-life objects that are instances of each of the following classes:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!