C++ All Codes
2-1 ********************************** * Programming Assignment 1 * * Computer Programming I * * Author: ??? * * Due Date: Thursday, Jan. 24 * ********************************** In your program, substitute ??? with your own name. If necessary, adjust the positions and the number of the stars to produce a rectangle. - Answer- #include iostream using namespace std; int main() { cout"**********************************" endl; cout "* Programming Assignment 1 *" endl; cout "* Computer Programming I *" endl; cout "* Author: Miguel Soto *" endl; cout "* Due Date: Thursday, Jan. 24 *" endl; cout"**********************************" endl; return 0;} 2-2 Write a program that produces the following output: CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC ++++++++++++++ +++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++ - Answer- #include iostream using namespace std; int main() { cout "CCCCCCCCC ++ ++" endl; cout "CC ++ ++" endl; cout "CC ++++++++++++++ +++++++++++++++" endl; cout "CC ++++++++++++++ +++++++++++++++" endl; cout "CC ++ ++" endl; cout "CCCCCCCCC ++ ++" endl; return 0; } 2-3 step1: Write a C++ statement that allows you to use cin, cout, and endl without the prefix std::. step2: Write C++ statement(s) that declare the following variables: num1, num2,num3, and average of type int. step3: Write C++ statements that store 125 into num1, 28 into num2, and -25 into num3.
Document information
- Uploaded on
- September 5, 2023
- Number of pages
- 18
- Written in
- 2023/2024
- Type
- Other
- Person
- Unknown