Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2019-2020
First Class
مشرف المختبر:
م .عامد أمحد حسني
مهندس المختبر:
همندس أقدم .نور صباح عبود
1- Introduction to Computers By Gordon B. Davis
2- Borland C++ Builder By Herbert Schmidt
3- Shaum’s Programming with C++ ,2nd Edition, By John R. Hubbard
4- C / C++ Programmers References By Herbert Schmidt
5- C++ By Dissection By Ira Pohl
6- A C++ Primer for Engineers An object – Oriented Approach By
K.Ponnambalam & Tiuley Alguindigue
1
Test-1 1- األختبار
1. CPU
2. GB
3. ROM
4. USB
5. Hard Disc
6. Mother Board
7. TB
8. CD
Test-2 2- األختبار
1. Generally The PC desktop contain the following elements: …………… , …………… , …………..
2. ……………………… Change settings and customize the functionality of your computer.
3. The taskbar contains: ……………… , ………………..
4. A file is commonly referred to as a …………….. while a folder is a ……………..
5. To copy a file or folder you must press ……….. from keyboard then press …………. In the new location
2. The folder ____________ is used to quickly access storage device (Hard Disk, Floppy Disk).
3. ____________ sub menu close all opened programs, shut down Windows and then turn off your computer.
Test-2 2- األختبار
1.
2.
3
3.
4.
Test-1 1- األختبار
Test-2 2- األختبار
1. 1.
2.
3.
4.
4
Sub Test-2 2- البديل
1. The indication (Page: 3 of 13) in the (word count) option indicates that there are __________ pages and the
user is at page ____________ .
2. We can draw a table using the Insert menu then click insert table.
3. Red wavy (zigzag) underline indicates _________________ errors, while green wavy underline indicates
_________________ errors.
4. The Bold, Italic and Underline icons work like __________ and __________ switches.
Test-1 1- األختبار
Write a C++ program to divide two numbers and add the result to another number and print the
result to screen:
Test-2 2- األختبار
Test-1 1- األختبار
Write a C++program to read four degrees then calculate sum and average of them.
5
Write a C++ program to read a Fahrenheit degree and convert it to Celsius degree using the
conversion formula:
C
5
( F 32)
9
Test-2 2- األختبار
Write a C++ program to read two boolean values( a and b) then print “OR” and “AND” them.
Test-1 1- األختبار
Write a C++ script to represent the following keys using logical operators:
Var1 Var1 Var3
Var3 Var4
c d
Var2 Var2 Var4
Write a C++ script to represent the following keys using logical operators:
Var1
Var1 Var2 Var3
Var5 Var2
Var3 Var4
Var4
6
Test-2 2- األختبار
Write a C++ program to read two numbers and print the value of the greater one (using ternary
operator).
Write a C++ program to read a numbers then check if it an even or odd number (using ternary
operator).
Test-1 1- األختبار
If you know that the radius of the circle inscribed in triangle with sides a, b, c is:
(s a)(s b)(s c) 1
r where s (a b c)
s 2
𝒙𝟐 𝒚 − 𝟑 𝒔𝒊𝒏 𝒙
𝑨=
√ 𝒙𝟑
𝒚
Test-2 2- األختبار
Write a C++ program to computes and print all the arithmetic expressions in same program.
1 op1 2 ln( x 3 )
2 op 2 e x sin 2 ( x)
3
x3 4x 2 x
3 op3 2
x 2x 2
7
Test-1 1- األختبار
Write a C++ program to find the two solution of the quadratic equation ax2+bx+c
using the quadratic formula:
−𝑏 ∓ √𝑏2 − 4𝑎𝑐
𝑥1,2 =
2𝑎
Test-1 1- األختبار
Write a program to calculate the distance between two points using the following
(ax bx) 2 (ay by) 2 (az bz ) 2
equation: d=
8
Write a C++ program to enter any two angles (a and b) in radian unit then find
and print the value of (Z) from the below equation in radian and degree unit:
b
Z Sin (a 2 ) Tan 3 ( )
3
Test-2 2- األختبار
Write a C++ program to find and print (y) from the following equation:
y 3 sinh 1 (u) u cosh 1 (u)
If you know that: sinh 1 (u) ln(u u 2 1) and cosh 1 (u) ln(u u 2 1)
Test-1 1- األختبار
Write a C++ program to find and print the Area and the Perimeter (circumference)
for the shape below from the following equations:
θ ø
Write a C++ program to find and print Y from the following equation:
Test-1 1- األختبار
Write C++ program to read a real number and print (positive) when it is greater
than zero and negative otherwise:
Write a C++ program to read a number and print its type (even or odd).
Test-2 2- األختبار
Write a C++ program to read two numbers and print the value of the greater one:
Sub Test-1 1- البديل
Write a C++ program to read two numbers and an operation to apply it on them:
Test-1 1- األختبار
Write a C++ program that read the primary (basic) salary and the sales and
calculate the total salary which equals the basic salary plus the commission that is
calculated as:
Comm=2% if the sales are less than or equal three times of the basic salary.
Comm=3% if the sales are more than three times of the basic salary.
Comm=5% if the sales are more than five times of the basic salary.
10
Sub Test-1 1- البديل
(3x 7) if ( x 5)
2
y= (5 x ) if ( x 2) or ( x 5)
( x 4 x 3 ) if ( x 4)or ( x 4)
Test-2 2- األختبار
Write a C++ program to calculate the sum and average of six students degrees and
print the appropriate grade in the screen using (switch) statement:
Degree grade
0 - 49 Fail
50 - 59 Accept
60 - 69 Fluent
70 - 79 Good
80 - 89 Very good
90 - 100 Excellent
If you know that the Tax office takes a tax for the imported goods according to
their degrees as shown in the Table:
Goods degree Tax
Write a C++ program to enter the goods degree
“A” 40% from price
and price then print the tax according to the table
“B” 10% from price
above.
“C” 5% from price
“D” 2% from price
“E” 1% from price
11
Test-1 1- األختبار
Use (switch) to write a C++ program to make a mini calculator for the four
operations(+ , - , / , *).
Sub Test-1 1- البديل
Write a program to read a triangle three sides and print " equilateral" when all the
sides are equal and print "isosceles" when two sides are equal and print "scalene"
when all the sides are different:
Test-2 2- األختبار
Write a Program to read a character if it's in alphabet then find if its uppercase or
lowercase. If it’s a digit print that it is a digit. Else print that it’s a special
character.
Test-1 1- األختبار
Write a C++ program to enter four numbers then find the minimum one:
Write a C++ program to find z from the below equations depending on your entry
(k). Use switch.
2k sin(k ) :k 1
3
2 k 3 :k 2
z
k 2 :k 3
k : k 1 or k 3
12
Test-2 2- األختبار
Test-1 1- األختبار
Write a C++ program to read ten numbers and calculate the sum and average of
them using (for) statement.
13
Test-2 2- األختبار
Write a C++ program in C++ to print the numbers between 1 and 50 that are
dividable on 3 using (while) statement:
Test-1 1- األختبار
Write a C++ program to calculate the factorial of a number after reading it:
Write a C++ program in C++ to print the numbers between 1 and 10 using (Do-
While) statement:
Test-2 2- األختبار
Test-2 2- األختبار
Write a C++ program to read (n) numbers and print the maximum one among
them.
Test-1 1- األختبار
Test-1 1- األختبار
Write a C++ program that reads an integer array a[10] then find the max value
with its position and the min value with its position.
Write a C++ program that inputs the integer array a[10] then transpose it and
print the transposed array.
Test-2 2- األختبار
Write a C++ program to enter the array a(10), then find and print the first three
maximum numbers. Hint: Sort the array
Write a C++ program to enter and print the two 1D arrays M[6] and N[6], then
find and print the value of P from the following equation:
5
P 2 M (i) * N (i)
i 0
16
Test-1 1- األختبار
Ten charges placed on a plate. Write a C++ program to enter the value for the ith
charge in an array q[10] and the distance from the center to the ith charge in
another array r[10] then find and print the electrical potential (E) in the center of
this plate according to the following equation:
1 qi
E
4 πε o
r , where εo = 8.85×10-12
i
Write a C++ program to enter 10 degrees for 6 students in two subjects (physics
and mathematics). Store these degrees in two 1D arrays (P and M) then find and
print an array K that contains the mean between two opposite degrees.
Test-2 2- األختبار
Write a C++program to split the odd number and even elements of a 2D array into
two 1D arrays.
Sub Test-2 2- البديل
Write a C++ program to read 3×3 array then find the summation of each row, each
column and the whole array.
Test-1 1- األختبار
Write a C++ program to sum two arrays and print the result array in a 2D matrix
form.
17
Sub Test-1 1- البديل
Write a program in C++ to calculate the positive difference between two matrices
4X4 such that the result of the difference between any two corresponding numbers
in the arrays must be positive:
Test-2 2- األختبار
Write a C++ program to find the summation of odd numbers in 4×4 array.
Write a C++ program to find the “A” element in 4×4 character matrix then return
the index of its location.
Test-1 1- األختبار
Write a program in c++ to convert 2D array to 1D array and fond the maximum
number in the new array:
Sub Test-1 1- البديل
Write a program to read two 3*3 arrays and print a third array resulted from
multiplying the main diagonal elements of the two read arrays and subtract the
other elements of them each element with the corresponding one:
Test-2 2- األختبار
Write a C++ program to read A[3,3] of numbers then find the minimum element
and print its location.
Sub Test-2 2- البديل
Write a C++ program to read A[n,n] of numbers then find the maximum element
and print its location.
18
Test-1 1- األختبار
Write a C++ program to read X[4,4] then exchanges the upper triangle with lower
triangle
Sub Test-1 1- البديل
Write a C++ program to read b[4,4] then exchange the first row with the last row.
Test-2 2- األختبار
Write a C++ program to read C[4,4] then exchange row0 with col3.
Sub Test-2 2- البديل
Write a C++ program to replace each element in the main diagonal with the
elements in the second diagonal.
Test-1 1- األختبار
Write a program to read two arrays and compare among each corresponding
elements in each of them to produce a new array of the larger correspond of the
two entered arrays:
Sub Test-1 1- البديل
Write a C++ program that reads a square matrix with nine elements, then perform
the following menu depending on your entry:
1. Print the sum of main diagonal elements.
2. Print the sum of upper main diagonal triangle elements.
3. Set secondary diagonal elements to zero.
19
Test-1 1- األختبار
Write a C++ program that adds two numbers of different numeric data types (e.g.
integers, float, double) using the function add().
Sub Test-1 1- البديل
Write a C++ program that multiply five numbers of different numeric data types
(e.g. integers, float, double) using the function mul().
Test-2 2- األختبار
Write a C++ program to enter any number then print the triple of this number. Use
the function Triple(n) to find the triple of any number.
Sub Test-2 2- البديل
Write a C++ program that evaluates the trigonometric function secant (sec()) if you
know that: sec(x)= 1/cos(x).
Test-1 1- األختبار
Write a C++ program that evaluates the function (fx()) if you know that:
fx(a,b)= sin 2(a)+ cos(b 3+3).
Sub Test-1 1- البديل
Write a C++ program to enter two values (in feet and inch) representing a distance
then by using functions convert this distance to meters and centimeters. I you know
that: 1 foot=12 inch and 1 inch =2.54 cm
20
Test-2 2- األختبار
Write a C++ program to enter one integer value representing time in seconds
distance then by using functions convert this time to equivalent hours, minutes, and
seconds. Print it in the following form: hr : mn : sec.
Sub Test-2 2- البديل
Write a C++ program using function to input a student average and return 4 if the
average is 90-100, 3 if the average is 80-89, 2 if the average is 70-79, 1 if the
average is 60-69, and 0 if the average 0-59.
Test-1 1- األختبار
Write a C++ program using function to calculate the factorial of an integer entered
number (n!).
Sub Test-1 1- البديل
Write a C++ program to implement the function NthRoot (x, N) to return the Nth
5
root for the argument (x) (i.e.
N
X ). Test the function by finding 16 .
As you know that the function Log(x) returns the natural logarithm for argument (x)
(i.e. Ln(x)). Write a C++ program to implement the function LogEx(x,b) to find the
21
logarithm for the argument (x) with any base (b) then find and print Log4(9). Use
Ln( x)
the relation Logb ( x) .
Ln(b)
Test-1 1- األختبار
Write a C++ program to implement the function tan -1(x) using the series:
1 x3 x5 x7 x9 x 99
tan (x) x .....
3 5 7 9 99
Input x and rename the function as invtan().
Test-2 2- األختبار
Write a C++ program to implement the function ex using the series up to 100
terms:
x 2 x3 xn
e 1 x
x
...
2! 3! n!
Input x and rename the function as expx().
22
Test-1 1- األختبار
Write a C++ program to evaluate the following by the use of user functions:
1 x 1 x
3
3 sinh ( 2 ) x cosh ( 2 )
1 3
y x sinh 1 ( ) 2 cosh 1 ( )
2 2
x
cos( 2 cosh 1 ( ))
2
Find y for each entered value for the three equations at the same time.
Write a C++ program to find and find Y from the following equation:
cosh(x) 4 sinh(x)
Y
1 3 sinh(x) cosh 2 (x)
ex e x ex e x
Hint: Sinh(x)= and Cosh(x)=
2 2
23
Test-1 1- األختبار
Write C++ program to apply the following instructions: (a=”1234” and s=” “).
atoi ( a )
atof ( a )
Test-2 2- األختبار
Write C++ program to print an n-dimension character array contain character (a)
in the main diagonal, character (b) in the upper triangle and character (c) in the
lower triangle.
24
Test-1 1- األختبار
Write C++ program to print a string, and then print it character by character in
forward and reveres order
i.e: abcd → a d
b c
c b
d a
write C++ program to enter the array s[10] then compute and print number of
character ”a” and number of character “b” that are repeated in this array .
Test-2 2- األختبار
Write C++ program to enter a character array A[ 3][3 ] then put character “L”
instead of each lower case characters and “U” instead of upper case characters.
Write C++ program to check each character in the string array A[3][3] to convert
the lower case letters to upper case letter and convert the upper case letters to
lower case.
25