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 "<