bartleby

Concept explainers

Question
Book Icon
Chapter 14, Problem 4PE
Program Plan Intro

Program Plan:

1. Below mentioned variables are used:

  • input time value entered as input by the user.
  • hr− substring of input and holds the hour value.
  • min- substring of input and holds the Minutes value.
  • sec -substring of input and holds the Seconds value.
  • h−integer variable that holds the value of the hour.
  • m- integer variable that holds the value of minutes.
  • s- integer variable that holds the value of seconds.
  • AorP- integer variable which is 0 when time entered as AM or 1 if it is PM.

2. Below Mentioned functions are used:

  • invalidHr()-the function of class invalidHr which is for throwing invalid hour exception.
  • invalidMin()-the function of class invalidMin which is for throwing invalid minutes exception.
  • invalidSec()-function of class invalidSec which is for throwing invalid seconds exception.
  • main()-main function in the program that reads the input and prints the output.

Program Description:

The program is designed to show the 12 hour format input time in a 24-hour format. The program has three exceptional cases that are for inappropriate hours, minutes, or seconds. Three classes are defined to handle such exceptions.

Blurred answer
Students have asked these similar questions
I need to define and discuss the uses of one monitoring or troubleshooting tool in Windows Server 2019. thank you
I would likr toget help with the following concepts:  - Windows Server features - Windows Server versus Windows 10 used as a client-server network
I need to define and discuss the uses of one monitoring or troubleshooting tool in Windows Server 2019. thank you

Chapter 14 Solutions

Mindtap Computing, 1 Term (6 Months) Printed Access Card For Malik's C++ Programming: From Problem Analysis To Program Design, 8th (mindtap Course List)

Knowledge Booster
Background pattern image
Computer Science
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.
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT