0% found this document useful (0 votes)
24 views2 pages

Sheet 1

Uploaded by

Khaled Mahmoud
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)
24 views2 pages

Sheet 1

Uploaded by

Khaled Mahmoud
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/ 2

Sheet 1

1-Write a program to find area of a square Use the equation: A = S*S


where is the side length

2-Write a program to find area and circumference of a circle Use the


equations

A=pi*R *R

C=2*pi*R

Where: pi =3.14 , R is the radius of the circle

3-Write a program to read three marks for a student and find the
average mark

4-Write a program to read the temperature in Celsius C and convert it


Fahrenheit F. Use the equation:

F = C*9/5+32

5- Write a program to read x,y,z and w and find the value of a and b
5 x y 4.5( x  2.3 y ) 2
a  and b
z 2.7 w zw

6-Wtite a program that calculates how far a satellite travels in one


rotation about the earth, given the satellite’s altitude in kilometers.
Use 12.730 km as the earth’s diameter.

7- Evaluate each of the following expressions, assuming in each case


that m has the value 25
and n has the value 7:
a) Z=m -8 – n b) Z=m + n * 3
c) Z=m%n d) Z=m%n++
e) Z=m%++n f) Z=++m – n
g) Z= ++m/2+++n/2

8- Trace the following program

#include<iostream>

using namespace std;

main ( )

{ int x=1,y=2,z=3;

z += ++x+10/2*5+y--;

cout<<” x=”<<x<<”\n y=”<<y<<”\n z=”<<z;

9-Write a program that prompts the user for the Cartesian coordinates
of two points (x1 , y1) and (x2 , y2) and display the distance between
them computed using the following formula:

𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 = √(𝑥1 − 𝑥2 )2 + (𝑦1 − 𝑦2 )2

You might also like