我有这门课,有很多收藏
'class properties
public a as collection
public b as collection
public c as collection
a,b,c 包含诸如“a,a,a,a,b,b,b,b,c,c,c,c,c,c,c”之类的值,b
和 c 也是如此,而且更有可能. 这些值可以是我们可以假设的任何字母。为了获得每个类的每个属性的百分比,我想这样做
(骨架,因为我不知道该怎么做)
for each class in collectionOfclassobjects
for each ca in class.a
'here am supposed to count all a's and b's divide by class.a.count but am not sure how to do this, I have an idea of adding the first item, and everytime it occurs i add it or add a count, when it's a create collection when its a, add it, when its b create new collection, and so on i have a collection of each value and i can easily print the count/total count and the name
next ca
for each cb in class.b
next cb
for each cc in class.c
next cc
next class
任何建议表示赞赏,我是新人,到目前为止我有两个菜鸟问题:) 都没有解决不知道为什么:P