Laura Biddle

                                                                                                            11/2/06

                                                                                                            Fund. Of Computing

 

 

Chapter 8 HW:

 

8)  cout << “Enter a value for Time in Hours” << endl;

     cin >> Hours;

     cout << “Enter a value for Time in Minutes” << endl;

     cin >> Minutes;

 

12)  The output of the following sequence is 66, because although at first A = 12 and B = 20, B becomes equal to B + 1 (so it is 21) and A becomes equal to A + B (so it is 33).  The output is 2 * A or 2 * 33, which is 66.

 

13)  cout << “What is the length of the rectangle?” <<endl;

       cin >> Length;

       cout << “What is the width of the rectangle?” <<endl;

       cin >> Width;

       Area = length * width;

       cout << “The area of this rectangle is” << Area <<endl;

 

 

 

Chapter 10 HW:

 

7)  a- <identifier> ::= <first> <second>

          <first>::= <letter>

          <second>::= <letter>|<digit>

          <letter>::= A|B|C|D|…|Z

          <digit>::= 0|1|2|…|9

          <identifier> is the goal symbol

 

    b- 

 

 

15)  There are two different interpretations of the sentence “I bought a shirt in the new store that was too large”. 

            Interpretation 1: I bought a shirt in the new store (that was too large).

            Meaning: The shirt I bought, which turned out to be too big, was from some kind   of store.

             Interpretation 2: I bought a shirt in the new store (that was too large).

            Meaning: The store in which I bought my new shirt was way too large.