c++编程题题库(34 页)Good is good, but better carries it.精益求精,善益求善。1.1编写一种基于对象的程序,规定:(1)定义一种时间类 Time,类内有私有数据组员 hour(小时)、minute(分钟)、sec(秒),公有组员函数set_time()、show_time()。(2)set_time()函数和 show_time()函数在类内定义。set_time()作用是从键盘输入时间、分钟、秒的值,show_time()的作用是在屏幕上显示时间、分钟、秒的值。(3)在 main()函数定义 Time 类的对象 t1,并调用 set_time()函数给时间赋值,调用show_time()函数输出时间的值。#include using namespace std;class Time {public: void set_time() {cin>>hour; cin>>minute; cin>>sec; } void show_time() {cout<using namespace std;class Box{public: void get_value(); void volume(); private: float lengh; float width; float height; };void Box::get_value(){ cout<<"please input lengh, width,height:"; cin>>lengh; cin>>width; cin>>height;}void Box::volume(){ cout<<"volmue of box1 is "<