This program should help clarify to you the use of inheritance (and possibly polymorphism -- see the options below).
You recently visited a clock shop and it started you thinking about a virtual clock shop -- perhaps for internet clock sales. Folks could come in (connect to the site) and see how the clocks behaved (alarms, ticking, etc.). Hmm...how to do it?
Aha! All clocks share common attributes, you realize. The different clocks behaviours can be implemented as different methods in each particular clock sub-class. The common attributes in super-classes. It's a tremendous idea!
Hmm...what kinds of attributes do clocks have? Well, they all have a type of power source (battery, solar, pendulum, etc.) and a 'name' (grandfather, alarm, sundial, watch, clock-radio, etc.). They all tell the time (hour, minute, second). They all have a 'face' where they display this time.
And then there are sub-groups of clocks which share attributes. All alarm clocks have a time at which the alarm will go off (at least one). All grandfather clocks chime some tune. All watches have some sort of band or chain to connect them to the person wearing them.
And finally the lowest level groupings like clock-radios, CD-clocks, cuckoo clocks, etc.
Other features which might be more sporadically supplied are: military/12-hour switchability, multiple alarms, temperature, date, sleep timer, etc.
Remember, don't try to do graphics and sound here. Think display a message to get my information across. Perhaps a 'tick-tock' message to show a clock is working. Perhaps a line from a song for the grandfather or clock-radio. Perhaps a 'beep-beep-beep' or 'clang-clang' for an older alarm. Or maybe a 'Ask NOT for whom the bell tolls! It tolls for thee!' for a themed alarm clock.
Visitors to your shop could play with individual clocks to see the feature list, set the alarm and see what it 'sounds' like, see how it displays its time (and date?), etc.
Randomly create clocks to fill your shop. Then let the user search through them with a simple menu interface. Place the clock hierarchy in a library (clocks?) for easy re-use.
Hint: For much of the data above, you can use arrays of C-strings which you randomly index as you create (constructor form of new) or re-assign (call set methods) each clock. Numeric data (all the clocks in even a single house -- much less clock store -- are hardly ever on the same time) can simply be randomized as you've done previously.
It makes no sense to me, but people keep wanting to call the functions localtime and asctime from the standard C library ctime. Just don't! They do nothing useful here! (And asctime leaves a mess behind you would probably forget to clean up even if you knew how!)
This assignment is (Level 4).
Add (Level 2) to extract the common interfaces and make the hierarchy polymorphic.