Professional Documents
Culture Documents
Problem 1
This program was designed to covert the angles from degrees to radians as well as to find their
respective sine and cosines of the angles.
INPUT
Degrees
PROCESSING
GET degrees
radians = degrees*pi/180
Calculate the sine of the
angle( radians)
Calculate the cosine of the
angle(radians)
OUTPUT
Degrees
Radians
Sine
Cosine
Pseudocode
GET degrees
INCREASE degrees by increments of 30
COMPUTE the angle in radians (rad) by dividing the product of the angle in degree and pi by 180
DETERMINE the sine of the angles in radians
DETERMINE the cosine of the angles in radians
DISPLAY Degrees, radians, sine and cosine.
Results
deg = 0:30:360;
rad = deg*pi/180;
a = sin(rad);
b = cos(rad);
%
table(:,1) = deg';
table(:,2) = rad';
table(:,3) = a';
table(:,4) = b';
%
disp(table)
0
1.0000
30.0000
0.5236
0.5000
0.8660
60.0000
1.0472
0.8660
0.5000
90.0000
1.5708
1.0000
0.0000
120.0000
2.0944
0.8660 -0.5000
150.0000
2.6180
0.5000 -0.8660
180.0000
3.1416
0.0000 -1.0000
210.0000
240.0000
270.0000
300.0000
5.2360 -0.8660
0.5000
330.0000
5.7596 -0.5000
0.8660
360.0000
6.2832 -0.0000
1.0000
Problem 2
This program was developed to determine the death of a creature utilizing the carbon 14 content for
that creature.
INPUT
Initial_amount of Carbon 14
PROCESSING
GET initial_ amount and
Remainder
OUTPUT
Remainder
CALCULATE n as equal to
(log
(remainder/initial_amount))
divided by (log (1/2));
PRINT USELESS
Pseudocode
IF
THEN
PRINT USELESS
ELSE
PRINT MATCH_FOUND
ENDIF
Results
age =
4.2228e+03
5
'MATCH_FOUND'>>
Problem 3
This program was designed to determine the estimated number of years it would take for the population
of Jamhram City to surpass twenty million people and the citys estimated population at the end of this
time.
INPUT
PROCESSING
READ Population of Jamhram
city, Rate of the population
growth, Number of years
Population
Rate
Year
OUTPUT
The number of years for this
population to grow pass
twenty million.
Population of the city
PSEUDOCODE
RESULTS
10
12
13