Unit 01 - /Written by Chris...

Info icon This 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.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern