We are currently struggling to cover the operational costs of Xtremepapers, as a result we might have to shut this website down. Please donate if we have helped you and help make a difference in other students' lives!
Click here to Donate Now (View Announcement)
Heshna said:I didn't find the algorithm easy...I never understood how to write an algorithm...pffff!!
examman said:come on tell us what the Algorithm question was ... its OK passed the 24hour limit
Depletion said:
..one question was strange!!
euu..real time processing and real time transaction..i dont remember the question well!! :ugeek: :ugeek:
yea algo was ok
the spreadsheet was kind of confusing...
which graph was more appropriate!!>graph A or B??? :geek: :geek:
mimmi said:examman said:come on tell us what the Algorithm question was ... its OK passed the 24hour limit
a school was taking weight and height of 1000 students
write an algorithm toL
-input 1000 students weight and height
-calculate the average of height and weight
-output the averages
examman said:mimmi said:examman said:come on tell us what the Algorithm question was ... its OK passed the 24hour limit
a school was taking weight and height of 1000 students
write an algorithm toL
-input 1000 students weight and height
-calculate the average of height and weight
-output the averages
Thanks a lot
total_1 = 0
total_2 = 0
For Counter = 1 to 1000
Input Height
Input Weight
If Input = Weight THEN total_1 = total_1+1
ELSEIF Input = Height THEN total_2 = total_2+1
Next Counter.
Avg_1 = total_1/1000
Avg_2 = total_2/1000
Output
Avg_1
Avg_2
Correct ? xD
mimmi said:Heshna said:I didn't find the algorithm easy...I never understood how to write an algorithm...pffff!!
Start
Count = 0
wsum = 0
hsum = 0
while (count < 1000) do
Input w
Input h
If (h <= 0) or (h = "") or (w <= 0) or (w = "") Then
Output "Error! Try again"
Else
hsum = hsum + h
wsum = wsum + w
count = count + 1
End if
End while
Output ("Average Height:" and (hsum/1000))
Output ("Average Weight:" and (wsum/1000))
End
~~~~~~~~~~~~~~~~~
I'm sad how the algorithm was too easy
examman said:mimmi said:examman said:come on tell us what the Algorithm question was ... its OK passed the 24hour limit
a school was taking weight and height of 1000 students
write an algorithm toL
-input 1000 students weight and height
-calculate the average of height and weight
-output the averages
Thanks a lot
total_1 = 0
total_2 = 0
For Counter = 1 to 1000
Input Height
Input Weight
If Input = Weight THEN total_1 = total_1+1
ELSEIF Input = Height THEN total_2 = total_2+1
Next Counter.
Avg_1 = total_1/1000
Avg_2 = total_2/1000
Output
Avg_1
Avg_2
Correct ? xD
according to the algorithm, if there is a weight, it would skip the 7th line and will not calculate the height. so if you use just an "IF" instead of "ELSE IF" it should work. you should also include how to catch any errorsexamman said:total_1 = 0
total_2 = 0
For Counter = 1 to 1000
Input Height
Input Weight
If Input = Weight THEN total_1 = total_1+1
ELSEIF Input = Height THEN total_2 = total_2+1
Next Counter.
Avg_1 = total_1/1000
Avg_2 = total_2/1000
Output
Avg_1
Avg_2
Correct ? xD
For almost 10 years, the site XtremePapers has been trying very hard to serve its users.
However, we are now struggling to cover its operational costs due to unforeseen circumstances. If we helped you in any way, kindly contribute and be the part of this effort. No act of kindness, no matter how small, is ever wasted.
Click here to Donate Now