Sie sind auf Seite 1von 1

DEPT.

OF ELECTRONICS AND
‫قسم اإللكترونيات و االتصاالت الكهربية‬
COMMUNICATIONS ENGINEERING
‫كلية الهندسة‬
FACULTY OF ENGINEERING
‫جامعة القاهرة‬
CAIRO UNIVERSITY
GIZA, EGYPT ‫الجيزة – جمهورية مصر العربية‬
Third Year --- Computers: Data Structures Spring 2012

Sheet: C++ Revision

1) Write a program that requests the user to enter two integers. The program should calculate
and report the sum of all the integers between and including the two integers.

2) Write a program to find the maximum and the minimum numbers in a list of N integers. The
program should be able to find the location of the maximum and the minimum. Test your
program on a list of 10 numbers of your choice.

3) A. Write a structure declaration to contain the following information about a student: Name
(at most 60 characters), ID_number (string of 14 characters), year and accumulative_grade.

B. Write a function void read_student that is passed a variable of the structure defined in (a)
and reads information about the student from the input.

C. Declare roll to be an array of 5000 structs of the type defined in (a).

4) Write a function void swap that is passed two integers and swaps their values. Write a
program to test the function.

5) Write a function that is passed the radius of a circle and gives its area and circumference.
Write a program to test the function.

Das könnte Ihnen auch gefallen