# data[].attributes.body
sc.resetNext()

x=0

y=0

while(sc.hasNext())

{a=a+sc.getNext()

y=y+1

{

end loop

print(x/y)

# data[].attributes.body
sc.resetNext

x=0

if(sc.isEmpty)

while(sc.hasNext())

{ if (score.getNext < 40)

{x=x+1

}end if

}end loop

end if

print (x)

# data[].attributes.body
below40=0

below60=0

below80=0

below100=0

100=0

t=0

sc.resetNext()

while (sc.hasNext())

if (Sc.getNext()<40)

below40++

else if (Sc.getNext()<60)

below60++

else if

else if (Sc.getNext()<80)

below80++

else if

else if (Sc.getNext()<100)

below100++

else

100++

end if

t=below40+below60+below80+below100+100)

print ("percentage of lesser than 40 is" below40/t*100)

print ("percentage of lesser than 60 is" below60/t*100)

print ("percentage of lesser than 80 is" below80/t*100)

print ("percentage of lesser than 100 is" below100/t*100)

print ('percentage of perfect score is" 100/t*100)

# data[].attributes.body
sc.resetNext()

x=0

# data[].attributes.body
sc.resetNext()

x= 0

# data[].attributes.body
sc.resetnext()

countA=0

countB=0

countC=0

countD=0

while score.hasNext() {

if (score.getNext() < 41)

countA++

elseif (score.getNext() < 61)

countB++

elseif (score.getNext() < 81)

countC++

elseif (score.getNext() > 81)

countD++

endif

}

endloop

print "0 to 40" + countA

print "41 to 61" + countB

print "61 to 81" + countC

print "81 to 100" +countD

# data[].attributes.body
sc.resetnext()

Total = 0

While sc.hasnext()

If sc.getnext() < 40

Total = total + 1

End loop

Print total

# data[].attributes.body
score.resetNext()

less40 = 0

less60 = 0

less80 = 0

less100 = 0

total = 0

while (score.hasNext())

{

if (score.getNext() < 40)

{

less40++

} end if

if (score.getNext() > 41 AND score.getNext() < 60)

{

less60++

} end if

if (score.getNext() > 61 AND score.getNext() < 80)

{

less80++

} end if

if (score.getNext() > 81 AND score.getNext() = 100)

{

less100++

} end if

} end while

total = less40 + less60 + less80 + less100

a)

print("percent 40 or less = " + (less40/total) * 100)

b)

print("percent 60 between and 41 = " + (less60/total) * 100)

c)

print("percent 80 between and 61 = " + (less80/total) * 100)

d)

print("percent 100 between and 81 = " + (less100/total) * 100)

# data[].attributes.body
sc.resetnext()

Total = 0

Count = 0

while (sc.hasnext())

Total = total + (sc.getnext())

Count = Count + 1

End loop

X = Total/Count

Print X

# data[].attributes.body
score.resetNext()

x = 0

while (score.hasNext())

{

if ( score.getNext() < 40)

{

x++

} end if

} end while

print(x)

# data[].attributes.body
sc.resetNext()
a = 0
b = 0
while (sc.hasNext())
{ a = a + sc.getNext()
  b = b + 1
} end loop
print (a/b)

# data[].attributes.body
t=0

c=0

sc.resetNext()

while (sc.hasNext())

t = t + sc.getNext()

c=c++

end loop

print (t/c)

# data[].attributes.body
x=0

score.resetNext()

while (score.hasNext())

{if (score.getNext() < lowest)

{if and lowest = score.getNext ( ) }

end if }

end while} print(lowest)

# data[].attributes.body
sum=0

count=0

score.resetNext()

while score.hasNext() {

sum=sum + score.getNext()

count=count+1

}

endloop

avg=sum/count

print avg

# data[].attributes.body
score.resetNext()

sum = 0

counter = 0

while (score.hasNext())

{ sum = sum+

score.getNext()

counter ++

} end loop

print (sum/counter)

end

# data[].attributes.body
score.resetnext()

x = 0

y = 0

while (score.hasnext())

{

x = x + score.getnext()

y++

} end while

print(x/y)

# data[].attributes.body
x = 0

score.resetNext()

while (score.hasNext())

{ if (score.getNext() < lowest)

{

lowest = score.getNext ()

} end if

} end while

print(lowest)

# data[].attributes.body
sc.resetNext()

total = 0
counter = 0

while (sc.hasNext()) {
    total = total + sc.getNext()
    counter++
} end loop

print (total/counter)

end program

# data[].attributes.body
score.resetNext()

c=0

while score.hasNext() {

if (score.getNext < 40) {

c=c+1

}

endif

}

endloop

print c

# data[].attributes.body
x = 0

score.resetNext()

if (score.isEmpty)

while (score.hasNext())

{ if (score.getNext < 40)

{x = x+1

} end if

} end loop

print (x)

# data[].attributes.body
sc.resetNext()

x = 0

if !(sc.isEmpty)

while (sc.hasNext())

{ if (sc.getNext < 40)

{ x = x + 1

} end if

} end loop

end if

print (x)

# data[].attributes.body
score.resetNext()

lowest = score.getNext() /// this will Fetch the Value!

while (score.hasNext())

{

if ( score.getNext() < lowest )

{

lowest = score.getNext ()

} end if

} end while

print(lowest)

# data[].attributes.body
score.resetNext()

counter = 0

while (score.hasNext()) {
    if (score.getNext() < 40) {
        counter++
    } end if
} end loop

print counter

end program

# data[].attributes.body
Q1. Collection SC. Find the lowest Score.?

Q2. Collection SC. Find how many has Scored Less than 40 Marks.

Q3. Collection SC. Has score of Class, find the Class average? and print the AVERAGE of the Class.

Q4. Collection SC. has score of Students. Check the % of Students who have scored between. a) 0 - 40%. b) 41 - 6-%. c) 61 - 80%. d) 81 - 100%

Q5. Array 'NAMES' has list of DP 1 Comp. Sci. Students. Teacher wants to move the data from Array to Collection. Help the teacher by writing a Code to move list of Students from ARRAY to Collection : CSdp1. -------- a) print how many students got added to the Collection. (one line code)

# data[].attributes.body
score.resetNext()
highest = 0

if (score.hasNext()) {
    highest = score.getNext()
} end if

while (score.hasNext()) {
    tempScore = score.getNext()
    if (tempScore < highest) {
        highest = tempScore
    } end if
} end loop

print highest

end program

# data[].attributes.body
a)

sc.resetNext()

sum = 0

score = 0

while (sc.hasNext())

sum = sum + 1

{ if (sc.getNext >= 0 and sc.getNext <= 40)

{score = score + 1

} end if

} end loop

print ((score/sum) * 100)

b)

sc.resetNext()

sum = 0

score = 0

while (sc.hasNext())

sum = sum + 1

{ if (sc.getNext >= 41 and sc.getNext <= 60)

{score = score + 1

} end if

} end loop

print ((score/sum) * 100)

c)

sc.resetNext()

sum = 0

score = 0

while (sc.hasNext())

sum = sum + 1

{ if (sc.getNext >= 61 and sc.getNext <= 80)

{score = score + 1

} end if

} end loop

print ((score/sum) * 100)

d)

sc.resetNext()

sum = 0

score = 0

while (sc.hasNext())

sum = sum + 1

{ if (sc.getNext >= 81 and sc.getNext <= 100)

{score = score + 1

} end if

} end loop

print ((score/sum) * 100)

# data[].attributes.body
Solve the following Question