Question
C++ 1. Create a structure that stores the time in hours and minutes (the two fields). Create three constructors for the structure - a default
C++
1. Create a structure that stores the time in hours and minutes (the two fields). Create three constructors for the structure - a default constructor, a fully-parameterized constructor, and a constructor that just sets the hour.
2. Create a structure that is a counter. The structure has two fields - a field to store the current number and a field to store the unit of conversion. For example, a counter that keeps track of the laps a runner runs on a track will have a unit of conversion of 4, since 4 laps equal a mile. A counter that tracks minutes will have a conversion unit of 60, since 60 minutes equals 1 hour. Create a constructor for this structure that intitializes the current number to 0 and a parameter that sets the unit of conversion. Does it make sense to create a default constructor for this structure?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started