// Question #1 - basic structure #include #include using namespace std; int main() { // Question #2 - 4 points // part 1 char aa; // or char letter = 'a'; // part 2 float p = 12.344; // or double z = 12.344; // part 3 string name = "barb"; // part 4 int myInts[5]; // Question 3 - 3 points for (int i=0; i<10; i++) { cout << i; } cout << endl; // Question 4 - 3 points int d = 0; while (d < 10) { cout << d; d++; } // Question 5 - 4 points int a, b ,c; b = a + 2; a = b * 4; b = a/3.14; a = b-8; // Question 6 string n; cout << endl << "Enter your name: "; cin >> n; cout << "Hello, " << n << endl; // Question 7 int x, y; if (y == 100) { x=1; } else { x=0; } cout << endl; // Question 8 int num; cout << "Enter a # between 1 & 3"; cin >> num; switch(num) { case 1: cout << num; break; case 2: cout << num; break; case 3: cout << num; break; } // Question 9 string fname, address, phone; fname = "Barb"; address = "123 Sesame Street"; phone = "555-1212"; // or // string na="Barb", address="a", phone = "55"; // or string na="barb"; string ad="a"; string ph="55"; cout << name << address << phone; // Question 10 int age = 21; float weight = 100; cout << "My age is " << age << "my weight is " << weight; return 0; }