关于c++的指针数组的练习题?
CreateaStatsclassthatrepresentanarrayofintegersandperformcertainoperationsonthatdataM...
Create a Stats class that represent an array of integers and perform certain
operations on that data
Members are: pointer to an array of integers, size of the array
Methods include (at least, you may add any others you need):
i. a private sort method using insertion sort
ii. a default (no parameter constructor)
iii. a destructor
iv. a method that takes and array of integers and its size and
copies it to the internal array
v. methods to find the mean, mode and median of the data in the
internal array
vi. a printData method to print out the array
vii. a printStats method to print out the stats 展开
operations on that data
Members are: pointer to an array of integers, size of the array
Methods include (at least, you may add any others you need):
i. a private sort method using insertion sort
ii. a default (no parameter constructor)
iii. a destructor
iv. a method that takes and array of integers and its size and
copies it to the internal array
v. methods to find the mean, mode and median of the data in the
internal array
vi. a printData method to print out the array
vii. a printStats method to print out the stats 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏5(财富值+成长值)
展开全部
个人觉得也有点小麻烦哦.... 这么麻烦, 都懒得给你伪代码了...
你按照它要求一个个做就是啊...
要求那么清晰, 你唯一任务就是实现它.
比如1, 实现一个sort 的私有函数, 用插入排序实现sort...
奇怪的是, stats 是啥玩意? =,=! 统计?状态?? 统计虾米?
你按照它要求一个个做就是啊...
要求那么清晰, 你唯一任务就是实现它.
比如1, 实现一个sort 的私有函数, 用插入排序实现sort...
奇怪的是, stats 是啥玩意? =,=! 统计?状态?? 统计虾米?
更多追问追答
追问
是蛮简单,写完了谢谢
追答
恩,国外上学?汗
最近看到好几个全英文的编程题,奇怪。。。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
r u sure u gotta everything covered? :-) just kidding, dude.
Were you allowed to use those fancy STL containers & algorithms? if yes, life's much easier.
The tricky part is not how to construct a trivial states class, it is how to get mode. The mode is not necessary to be unique, it could be none, or multiple values. The data series like this one below:
1 2 3 5 6 7
has no mode at all.
But:
1 1 1 2 2 3 4 4 5 5 5
have two modes, 1, 5, with a frequency of 3, respectively.
~Just a friendly reminding. ~_*
Were you allowed to use those fancy STL containers & algorithms? if yes, life's much easier.
The tricky part is not how to construct a trivial states class, it is how to get mode. The mode is not necessary to be unique, it could be none, or multiple values. The data series like this one below:
1 2 3 5 6 7
has no mode at all.
But:
1 1 1 2 2 3 4 4 5 5 5
have two modes, 1, 5, with a frequency of 3, respectively.
~Just a friendly reminding. ~_*
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
比较麻烦的一个类,要有构造函数、析构函数,运算符重载
追问
还好,我之前有些不太懂,不过已经完成谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询