منتدى جامعة الزيتونة الأردنية

هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

منتدى خاص لطلاب جامعة الزيتونة الأردنية


3 مشترك

    شبح السنافر c++

    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 10:18 pm

    السلام عليكم ورحمة الله وبركاته



    هون راح تلاقو اسئلة عن ال c++ وان شاء الله تستفيدو منها وكتير بيجي منها اسئلة فالامتحانات :

    ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
    ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
    ¶¶¶¶´´¶¶´´´´´´¶¶´´´´´´¶¶´´´¶¶¶¶
    ¶¶¶´´´´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶
    ¶¶´´´´´´´´´´´´´´´´´´´ ´´´´´´´´´´´¶¶
    ¶¶´´´´´´´´´´´´´´´´´´´´´ ´´´´´´´´´´´¶¶
    ¶´´´´´´´´´´´´´´ ++c ´´´´´´´´´´´´¶¶
    ¶¶´´¶´´´´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶´¶¶
    ¶¶´¶¶´´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶´´¶
    ¶¶´¶¶´´´´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶´´¶
    ¶¶´´¶¶´´´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶´¶¶
    ¶¶´´¶¶´´´´´´´´´´´´´´´´´´´´´´´´´´´¶¶´´¶¶
    ¶¶´¶¶´´´¶¶¶¶¶¶¶¶´´´´´´¶¶¶¶¶¶¶´´´¶¶´¶¶
    ¶¶¶¶´¶¶¶¶¶¶¶¶¶¶´´´´´¶¶¶¶¶¶¶¶¶¶´¶¶¶¶¶
    ¶¶¶´¶¶¶¶¶¶¶¶¶¶´´´´´¶¶¶¶¶¶¶¶¶¶´¶¶¶
    ¶¶´´´¶¶¶¶¶¶¶¶´´´´´´´¶¶¶¶¶¶¶¶¶´´¶¶
    ¶¶´´´¶¶¶¶¶¶¶´´´¶´¶´´´¶¶¶¶¶¶¶´´´¶¶
    ¶¶´´´´´¶¶¶´´´´¶¶´¶¶´´´´¶¶¶´´´´´¶¶
    ¶¶´´´´´´´´´´¶¶¶´¶¶¶´´´´´´´´´´¶¶
    ¶¶¶¶´´´´´´´¶¶¶´¶¶¶´´´´´´´¶¶¶¶
    ¶¶¶¶¶¶´´´´¶¶¶´¶¶¶´´´´¶¶¶¶¶¶
    ¶¶¶¶¶´´´´´´´´´´´´´´¶¶¶´¶¶
    ¶¶¶´´¶¶´´´´´´´´´´´¶¶´´¶¶
    ¶¶´¶¶´¶¶¶¶¶¶¶¶¶¶¶´¶¶´¶¶¶
    ¶¶´¶¶´¶´¶´¶´¶´¶´¶´¶´¶´¶¶
    ¶¶´´¶´¶´¶´¶´¶´¶´¶´¶´´´¶¶
    ¶¶´´´¶¶¶¶¶¶¶¶¶¶¶¶¶´´´¶¶
    ¶¶´´´´´´´´´´´´´´´´´¶¶
    ¶¶¶´´´´´´´´´´´´´¶¶¶
    ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶


    عدل سابقا من قبل microsoft girl في الجمعة مارس 20, 2009 11:59 pm عدل 2 مرات
    Prince Of Jordan
    Prince Of Jordan
    مشرف
    مشرف


    ذكر
    عدد الرسائل : 2368
    العمر : 37
    البلد : The Hashmite Kingdom Of Jordan
    السنة الجامعية : 4th Year
    التخصص : Cs
    السٌّمعَة : 14
    نقاط : 587
    تاريخ التسجيل : 11/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف Prince Of Jordan الجمعة مارس 20, 2009 10:29 pm

    طيب وين الاسئــله
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 10:33 pm

    يه مستعجل ان الله مع الصابرين
    Prince Of Jordan
    Prince Of Jordan
    مشرف
    مشرف


    ذكر
    عدد الرسائل : 2368
    العمر : 37
    البلد : The Hashmite Kingdom Of Jordan
    السنة الجامعية : 4th Year
    التخصص : Cs
    السٌّمعَة : 14
    نقاط : 587
    تاريخ التسجيل : 11/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف Prince Of Jordan الجمعة مارس 20, 2009 10:41 pm

    انا نشيط ومستعجل مع اني اخذتها قبل 3 سنين بس من باب المعرفه
    3TEWE FM 107.6 MHz
    3TEWE FM 107.6 MHz
    ماجيستير
    ماجيستير


    ذكر
    عدد الرسائل : 2417
    العمر : 38
    البلد : jordan
    التخصص : S.E
    الأوسمة : شبح السنافر c++ WEEEESAM
    السٌّمعَة : 25
    نقاط : 391
    تاريخ التسجيل : 17/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف 3TEWE FM 107.6 MHz الجمعة مارس 20, 2009 10:44 pm

    الغايب حجته معه
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 10:51 pm

    Chapter 1
    Introduction to C++


    Q1) Choose the correct answer of the following multiple choice questions:


    1. Which of the following statements about C++ is false?
    (a) C++ is an extension of C
    (b) C++ provides capabilities of object-oriented programming
    (c) C++ is an interpreted language
    (d) C++ is a compiled language

    ************************************************************************

    2. Which of the following languages was not an ancestor of C++?
    (a) C (b) B (c) A (d) BCPL

    3. Computer programs are
    (a) sets of control instructions
    (b) the information processed by the computer
    (c) the various devices (disks, memory, keyboard) that comprise a computer system
    (d) the people programming the computers


    *********************************************************************

    4. Pseudocode does not include
    (a) declarations
    (b) input/output
    (c) algorithms
    (d) control structures


    *********************************************************

    5. The compile stage is when ____________.
    (a) the object code is linked with code for functions in other files
    (b) the C++ program is translated into machine language code
    (c) the program is executed one instruction at a time
    (d) the program is placed in memory


    ******************************************************************

    6. Specifying the order in which statements are to be executed in a computer program is called
    (a) an algorithm (b) transfer of control (c) program control (d) pseudocode


    *******************************************************************

    7. Lines beginning with _______________ inform the compiler that the rest of the line is a comment.
    (a) // (b( ** (c) REM (d) <<


    ************************************************************** ***

    8. Which of the following must every executable C++ program have?
    (a) main (b) /**/ (c) // (d) std::cout


    ********************************************************* **

    9. Every statement in C++ must end with a
    (a) period (.) (b) semicolon (Wink (c) colon (Smile (d) backslash (/)

    ******************************************************** **
    10. Which of the following is not a valid escape sequence?
    (a) \n (b) \\ (c) \~ (d) \"


    ********************************************* *

    11. Which of the following is not a valid integer value?
    (a) -3 (b) 0 (c) 2134859 (d) 1.1


    ****************************************************************
    12. Which of the following is an invalid identifier (variable name)?
    (a) _Test (b) TEST (c) 5test (d) test1

    *****************************************************************************
    13. Which statement prints "hi" on the screen?
    (a) cout << "hi"; (b) cout >> "hi"; (c) "hi" >> cin; (d) cin >> "hi";


    *****************************************************************************
    14. Which operation returns the integer remainder when 15 is divided by 6?
    (a) 15 / 6 (b) 15 % 6 (c) 15 ^ 6 (d) 15 * 6
    * *********************************************************

    15. Evaluate the expression
    3 * 4 % 6 + 4 * 5
    (a) 20 (b) 26 (c) 12 (d) 32


    ****** **************************************************
    16. Which of the following is an equality operator?
    (a) == (b) = (c) > (d) >=


    ********************** **********************************
    17. ______ is a set of instructions written in a computer programming language that processes data to solve a specific task.
    (a) data (b) pseudocode (c) program (d) computer programming


    *************************************************** ***********

    18. In C++ environment, the phase that ties/connects the compiled object code of the program with the necessary standard and private libraries to the program is called:
    (a) editing phase
    (b) preprocessing phase
    (c) compilation phase
    (d) linking phase
    (e) none of the above

    **************************************************** *******

    19. C++ is:
    (a) high level, reusable, but not event-driven language
    (b) portable, low level, but not reusable language
    (c) structured-oriented, object-oriented, but not portable language
    (d) object-oriented, low level, but not structured-oriented language

    **** *******************************************************

    20. One of the following are all valid variable names:
    (a) student_first_name, c3, m1234, _grade_
    (b) student_first_name, c3, m12-m34, grade_
    (c) student_firstname, 3c3, m1234, grade_
    (d) student first name, c3, m1m2m3m4m, grade_

    ************************************************* ********

    21. Variable names actually correspond to __________.
    (a) locations in the computer's memory (b) operators
    (c) integers (d) data types

    ******************************************* *****************

    22. The value of s after performing the statement: s = 3 + 5 – 3 % 2 == 5 / 5 * 2 || !3 < 4 * 2 ;
    (a) false (b) true (c) 21 (d) 24


    ****************************************************************************


    23. Given the algebraic equation y = ax3 + 7, which of the followings are correct C++ statements for this equation:
    (a) y = a * x * x * ( x + 7 ) ;
    (b) y = ( a * x ) * x * ( x + 7 ) ;
    (c) y = a * x * x * x + 7 ;
    (d) y = a * x * ( x * x + 7 ) ;
    (e) (a) and (b)


    ******************************************************* ***
    24. Assume that
    int x = 0, y = 10;
    then the statement:
    cout << x/y << endl ;
    (a) has no error
    (b) has a logical error
    (c) has a syntax error (compile time error)
    (d) has a run time error


    ***** ****************************************************


    25. Assume that
    int x = 0, y = 10;
    then the statement:
    cout << y/x << endl ;
    (a) has no error
    (b) has a logical error
    (c) has a syntax error (compile time error)
    (d) has a run time error


    ****************************************************** *******

    26. What will the following statement print
    cout << "\"*\"\n\?**\?\n\"***\"\n" ;
    (a) "*"
    ?**?
    "***"
    (b) "*"
    "?**?"
    "***"
    (c) "\"*\"\n\?**\?\n\"***\"\n"
    (d) \"*\" \?**\? \"***\"

    *********************************************** **************

    27. What is the punctuation used to signal the beginning and end of code blocks?
    (a) { } (b) -> and <- (c) ( and ) (d) BEGIN and END

    **************************************** *************

    28. What is the output of the following statement
    cout << fixed << left
    << setprecision ( 1 ) << setw ( 11 ) << 333.546372
    << setprecision ( 2 ) << setw ( 12 ) << 333.546372
    << setprecision ( 3 ) << setw ( 13 ) << 333.546372 ;
    (a) 3.546372 33.546372 333.546372
    (b) 333.5 333.55 333.546
    (c) 333.546372 333.546372 333.546372
    (d) 333.5 333.54 333.546


    ****************** ************************ *******************

    29. One of the following declarations and initializations is not correct
    (a) const int x; (b) const int x=6; (c) int x; (d) int x=6;


    **************************************************** ***********


    30. Given the following declarations
    int x = 5,y=4;
    what will the following statement print
    cout<<(x == ++y ? "Ok": "Not Ok");
    (a) Ok (b) Not Ok (c) Ok Not Ok (d) will produce an error


    ****************************************************


    31. Which of the following is not a binary operator
    (a) * (b) && (c) ++ (d) /=
    32. Which of the following will not increment variable c by one?
    (a) c + 1; (b) c++; (c) ++c; (d) c += 1;

    33. Which of the following is a correct comment?
    (a) */ Comments */ (b) ** Comment ** (c) // Comment (d) { Comment }

    34. Which of the following is not a correct data type?
    (a) float (b) real (c) int (d) double

    35. In C++, the condition 4 > y > 1
    (a) evaluates correctly and could be replaced by ( 4 > y && y > 1 )
    (b) does not evaluate correctly and should be replaced by ( 4 > y && y > 1 )
    (c) evaluates correctly and could not be replaced by ( 4 > y && y > 1 )
    (d) does not evaluate correctly and should not be replaced by ( 4 > y && y > 1 )

    36. What is the final value of x after performing the following operations?
    int x = 21 ;
    double y = 6 ;
    double z = 14 ;
    y = x / z ;
    x = 5.5 * y ;
    (a) 8.25 (b) 5.5 (c) 5 (d) 8

    37. If x = 3, which of the following sets x to 7?
    (a) x *= 4; (b) x += 4; (c) x =+ 4; (d) x + 4 = x;

    38. In which of the following is y not equal to 5 after execution? Assume x is equal to 4.
    (a) y = 5; (b) y = x++; (c) y = ++x; (d) y = x = 5;

    39. Which of the following data types can be used to represent integers?
    (a) char
    (b) long
    (c) short
    (d) all of the above

    40. Which of the following stream manipulators used to set the field width (i.e. no of spaces)
    (a) left (b) setwidth (c) setprecision (d) setw

    41. Variables are also known as
    (a) lvalues, but can be used as rvalues
    (b) lvalues, and cannot be used as rvalues
    (c) rvalues, and cannot be used as lvalues
    (d) constant variables

    42. The statement z *= z + y – x ; is equivalent to
    (a) z = z * z + y – x ;
    (b) z = z * ( z + y – x ) ;
    (c) z = z + y – x ;
    (d) none of the above

    43. The value of the following statement is
    ( 6 * 3 == 36 / 2 ) || ( 13 < 3 * 3 + 4 ) && !( 6 – 2 < 5 )
    (a) 0 (b) 1 (c) 9 (d) 18

    44. Which of the following data types can be used to represent integers?
    (a) char
    (b) long
    (c) unsigned int
    (d) (b) and (c)
    (e) all of the above

    45. The value of x after performing the statement: x = ( 3 + 9 * (3 - ( 3 % 9 / ( 3 ) ) ) ) ; is
    (a) 21 (b) 24 (c) 36 (d) 39

    46. If x=2, y=3, z=4 then, the value of z after performing the expression z *= z + y - x is
    (a) 5 (b) 9 (c) 17 (d) 20

    47. The following declarative statement
    #define STOP 999
    (a) means that STOP is a variable carrying the value 999
    (b) means that STOP is a constant carrying the value 999
    (c) is used to print “999”
    (d) is used to print “STOP 999”

    48. Which of the following escape sequences is used to represent a new line?
    (a) \a (b) \t (c) \n (d) \b

    49. Which of the following escape sequences is used to make a beep (alert)?
    (a) \a (b) \t (c) \n (d) \b

    50. If x=4 then, the value of the expression x++ * x % ++x is
    (a) 0 (b) 1 (c) 2 (d) 3

    51. If x=3, y=5, z=2 then, the value of z after performing the expression z *= y - x + y++ / z - y is
    (a) 1 (b) -0.5 (c) -1 (d) -1.5

    52. #include < … > indirective statement is executed by
    (a) preprocessing phase (b) compiling phase (c) linking phase (d) loading phase

    53. the break statement causes
    (a) exit from entire program (b) exit from the current loop
    (c) exit from the current function (d) exit from the current header

    54. The linker creates __________
    (a) an executable image (b) a preprocessor directive
    (c) object code (d) an input stream

    55. The statement using allows us to type __________ instead of ___________.
    (a) print, std::cout (b) std, std::cout
    (c) cout, std::cout (d) cout, std

    56. When a number gets assigned to a variable that already has a value
    (a) the new number overwrites the previous value at that memory location
    (b) the new number gets assigned to a neighboring memory location
    (c) the computer issues an error
    (d) the new value is destroyed and the old value remains

    57. An example of a unary operator is
    (a) a relational operator
    (b) an assignment operator
    (c) an increment operator
    (d) a logical operator

    58. What is the output when the { int i= 5; cout << ( --i += 3 ); } is run?
    (a) nothing
    (b) 7
    (c) 8
    (d) it will not run properly




    Q2) Answer the following questions:

    (a) Define Data.

    (b) Define Computer Program.

    (c) What do we mean by Programming Methodology? Name four Programming Methodologies.

    (d) What is the difference between Structured Programming and Object-Oriented Programming?
    Name a programming language for each type of these two methodologies.

    (e) Define Programming Language.

    (f) Define Software. Can we equate the term Software with Computer Program? Why?

    (g) What is the difference between Program Design and Program Implementation?

    (h) Define the Algorithm. State four different ways to express an algorithm.

    (i) What is a Pseudocode? Write a simple example.

    (j) What is the stream file? Give two examples of stream files.

    (k) What is the difference between Header file and CPP file?

    (l) Justify (give reason for) not placing semicolon (Wink at the end of declarative statements.

    (m) State the three parts that all C++ system consists of?

    (n) In C++ Environment, State the six phases that all C++ programs should gone through them in order to be executed.

    (o) State the Types of Errors in programs. Write an example for each type of error.

    (p) What is the difference between Identifier and Variable? Support your answer with examples.

    (q) Mention three main Features of C++ programming language.

    (r) Explain the critical difference between 3, ’3’ and "3"

    (s) What does the command #include accomplish?

    (t) What are the general rules for naming variable?

    (u) How can we get the ASCII value of the character constant?

    (v) What’s the difference between a signed integer and an unsigned integer?

    (w) Give an example of an unsigned data value.

    (x) Would the following assignment store a 1 (true) or a 0 (false) in Answer?
    Answer = ( 4 == 4 == 4 );



    Trace the following and write the output:

    (i)

    If x=2, y=3, z=4
    Find out the value of the followings separately:

    (a) z *= z + y – x z =…
    (b) y = ++x x =… y =…
    (c) y = x++ x =… y =…

    Output:
    (a) z=20
    (b) x=3 y=3
    (c) x=4 y=3



    (ii)
    Assume the following declarations and initializations:

    int a, c, f=11, e=3;
    double b=10, x=9, y=13;

    then, calculate the following expressions according to the operators priorities:

    a = 7 + 5 * 2 + ( 3 + 4 * 2 + 1 );
    b += 7 / 2 * 7 / 2.0 + x / 2 – y / 2.0;
    c = ++f + e-- + 33 % 10 – 7 % 8;
    cout << "a=" << a << "\t"<<"b=" << b << "\t"<<"c=" << c << endl;

    Output:
    a=29 b=18.5 c=11


    (iii)
    If x=3, y=4, z=5
    Calculate the following expressions separately and step by step according to the operators priorities (precedence):

    (a) x *= x--
    (b) x += z *= x + y
    (c) x + z – 3 % 2 == z / z * 2 || !x – 3 < y * 2

    Output:
    (a) x=8
    (b) x=38
    (c) True or 1


    عدل سابقا من قبل microsoft girl في السبت مارس 21, 2009 2:23 pm عدل 2 مرات
    3TEWE FM 107.6 MHz
    3TEWE FM 107.6 MHz
    ماجيستير
    ماجيستير


    ذكر
    عدد الرسائل : 2417
    العمر : 38
    البلد : jordan
    التخصص : S.E
    الأوسمة : شبح السنافر c++ WEEEESAM
    السٌّمعَة : 25
    نقاط : 391
    تاريخ التسجيل : 17/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف 3TEWE FM 107.6 MHz الجمعة مارس 20, 2009 10:54 pm

    اللهم زد وبارك .
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 10:57 pm

    طبعا الاجابات عندي بس ما حبيت اضيفها حتى تحاولو تحلو واي اجابة حابين تتاكدو منها بس حطو رقم السؤال
    طبعا لسا في كمان اساله
    انتظرو المزيد Laughing
    3TEWE FM 107.6 MHz
    3TEWE FM 107.6 MHz
    ماجيستير
    ماجيستير


    ذكر
    عدد الرسائل : 2417
    العمر : 38
    البلد : jordan
    التخصص : S.E
    الأوسمة : شبح السنافر c++ WEEEESAM
    السٌّمعَة : 25
    نقاط : 391
    تاريخ التسجيل : 17/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف 3TEWE FM 107.6 MHz الجمعة مارس 20, 2009 11:02 pm

    بالتوفيق
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 11:38 pm

    thanx broth
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 11:44 pm

    Write C++ Programs:

    Write a program to display the following text on the screen:
    Welcome to C++ programming language.


    *************************************************************

    Write a program to output the following paragraph on the screen:

    My name is Omar.
    I learn how to program in C++ language
    at faculty of science and IT in Al-Zaytoonah University.

    *********************************************************************


    Write a program that prints the word ALLAH on the screen. The screen should appear as follows:

    A A L L A A H H
    A A L L A A H H
    A A A A L L A A A A H H H H
    A A L L A A H H
    A A LLLL LLLL A A H H



    ***************************************************************************

    Write a program that prints the numbers 1 to 5 on the same line with each pair of adjacent numbers separated by one space.


    ***********************************************************************

    Write a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers.


    ***********************************************************************

    Write a program that inputs three integers from the keyboard and prints the sum, average and product of these numbers


    *************************************************************************


    Write a program that inputs one character from the keyboard and prints its integer equivalent.
    Example: if you entered the character A then the program should prints 65



    ********************************************************************

    Write a program that reads in the radius (r)of a circle and prints the circle’s diameter, circumference and area. Use the constant value 3.14159 for π.
    Where:
    Circle’s diameter = 2r
    Circle’s circumference = 2πr
    Circle’s area = πr2



    ******************************************************************


    Write a program that prints a box and an arrow as follows:

    ******** *
    * * * * *
    * * * * * * *
    * * *
    * * *
    ******** *



    ***********************************************************************


    Write a program that inputs a five-digit number, separates the number into its individual digits and prints the digits separated from one another by three spaces each.
    Example: if you entered the number 89573 then the program should prints: 8 9 5 7 3


    *********************************************************************


    write a program that calculates the squares and cubes of the numbers
    from 0 to 5 and uses tabs to print the following table of values:
    0 0 0
    1 1 1
    2 4 8
    3 9 27
    4 16 64
    5 25 125



    ****************************************************************************

    Write a program to read student’s name, id, and five marks. The program should print the student’s name, id, five marks and average



    *********************************************************************

    Write a program that reads in the weight of a body in pounds, then convert this weight from pounds to kilograms. Where, 1 pound = 0.453592 Kg.



    ********************************************************************

    Write a program that reads a number of seconds (maximum 18000 seconds). Print the number of hours, minutes and remaining seconds that are equivalent to this number of seconds that have been read.
    Example: if number of seconds = 9500
    Then, 9500 seconds = 2 hours, 38 minutes and 20 seconds



    ***************************************************************************


    Write a program that reads an amount of money in fills. Print how many dinars and remaining fills are equivalent to this amount of money which have been read.
    Example: if number of fills = 12530
    Then, 12530 fills = 12 dinars and 530 fills



    ***********************************************************************

    Write a program that reads two numbers a and b. Swap these two numbers and print their values.
    Example: if a=4, b=7
    Then, a=7


    عدل سابقا من قبل microsoft girl في الجمعة مارس 20, 2009 11:54 pm عدل 1 مرات
    Prince Of Jordan
    Prince Of Jordan
    مشرف
    مشرف


    ذكر
    عدد الرسائل : 2368
    العمر : 37
    البلد : The Hashmite Kingdom Of Jordan
    السنة الجامعية : 4th Year
    التخصص : Cs
    السٌّمعَة : 14
    نقاط : 587
    تاريخ التسجيل : 11/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف Prince Of Jordan الجمعة مارس 20, 2009 11:48 pm

    wallah its nice subject but need format (colours and the fonts and order)

    regards
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl الجمعة مارس 20, 2009 11:56 pm

    sorry i will try to make some formate
    Prince Of Jordan
    Prince Of Jordan
    مشرف
    مشرف


    ذكر
    عدد الرسائل : 2368
    العمر : 37
    البلد : The Hashmite Kingdom Of Jordan
    السنة الجامعية : 4th Year
    التخصص : Cs
    السٌّمعَة : 14
    نقاط : 587
    تاريخ التسجيل : 11/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف Prince Of Jordan الجمعة مارس 20, 2009 11:57 pm

    hope that >>regards
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl السبت مارس 21, 2009 2:45 pm

    Chapter 2
    Control Structures


    Q1) Choose the correct answer of the following multiple choice questions:

    1. Which of the following encompasses the other three?
    (a) sequence structure
    (b) repetition structure
    (c) control structure
    (d) selection structure
    ****************************************************2. Which of the following is a repetition structure?
    (a) if
    (b) if/else
    (c) do/while
    (d) switch
    *************************************************
    3. An operator that associates from right to left is
    (a) +
    (b) ?:
    (c) ( )
    (d) !=
    *************************************************
    4. If grade has the value of 60 what will the following code print?
    if ( grade >= 60 )
    cout << "Passed";
    (a) nothing
    (b) 60
    (c) Passed
    (d) cout << "Passed"
    **********************************************
    5. The conditional operator (?Smile
    (a) is the only ternary operator in C++
    (b) is a unary operator
    (c) associates from left to right
    (d) accepts two operands
    ************************************************
    6. Consider the following code, assuming that x is an integer variable with an initial value of 12:
    If ( x = 6 )
    cout << x ;
    What is the output ?
    (a) 6
    (b) 12
    (c) nothing
    (d) a syntax error is produced
    ******************************************************
    7. What is the output when the {char x= 'J'; while (x!='J') cout<<"hi";} is run?
    (a) nothing
    (b) hi
    (c) J
    (d) it will not run properly
    **********************************************
    8. What is the output when the { char x='J'; do cout<<"hi"; while (x!='J'); } is run?
    (a) nothing
    (b) hi
    (c) J
    (d) it will not run properly
    *************************************************
    9. The expression
    if ( num != 65 )
    cannot be replaced by:
    (a) if ( num > 65 || num < 65 )
    (b) if ( !( num == 65 ) )
    (c) if ( num – 65 )
    (d) if ( !( num – 65 ) )
    ***************************************************
    10. Which of the following will not print “Found” if answer is equal to 7 and “Not found” if answer is not equal to 7?
    (a) if (answer == 7 )
    cout << "Found" ;
    else
    cout << "Not found" ;
    (b) cout << answer == 7 ? " Found " : " Not found " ;
    (c) cout << ( answer == 7 ? " Found " : " Not found " ) ;
    (d) answer == 7 ? cout << " Found " : cout << " Not found " ;
    *****************************************************
    11. Assuming that num=2000, then the output of following statement is
    if ( num>100 || num<=1000 )
    cout << "good";
    else
    cout << "bad";
    (a) good (b) bad (c) goodbad (d) badgood
    ****************************************************
    12. if a=4, b=5, x=35 then, the value of a, b and x after executing the following expression become
    if (x = 4+5 == 35) a=b=0;
    (a) a=0, b=0, x=0
    (b) a=0, b=0, x=35
    (c) a=4, b=5, x=0
    (d) a=4, b=5, x=35
    ****************************************************
    13. The following nested if statement
    if ( x>y )
    if ( x%2==0 )
    cout << "done";
    is equivalent to
    (a) if ( x > y && x%2 = 0 ) cout << "done";
    (b) if ( x > y) && (x%2 ==0 ) cout << "done";
    (c) if ( x > y && x%2 ==0 ) cout << "done";
    (d) if ( x > y ) || ( x%2 = 0 ) cout << "done";
    ****************************************************
    14. A switch statement should be used
    (a) as a single-selection structure
    (b) as a double-selection structure
    (c) as a multiple-selection structure
    (d) to replace all if and if/else statements
    ****************************************************15. In a switch structure
    (a) a break is required after each case
    (b) multiple actions do not need to be enclosed in braces
    (c) a default case is required
    (d) a break is required after the default case
    ****************************************************
    16. break is never used in which of the following structures
    (a) do/while
    (b) if/else
    (c) for
    (d) switch
    ****************************************************
    17. switch can be used to test
    (a) integer constants
    (b) float constants
    (c) all types of constants
    (d) string constants
    ****************************************************
    18. What is the result of the following code?
    int x=0;
    switch( x ) {
    case 1: cout<<"One";
    case 0: cout<<"Zero";
    case 2: cout<<"Hello World";
    }
    (a) One
    (b) Zero
    (c) Hello World
    (d) ZeroHello World
    ****************************************************
    19. Which of the following is false?
    (a) break and continue statements alter the flow of control.
    (b) continue statements skip the remaining statements in the body of the loop in which they are
    embedded.
    (c) break statements exit from the loop in which they are embedded.
    (d) continue and break statements may be embedded within all C++ structures.
    ****************************************************
    20. What is wrong with the following while loop?
    while ( sum <= 1000 )
    sum = sum + 30;
    (a) There is no wrong with the above while loop
    (b) The parentheses should be braces.
    (c) Braces are required around sum = sum + 30;.
    (d) There should be a semicolon after While ( sum <= 1000 ).
    ****************************************************
    21. Indefinite repetition is controlled by a
    (a) counter
    (b) sentinel value
    (c) absence of a condition
    (d) non-constant condition


    ****************************************************
    22. What is the output of the following code?
    int x = 1, total = 0 ;
    while ( x >= 5 )
    {
    total += x ;
    x++ ;
    }
    cout << "Total = " << total ;
    (a) Total = 15
    (b) Total = 5
    (c) Total = 0
    (d) display nothing because it is infinite loop
    ****************************************************
    23. How many times will the following program print hello?
    i = 1;
    while ( i++ <= 10 )
    cout << “hello”;
    (a) 0
    (b) 8
    (c) 10
    (d) an infinite number of times
    ****************************************************
    24. The statement
    while ( --counter >= 1 )
    counter % 2 ? cout << "A" : cout << "B";
    cannot be rewritten as
    (a) while ( --counter >= 1 )
    if ( counter % 2 )
    cout << "A";
    else
    cout << "B";
    (b) while ( counter >= 1 )
    if (counter % 2)
    cout << "A";
    else
    cout << "B";
    --counter;
    (c) while ( counter > 1 )
    {
    --counter;
    if ( counter % 2 )
    cout << "A";
    else
    cout << "B";
    }
    (d) do
    {
    --counter;
    cout << ( counter % 2 ? "A" : "B" );
    } while ( counter >= 2 );

    ****************************************************
    25. The following code segment
    int counter=1;
    do {
    cout << counter << " ";
    }
    while ( counter++ <= 5 )
    will
    (a) print the numbers 1 through 4
    (b) print the numbers 1 through 5
    (c) print the numbers 1 through 6
    (d) cause a syntax error
    ****************************************************
    26. The following code segment
    int counter=1;
    do {
    cout << counter << " ";
    }
    while ( ++counter <= 10 )
    will
    (a) print the numbers 1 through 9
    (b) print the numbers 1 through 10
    (c) print the numbers 1 through 11
    (d) cause a syntax error
    ****************************************************
    27. Consider the loop
    for ( int x = 1; x < 5; increment )
    cout << x + 1 << endl;
    If the last value printed is 5, which of the following might have been used for increment?
    (a) x++
    (b) x += 1
    (c) ++x
    (d) Any of the above
    ****************************************************
    28. The following program segment
    for ( int i=5 ; i ; --i )
    cout << "Good Luck" << endl;
    will
    (a) produce an error
    (b) print nothing
    (c) print Good Luck 1 time
    (d) print Good Luck 5 times
    ****************************************************
    29. Having a loop within a loop is known as
    (a) recursion
    (b) doubling up
    (c) nesting
    (d) a redundancy
    ****************************************************
    30. Of the following, which is not a logic error?
    (a) not placing curly braces around the body of an if that contains two statements
    (b) using == to assign a value to a variable
    (c) failing to initialize counter and total variables before the body of a loop
    (d) using commas instead of the two required semicolons in a for header
    ****************************************************
    31. Which of the following for headers is not valid?
    (a) for( int i = 0; i < 10; i++)
    (b) for( int i = 0, int j = 5; ; i++)
    (c) int i = 1;
    for( ; i < 10; i++ )
    (d) for( int i = 0; i < 100; ) i++;
    ****************************************************
    32. Which of the following does counter-controlled repetition require?
    (a) an initial value
    (b) a condition that tests for the final value
    (c) an increment or decrement by which the control variable is modified each time through the loop
    (d) counter-controlled repetition requires all of the above
    ****************************************************
    33. What is the final value of x when the code for( int x=0; x<10; x++ ) is run?
    (a) 10
    (b) 9
    (c) 0
    (d) 1
    ****************************************************
    34. What is the final value of i when the code for( int i=0; i<10; i+=3 ) is run?
    (a) 10
    (b) 9
    (c) 3
    (d) 12
    ****************************************************
    35. What is the output when the code for( ; ; ) cout<<"hi"; is run?
    (a) infinite loop of hi
    (b) hi
    (c) nothing
    (d) it will not run properly
    ****************************************************
    36. What is the final value of i when the code { for( int i=0; i<10; i+=3); cout<<"Hi"; } is run?
    (a) 10
    (b) Hi
    (c) 12 Hi
    (d) it will not run properly
    avatar
    زائر
    زائر


    a رد: شبح السنافر c++

    مُساهمة من طرف زائر السبت مارس 21, 2009 2:50 pm

    تسلمي ع الموضوع المفيد
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl السبت مارس 21, 2009 2:51 pm

    thanx sis
    Prince Of Jordan
    Prince Of Jordan
    مشرف
    مشرف


    ذكر
    عدد الرسائل : 2368
    العمر : 37
    البلد : The Hashmite Kingdom Of Jordan
    السنة الجامعية : 4th Year
    التخصص : Cs
    السٌّمعَة : 14
    نقاط : 587
    تاريخ التسجيل : 11/06/2008

    a رد: شبح السنافر c++

    مُساهمة من طرف Prince Of Jordan السبت مارس 21, 2009 2:56 pm

    thanks
    microsoft girl
    microsoft girl
    مشرف
    مشرف


    انثى
    عدد الرسائل : 214
    العمر : 29
    البلد : why should i tell u
    السنة الجامعية : this is not your business
    التخصص : CS
    السٌّمعَة : 2
    نقاط : 276
    تاريخ التسجيل : 20/03/2009

    a رد: شبح السنافر c++

    مُساهمة من طرف microsoft girl السبت مارس 21, 2009 3:02 pm

    wellcome

      الوقت/التاريخ الآن هو الإثنين أبريل 29, 2024 2:30 am