0% found this document useful (0 votes)
8 views

Ex (Algorithm)

Uploaded by

zqueen119
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Ex (Algorithm)

Uploaded by

zqueen119
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Exercises (Chapter 4)

៉ សុីនែដលបកែ្របកមវ� ធ
1. A compiler គជាមា
ឺ ិ ីមួយសរេសរជាភាសមា៉សុីនេទជា high-

level language ដូចជា BASIC , COBOL or FORTRAN is true or false ?

2. Write a BASIC formula for each algebraic expression.


b+c
a. x 3 − 3 xy + y 2 b. x5 − 4 yx 2 + 7 x + 4 c. a+
2d
a c2  y
d. e. f.
xy
− 4 cos3  
b 3a x − 3.5 y 8
−b + b 2 − 4ac
g. h. x 2 sin 3 x ≥ 0 ។
2a
3. Write a BASIC formula for each algebraic expression.

cot 3 x + 4
a. log x > 2 tan x
2 3 2
b. (5x 2
y − 3y )
3 3
+ sin x 2
c.
y2 − 2x
sin 2 ( x − y ) + 1
d. ។
1 + x2 − y 2

4. ចូរសរេសរជាកេន្សោមពិជគណិត

a. (Y − A ∗ X ) / B b. ABS ( X − Y ) / (1 + X ) ^ ( A ^ 2 )

c. 3 ∗ A ∗ B / (C − D ) d. X ^Y =
> X ∗Y ។

5. A file of incoming freshmen contains, among other data each student’s NAME

and SCORE on an entrance examination. Draw a flowchart which will list the names

of those students with perfect score of 100.

6. Each record in students, among other data, the student’s WEIGHT. Draw a

flowchart which find the average weight of the students.

ំ ួ នគត់រុឡាទ
7. គូស Flowchart ែដលមាន Do loop េដយ Input ជាចន ឺ ីបវជ
ិ មា
� ន N

និង Output: ។
1 1 1 1
1 − + − + ... ±
2 3 4 N
ំ ួ ន្របាក់ែដល្រត�វបង់វភាគទន្របច
8. ឩបមាថាចន ិ ំ � របស
ឆា ំ ់សមាជក
ិ ៃនសមាគមន៌មួយ


កណ ត់តមតរងខងេ្រកម:

Prepared by Mr. Ork Linda


1
Annual Salary Annual Dues

Less than $20000 $150

Between $20000 and $30000 $150 + (1% of exceed over $20000 )

More than $30000 $250 + (1.5% of exceed over $30000 )

គូស Flowchart ែដល Input salary and Output Dues.

9. គូស Flowchart ៃន algorithm េដយេ្របើ Do loop ស្រមាប់ករគណនា average

weight សិស្ស 35នាក់ ។

10. ចូរតមដនតៃម� A និង B តមរយ Flowchart េដម


ើ ្បគណនា
ី Output ែដលេគឲ្យ

Input: =
a. A 10
= and B 5 b. A 3=
= c. A 5=
and B 5 = and B 10 ។

Flowchart

Start

Read A, B

A < B? =
A A2 + B
No

Yes

A= A + 2 B

No
A < 20? B= B + 5 A

Yes
B= B + 10 Write A, B

Stop

Prepared by Mr. Ork Linda


2
ln x if x ≥ 1
11. គូស Flowchart ែដលគណនា y= ។
1 − x if x < 1
ំ ួ នគត់រុឡាទ
12. គូស Flowchart េដយេ្របើ Do loop មាន Input ជាចន ឺ ីប n និង

Output n! ។

Prepared by Mr. Ork Linda


3

You might also like