CODE IN C++ Language: Given two sets of inputs: a time (two inputs: the first is the hour which is an integer of 1-12, the second whether the time of the day is am denoted by 'a' or pm denoted by 'p'); and, a number n referring to how many hours is to be added which is an integer of 1-11, find the resulting time after we add the inputted time with the number of hours n inputted. Input The first line is two inputs: the first being the hour (1-12) and the second being am or pm ('a' or 'p'), The second line is any integer from 1 to 11 1 p 7 Output: The time in hours and whether am or pm. 8 pm

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section13.2: Arrays Of Structures
Problem 3E
icon
Related questions
Question

CODE IN C++ Language:

Given two sets of inputs:

  • time (two inputs: the first is the hour which is an integer of 1-12, the second whether the time of the day is am denoted by 'a' or pm denoted by 'p'); and,
  • a number n referring to how many hours is to be added which is an integer of 1-11,

find the resulting time after we add the inputted time with the number of hours n inputted.

Input

The first line is two inputs: the first being the hour (1-12) and the second being am or pm ('a' or 'p'), The second line is any integer from 1 to 11

1 p 7

Output:

The time in hours and whether am or pm.

8 pm
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning