{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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

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

View Full Document
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) {
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern