The following C++
cout ≪ “Success\n”;
cout ≪ “Success\n\n";
int main()
cout ≪ “Success”;
}
using namespace std;
// It’s a mad, mad program
#include <iostream>
cout ≪ “Success\n”;
{
return 0;
When the lines are properly arranged, the program should display the following on the screen:
Success
Success Success
Success
Rearrange the lines in the correct order. Test the program by entering it on the computer, compiling it, and running it.
Learn your wayIncludes step-by-step video
Chapter 2 Solutions
STARTING OUT C++.+MATLAB+MYPROGRAMLABCDE
Additional Engineering Textbook Solutions
Concepts of Programming Languages (11th Edition)
Database Concepts (7th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
C++ How to Program (10th Edition)
Modern Database Management (12th Edition)
Starting Out with C++: Early Objects (9th Edition)
- Q1) How to write a C program segment that prompts and accepts the age and number of hours the customer has spent in the “FUNNY Theme Park”. Then, displays the charges based on the rates shown in Figure 2 below : Age Range Rate ( per hour) (RM)0-20 1.0021-50 3.50Above 50 2.00 In your program, you have to make use of THREE(3) different defined constants for the value of rate per hour and declare the necessary variables.arrow_forwardWhat will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int const p = 5; cout << ++p; return 0; } a) 5 b) 6 c) Error d) 8arrow_forwardThanks for the help, but I'm not finished yet. Here are my instructions for my C++ program: Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following strings:madam, abba, 22, 67876, 444244, trymeuemyrt Modify the function isPalindrome of Example 6-6 so that when determining whether a string is a palindrome, cases are ignored, that is, uppercase and lowercase letters are considered the same. The isPalindrome function from Example 6-6 has been included below for your convenience. bool isPalindrome(string str) {int length = str.length(); for (int i = 0; i < length / 2; i++) {if (str[i] != str[length – 1 – i]) {return false;} // if } // for loopreturn true;}// isPalindrome Your program should print a message indicating if a string is a palindrome: madam is a palindrome Here's what I have so far: //Include the neccessary header files.#include <iostream>#include <string.h>#include <algorithm> //Declare the…arrow_forward
- What will be the output of the following C++ code? #include <iostream>using namespace std;int main(){float num1 = 1.1;double num2 = 1.1;if (num1 == num2)cout << "Canada";elsecout << "US";return 0;}arrow_forwardWhat will be the output of the following C++ code? #include <iostream>using namespace std;enum cat {temp = 7};int main(){int age = 14;age /= temp;cout << "If you were cat, you would be " << age << endl;return 0;}a) If you were cat, you would be 5b) If you were cat, you would be 2c) If you were cat, you would be 7d) If you were cat, you would be 9arrow_forwardWhat will be the output of the following C++ code? #include <iostream>using namespace std;int main(){int a;a = 5 + 3 * 5;cout << a;return 0;}a) 35b) 20c) 25d) 30arrow_forward
- What will be the output of the following program in C++? #include<iostream> using namespace std; int main () { int cin; cin >> cin; cout << "cin: " << cin; return 0; }arrow_forwardWhat will be the output of the following program in C++? #include<iostream>using namespace std;int main (){int cin;cin >> cin;cout << "cin: " << cin;return 0;}arrow_forwardWhat will be the output of the following C++ code? #include <iostream> using namespace std; enum cat { temp = 7 }; int main() { int age = 14; age /= temp; cout << "If you were cat, you would be " << age << endl; return 0; }arrow_forward
- please complete the following program in c++ and avoid using any advanced manipulators, strings, or global variables. Also please share your outuput results. (sample desired results are shown) Many Thanksarrow_forwardIdentify and correct which statement (s) in the following C++ programs will cause a compiler error? In your answer, you have to write and correct only the statement that has the syntax error. #include <iostream> using namespace std; int main( ) { int netIncome; double taxBill; double fivePercentTax, tenPercentTax; cout >> "Enter net income (rounded to whole dollars) $"; cin >> netIncome; if (netIncome <= 15000 taxBill = 0; else taxBill = (0.05**(netIncome - 15000)); cout << "Net income = $" << netIncome << endl cout << "Tax bill = $" << taxBill << endl; retrn 0; }arrow_forwardWhat is the output of the following C++ program segment? Assume all variables are properly declared. for (j = 0; j < 8; j11){cout << j * 25 << " - ";if (j != 7)cout << (j + 1) * 25 - 1 << endl;elsecout << (j + 1) * 25 << endl;}arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr