السلام عليكم و رحمة الله و بركاته:الله يسعدكم و يوفقكم في الدارين
لدي مجموعة من الخوارزميات و أتمنى منكم حلها أو بعضا منها للتأكد من حلي..حل الخوارزميات في pseudo-codeباستخدام for , case , while , loop ,and ,or if
2-There are 9870 people in a town whose population increases by 10% each year. Write a loop that determine how many years it would take for the population to exceed30000
3- write a program that allows the user to enter values and prints out the number of positive values and the number of negative values entered. Use 0 as sentinel value.
4- Write a loop that continues to read pairs of integers until it reads a pair with the property that the first integer in the pair is divisible by the second.
5- write a program fragment with a for loop that accumulates the total number of days for the years 1950 to the year 2000. remember that any year divisible by 4 is a leap year and has 366 days.
6- write a program to read in a collection of exam scores ranging in value from 1 to 100. your program should count and print the number of outstanding scores (90-100), the number of satisfactory scores ( 60- 89), and the number of unsatisfactory scores
( 1- 59 )
7-tras the following program showing the value of its variables as it executes
User input = 2 5 9 -3
Start
Get number
While number>0 do
Print "multiples of number" ,number
For cnt = 1 to 4 do
Val = number * cnt
Prent val
End for
Get number
End while
Stop
8-find the 4 errors in this pseudo-code that calculates the power of agiven
Number (example if the input is 2 and 4 the result is 16)
Var
Number real
Power integer
Factor real
Start
Print "enter anumber"
Read number
While (power > 0) do
Factor = factor * number
End while
Result = factor
Print "the result is :" ,result
stop


