早教吧作业答案频道 -->其他-->
errorC2360:initializationof'box1'isskippedby'case'label//定义盒子Box类,要求具有以下成员:可设置盒子形状;可计算盒子体积;可计算盒子的表面积.#include"iostream"usingnamespacestd;#include"string.h"//定
题目详情
error C2360:initialization of 'box1' is skipped by 'case' label
//定义盒子Box类,要求具有以下成员:可设置盒子形状;可计算盒子体积;可计算盒子的表面积.
#include"iostream"
using namespace std;
#include"string.h"
//定义Box类
class Box
{
private:
int height;
int width;
int length;
public:
Box(int h,int w,int len);//构造函数--长方体
Box(int len); //构造函数--正方体
int cvolume();
int zvolume();
int carea();
int zarea();
};
Box::Box (int h,int w,int len)
{
height=h;
width=w;
length=len;
}
Box::Box(int len)
{
length=len;
}
int Box::cvolume()
{
return(height*width*length);
}
int Box::zvolume()
{
return(length*length*length);
}
int Box::carea()
{
int s;
s=2*(length*width+width*height+length*height);
return(s);
}
int main()
{
int i,len,w,h;
couti;
switch(i)
{
case 1:
cout
//定义盒子Box类,要求具有以下成员:可设置盒子形状;可计算盒子体积;可计算盒子的表面积.
#include"iostream"
using namespace std;
#include"string.h"
//定义Box类
class Box
{
private:
int height;
int width;
int length;
public:
Box(int h,int w,int len);//构造函数--长方体
Box(int len); //构造函数--正方体
int cvolume();
int zvolume();
int carea();
int zarea();
};
Box::Box (int h,int w,int len)
{
height=h;
width=w;
length=len;
}
Box::Box(int len)
{
length=len;
}
int Box::cvolume()
{
return(height*width*length);
}
int Box::zvolume()
{
return(length*length*length);
}
int Box::carea()
{
int s;
s=2*(length*width+width*height+length*height);
return(s);
}
int main()
{
int i,len,w,h;
couti;
switch(i)
{
case 1:
cout
▼优质解答
答案和解析
//定义盒子Box类,要求具有以下成员:可设置盒子形状;可计算盒子体积;可计算盒子的表面积.
#include"iostream"
using namespace std;
#include"string.h"
//定义Box类
class Box
{
private:
int height;
int width;
int length;
public:
Box(int h,int w,int len);//构造函数--长方体
Box(int len); //构造函数--正方体
int cvolume();
//int zvolume();
int carea();
//int zarea();
};
Box::Box (int h,int w,int len)
{
height=h;
width=w;
length=len;
};
Box::Box(int len)
{
length = len;
height = len;
width = len;
};
int Box::cvolume()
{
return (height*width*length);
};
//int Box::zvolume()
//{
// return (length*length*length);
//};
int Box::carea()
{
int s;
s=2*(length*width+width*height+length*height);
return (s);
};
int main()
{
int i,len,w,h;
couti;
switch(i)
{
case 1:
{
cout
#include"iostream"
using namespace std;
#include"string.h"
//定义Box类
class Box
{
private:
int height;
int width;
int length;
public:
Box(int h,int w,int len);//构造函数--长方体
Box(int len); //构造函数--正方体
int cvolume();
//int zvolume();
int carea();
//int zarea();
};
Box::Box (int h,int w,int len)
{
height=h;
width=w;
length=len;
};
Box::Box(int len)
{
length = len;
height = len;
width = len;
};
int Box::cvolume()
{
return (height*width*length);
};
//int Box::zvolume()
//{
// return (length*length*length);
//};
int Box::carea()
{
int s;
s=2*(length*width+width*height+length*height);
return (s);
};
int main()
{
int i,len,w,h;
couti;
switch(i)
{
case 1:
{
cout
看了errorC2360:init...的网友还看了以下:
1.对于CH3—CH=CH—C≡C—CF3分子结构的描述(1)下列叙述中,正确的是().(A)6个 2020-04-26 …
可乐瓶子可以用来做什么?集思广益!我想一个创意实在想不出来了,任何样子、材质的可乐瓶子都可以做什么 2020-05-16 …
下列说法中,不违背科学规律的是①改变核外电子数可使原子与离子相互转化以下说法中,不违背科学规律的是 2020-05-16 …
离子可不可能脱离化合物形式存在有一个问题我一直不懂:KMNO4在通电的条件下可以阳离子往+级移动阴 2020-06-03 …
为什么质子可分为夸克,电子不可以质子可分为上夸克和下夸克,所以带一个单位正电荷,可是电子不可分,但 2020-06-06 …
动物园的饲养员给饲养员给三群猴子分花生如果分给第一群,则每只猴子可得12粒如果分给第二群,则每只猴 2020-06-12 …
英语翻译6.26宰我问曰:“仁者,虽告之曰:‘井有仁焉.’其从之也?”子曰:“何为其然也?君子可逝 2020-06-16 …
1个桌子可以坐10个人,2个桌子可以坐16个人,3个桌子可以坐22个人.请问6个桌子可以坐多少人小 2020-07-04 …
一张桌子可以坐4人,2张桌子可以坐6人照这样计算10张桌子可坐多少人?n张桌子可做多少人 2020-07-04 …
一张长方形的桌子可坐6人,按下图将桌子拼起来.按这样规律做下去:(1)有5张桌子时可坐人;(2)有1 2020-11-20 …