Write a C++ program that prints out the following menu for a game (include the line of asterisks (*) on top and bottom). Try to use "endl" and the escape sequences \n, \t in your program.2 *********************************************** Welcome! Please choose a number from the following options: 1. Play the MAD LIBS game! 2. Play the CHOOSE YOUR OWN ADVENTURE game! 3. Exit *********************************************** Q#5: Write a C++ program to print out the following sentences. This is a practice of e

Answers

Answer 1

Answer:

#include <iostream>

using namespace std;

const int NRSTARS=50;

int main() {

 cout << string(NRSTARS, '*') << endl;

 cout << "Welcome!\nPlease choose a number from the following options:" << endl;

 cout << "1. Play the MAD LIBS game!" << endl;

 cout << "2. Play the CHOOSE YOUR OWN ADVENTURE game!" << endl;

 cout << "3. Exit" << endl;

 cout << string(NRSTARS, '*') << endl;

}

Write A C++ Program That Prints Out The Following Menu For A Game (include The Line Of Asterisks (*)
Answer 2

The example C++ program that prints the menu and the sentences is shown below:

What is the program

cpp

#include <iostream>

int main() {

   std::cout << "***********************************************" << std::endl;

   std::cout << "Welcome! Please choose a number from the following options:" << std::endl;

   std::cout << "1. Play the MAD LIBS game!" << std::endl;

   std::cout << "2. Play the CHOOSE YOUR OWN ADVENTURE game!" << std::endl;

   std::cout << "3. Exit" << std::endl;

   std::cout << "***********************************************" << std::endl;

   // Printing out sentences

   std::cout << "Q#5: Write a C++ program to print out the following sentences:" << std::endl;

   std::cout << "Sentence 1: Hello, world!" << std::endl;

   std::cout << "Sentence 2: I love programming." << std::endl;

   std::cout << "Sentence 3: C++ is a powerful language." << std::endl;

   return 0;

}

Read more about  program here:

https://brainly.com/question/23275071

#SPJ2


Related Questions

CH4 has how many of each type of atom?

Answers

Its easy that moderators that see this answer can think that my answer isn't without explanation.

• Type of atom C (Carbon)

C = 1

• Type of atom H (Hydrogen)

H = 4

You dont understand? JUST SEE THE FORMULA C MEANS ONLY HAVE 1 CARBON ATOM AND H4 MEANS 4 ATOM OF HYDROGEN

oK. have a nice day hope you understands

Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:
As long as x is greater than 0
Output x % 2 (remainder is either 0 or 1)
x = x // 2
Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string.
Ex: If the input is:
6
the output is:
110
Your program must define and call the following two functions. The function integer_to_reverse_binary() should return a string of 1's and 0's representing the integer in binary (in reverse). The function reverse_string() should return a string representing the input string in reverse.
def integer_to_reverse_binary(integer_value)
def reverse_string(input_string)
Note: This is a lab from a previous chapter that now requires the use of a function.

Answers

Answer:

#include <iostream>//header file

#include <string>//header file

using namespace std;

string integer_to_reverse_binary(int integer_value)//defining a method integer_to_reverse_binary  

{

   string ret = "";//defining string variable

   while (integer_value > 0) //using while loop to check integer_value value is greater than 0

   {

       ret += '0' + (integer_value % 2);//adding zeros in remainder value

       integer_value /= 2;//holding quotient value

   }

   return ret;//return string value

}

string reverse_string(string input_string)//defining a method reverse_string that holds a parameter user_String  

{

   string result;//defining a string variable  

   for (int i = 0; i < input_string.length(); ++i)//use for loop to calculate value  

   {

       result += input_string[input_string.length()-i-1];//add value in result variable

   }

   return result;//result result variable value

}

int main()//defining main method  

{

   int num;//defining integer variable

   string str;//defining string variable

   cin >> num;//input num value

   str = integer_to_reverse_binary(num);//use str variable to call the integer_to_reverse_binary method

   cout << reverse_string(str) << endl;//printing the reverse_string method value

   return 0;

}

Output:

6

110

Explanation:

In this code two string method "integer_to_reverse_binary and reverse_string" is defined that holds one parameter "integer_value and input_string".

In the first method a string variable is defined, that use the while loop to check integer value is greater than 0 and add zeros in the value and return its value as a string.

In the second it reverse the string value and store into the result variable, and in the main method the "num and str" variable is defined, and in the num it takes integer value and pass into the above method and print its return value.    

How do I fix a phone if I don't have enough money for me to fix it?

Answers

Answer:

depends whats wrong with it

Explanation:

is the screen smashed orr~

What is the influence of new technology on society?
Ο Α. .
New technology hardly has any impact on society.
OB.
New technology is only beneficial to society and cannot be detrimental.
OC.
New technology is detrimental, as it makes the existing technology obsolete.
OD. New technology normally utilizes a lot of resources and can adversely affect the economy.
O E.
New technology is beneficial but can also be usedly a detrimental way.

Answers

Answer:

E. New technology is beneficial but can also be used in a detrimental way.

Explanation:

New technology such as cryptocurrency (powered by blockchain technology) can be regarded as a welcome development that has benefited the society in so many good ways. However, cryptocurrency as a new technology also has disadvantages it presents to the society. One of such negative influence cryptocurrency has is that it can be used for illicit activities such as money laundering, funding terrorism and so on.

So, in summary, we can conclude that:

"New technology is beneficial but can also be used in a detrimental way."

Other Questions
How is the field of physics related to mechanical engineering? what is the missing number in 100+blank=1,0000 A band will sell CDs of their music at their concert for $5.00 each. The band ordered 300 CDs at a cost of $1.25 each. Which inequality represents the number of CDs, n, the band needs to sell to make a profit of at least $500? 1. x is greater to or equal to 99 2. x is greater to or equal to 100 3. x is greater to or equal to 133 4. or x is greater to or equal to 134 5- Mon pre, il n'aime pas sortir sans moi et ma mre.6- Il a mis les photos dans le tiroir. Need help pls will give crown 2. A bag of dog food weighs 40 lb. By weight, 16% of the ingredients is turkey. Find the weight of turkey in the dog food.a) Show the work to set up the problem. You may either use the percent equation, set up a proportion, or use a ratio table but SHOW YOUR WORK.b) What is the weight of the turkey in the dog food according to your work in part a? Solve and show your work. 26 divided by 1690 help please once again solve the system by graphing y = x -1 y = -2x -4 What happened when red light and cyan light combine, what colour of light results? Responses which are acquired after birth are called _____ responses. Find the the value of xIll mark the brainiest PLZ HELP I GIVE U BRAINLIEST Suppose you are given an unknown solution and you need to test its pH. The pH meter is broken, and all you have is the indicator bromothymol blue to use. You add two drops of bromothymol blue to 10 mL of your unknown, and the solution turns a bright yellow. Which of the following is the best estimate of the pH of the unknown solution?a. 8.5b. 11.5c. 1.5d. 7.0 Please help asap please i give brainliest WILL MARK BRAINLIEST AMD THANKS What is the measure of Angles are not necessarily drawn to scale.I hate math You are training to run the 100 m race at a track and field meet.You time yourself and find you can run it in 10 seconds. How fast are you abke to run it PLZ HURRY IT'S URGENT!!!What are the roots of the quadratic?-3 and 0-3 and 1-1 and 3-1 and -3 What was General Howe's reason for capturing Philadelphia instead of Albany?A.) He didn't have enough supplies to make the long trip to Albany.B.) He thought he could destroy the Continental Army's morale by capturing the United States capital.C.) He didn't want to go north when winter was coming.D.) He had secret orders from England to go to Philadelphia and capture the Liberty Bell. w=she suznsnsja. sanna abs ssm _______ is the act of moving from one place to another. a. movingb. locomotionc. runningd. walking