Exam1S10_A_solution

Exam1S10_A_solution - EAS 230 Exam 1 February 24, 2010 Your...

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

View Full Document Right Arrow Icon
EAS 230 Exam 1 February 24, 2010 Circle the correct output of the following program in the box to the right of the program statements using namespace std; #include<iostream> #include<iomanip> #include<cmath> int main() { cout<<"Problem 1"<<endl; int i = 3.54; cout << i << endl; cout<<"Problem 2"<<endl; int j=0; while(j<4){ j++; cout << " Here j = " <<j<< endl; j++; } cout<<"Problem 3"<<endl; double cost = 2; double up = 0.3, down = 0.5; cost += up-down; cout << cost <<endl; cout<<"Problem 4"<<endl; int k=-1; while (k<2) { k++; cout << k++ << endl; } cout<<"Problem 5"<<endl; char e = 'a'; if(e=='A')cout << "CAPITAL" << endl; cout<<" e is an "<<e<<endl; Problem 1 a. 3.5 b. 3 c. 4 d. 4.0 Problem 2 a. Here j = 1 Here j = 3 b. Here j = 0 Here j = 2 c. Here j = 3 d. Here j = 1 Problem 3 a. 2.3 b. 2 c. 2.2 d. 1.8 Problem 4 a. 1 3 b. 0 1 c. 0 2 d. 2 4 Problem 5 a. e is an a b. CAPITAL e is an A c. e is an A d. CAPITAL Your Name:___________________________________ Your UBIT Name:_______________________________ Your Section Circle One: (A1, A2, A3, A4, B1, B2, B3, B4, B5)
Background image of page 1

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

View Full DocumentRight Arrow Icon
EAS 230 Exam 1 February 24, 2010 2A cout<<"Problem 6"<<endl; int f; for (f=1;f<=4;f++){ cout<<"quad,f= "<<4*f++<<endl;} cout<<"Problem 7"<<endl; double r=4, s=2, t=0; int h; h=r*pow(s/r,t*2); cout<<h<<endl; cout<<"Problem 8"<<endl;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/28/2011 for the course CSE 230 taught by Professor Harvey during the Spring '11 term at SUNY Buffalo.

Page1 / 5

Exam1S10_A_solution - EAS 230 Exam 1 February 24, 2010 Your...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online