Exam1F08Part2

Exam1F08Part2 - EAS 230 Exam 1 PART 2 Problems 11-20...

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

View Full Document Right Arrow Icon
1 EAS 230 Exam 1 PART 2 Problems 11-20 October 15, 2008 7:00 PM 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> double f1(double, double); int f2(double, int); void f3(int, double&);int main() { cout<<"Problem 11"<<endl; int i[]={4, 2, 1, 3}; cout << i[2] << endl<<endl; cout<<"Problem 12"<< endl; int j[4],j4=1; do { j[j4]=j4*2; cout << j[j4] << endl; j4++; }while (j4 <= 2); cout<<endl<<endl; cout<<"Problem 13"<<endl; double shareprice = 5; double updown[]= {0.2, 0.5}; shareprice *= (1 + updown[0]); shareprice -= (shareprice*updown[1]); cout << shareprice << endl; cout<<endl<<endl; cout<<"Problem 14"<<endl; double k[]={1.1, 2.2, 3.3}; cout<<"f1= "<<f1(k[2],k[0])<<endl; cout<<endl<<endl; //f1 is defined at end of this file //program continues here Your Name:___________________________________ Your UBIT Name:_______________________________ Your Section Circle One: (A1, A2, A3, A4, B2, B3, B4)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
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 / 3

Exam1F08Part2 - EAS 230 Exam 1 PART 2 Problems 11-20...

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

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