{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

q3 sol - CSCI.1100 Computer Science I Quiz 3 Closed book...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI.1100 Computer Science I Quiz 3 September 27, 2007 Closed book, closed notes, no computers or calculators of any kind. Name: RCS login: Circle your lab section: (01 MR 10:00) (02 MR 12:00) (03 MR 2:00) (04 MR 4:00) (05 MR 6:00) (06 MR 10:00) (07 TF 10:00) (08 TF 12:00) (09 MR 12:00) (010 TF 2:00) You will have 15 minutes to complete this test. Make sure you do not spend too much time on any question. The time spent on each question should be proportional to the number of points 1. Mark each of these five statements TRUE if the statement is a valid test of whether the character c is a digit, otherwise mark it FALSE? (1 point each) a) if (’0’ <= c <= ’9’) { FALSE b) if (c > ’0’ && c < ’9’) { FALSE c) if (c == ’0’ || c == ’1’ || c == ’2’ || c == ’3’ || c == ’4’ || c == ’5’ || c == ’6’ || c == ’7’ || c == ’8’ || c == ’9’) { TRUE d) if (!(c < ’0’ || c > ’9’)) { TRUE
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
e) if (!(c < ’0’) && !(c > ’9’)) { FALSE 2. What will the program below print a. If run as is (1 point) #include <iostream> using namespace std; Nothing int main() { int a=9, b=7, c=5; if (c > b) { if (c > a) { cout << "first" << endl; } else { cout << "second" << endl; } } else { if (b > a) {
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern