Unit 01 - //Written by Chris Torres #include...

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

View Full Document Right Arrow Icon
1. Write a C++ application that will run on your computer as a stand-alone application. The program should print out: This is my first program for the Unit 01 Readiness Test . #include <iostream> using namespace std; int main(void) { cout << "This is my first program for the Unit 01 Readiness Test." << endl; return 1; } 2. Write a C++ application that will run on your computer as a stand-alone application. The program should define two constants. The first one is BASE and the second one is HEIGHT. The program should print out the phrase: "The area of a right triangle with HEIGHT of ____ and BASE of ____ is ____." Where the values in the first two blanks are the assigned values of the HEIGHT and BASE respectively while the value of the third blank is the actual area. Make sure that you include the calculations of the correct answers in your code. Please add a comment of your choice at the beginning of the program.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Written by Chris Torres #include <iostream> #define BASE 3 #define HEIGHT 4 using namespace std; int main(void) { cout << "The area of a right triangle with HEIGHT of " << HEIGHT << " and BASE of " << BASE << " is " << BASE*HEIGHT << "." << endl; return 1; } 3. Please find out the errors in the following code. Fix the errors and submit the FULL corrected code as your answer. Include using namespace std Main(int) { float a; a=10 Cout<<("the value of a=); Return; } #include <iostream> using namespace std; int main(int) { float a; a=10; cout << ("the value of a=") << a << endl; return 0; } 4. What would the following lines print out? cout << (5+4)*2 << endl; cout << (7/3+7%3) << endl; cout << (7+4)/3 << endl; cout << (5*6)/(2+3) << endl; 18 3 3 6...
View Full Document

This note was uploaded on 04/29/2011 for the course ME 205 taught by Professor Koen during the Spring '07 term at University of Texas.

Page1 / 3

Unit 01 - //Written by Chris Torres #include...

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