Answer:
<h2>
C++ Code:</h2>
#include <iostream> //header file for input output functions like cout cin
#include <sstream> // reads from string as a stream
#include <string>
// header file for strings
using namespace std; // used for computer to detect endl cout, cin
int main() { //start of the main function of the program
string userItem; // declare string type variable
ostringstream itemsOSS; // output string stream
cout << "Enter items (type Exit to quit):" << endl;
// prompts user to enter items and type Exit to quit
cin >> userItem; //reads input userItems
while (userItem != "Exit") { //loop that runs untill userItem gets equal to Exit
itemsOSS << userItem << " ";
// inserts userItem into the output string stream itemsOSS
cin >> userItem;
} //reads items stored in userItem variable
cout << itemsOSS.str() << endl;} // prints current contents of the itemsOSS.
<h2>
Explanation:</h2>
I will explain the code line by line.
- The first line includes a header file iostream which is used for input and output functions such as cin, cout etc.
- The next line includes sstream header file to read from a string as a stream. String streams are streams containing strings. Strings are treated like streams and stream operations are used on these strings.
- The next line includes string header file in order to use strings in the program.
- Next line namespace is used for the computer to identify objects like endl, cin, cout.
- This lines starts the main function and enters the body of main function.
- A string type variable userItem is declared.
- ostringstream type variable itemsOSS is declared. ostringstream class works on strings.
- This line prompts the user to enter the items and type Exit word to quit. endl is used to insert new line.
- This line read input from variable userItem which is inserted by the user.
- This statement starts a loop which will continue to execute until the user types Exit.
- In the body of while loop, this line shows that the items entered by the user in userItem will be inserted into the output string stream itemsOSS. Every userItem is followed by a space. << this is insertion operator. This retrieves items from the input sequence and inserts them into the itemsOSS, until Exit is typed.
- Next line reads items stored in userItem variable.
- str() returns a copy of the string which is manipulated by the current stream string and it outputs the contents of the itemsOSS stream.
<h2>
Output:</h2>
Enter items (type Exit to quit):
red purple yellow Exit
red purple yellow
No, I am not in active recovery from a substance use disorder (addiction). Active recovery is defined as being free from an alcohol or other drug use disorder or no longer using alcohol or other drugs is a true statement.
<h3>What does it mean to be in addiction recovery?</h3>
The statement implies that a person is working very hard to be successful in handling their addiction and getting back control of your life.
Note that it is not an easy road but one can overcome. Therefore, my response is No, I am not in active recovery from a substance use disorder (addiction) because i do not drink it. Active recovery is defined as being free from an alcohol or other drug use disorder or no longer using alcohol or other drugs is a true statement.
Learn more about Active recovery from
brainly.com/question/28027699
#SPJ1
Answer:
Option B is the correct answer.
Explanation:
Because of an app builder and they need to display the groups as the final menu items of the navigation in the software of the mobile. Then, they unable to select those groups in which the items list on the menu. So, that's why the following groups are not in the list of the selected navigation menu.
Other option is not true because they are not according to the following statement.
Answer:
They are called video game publishers
Explanation:
A video game publisher is responsible for financing a video game’s development, marketing, and release of the game to the consumers. Basically, they are the ones who manage the business end of the gaming field. If the video game company is well established, the publishers of that company will be the ones to distribute while some smaller companies will hire distribution companies to distribute the games for them
Answer:
<em>public static void printLarger(double sales1, double sales2){</em>
<em> if (sales1>sales2){</em>
<em> System.out.println(sales1+" is larger");</em>
<em> }</em>
<em> else {</em>
<em> System.out.println(sales2+" is larger");</em>
<em> }</em>
<em> }</em>
<em>A complete code calling the printLarger method is given below</em>
Explanation:
<em>public class Larger{</em>
<em> public static void main(String[] args) {</em>
<em> int sales1 = 100;</em>
<em> int sales2 = 120;</em>
<em> printLarger(sales1,sales2);</em>
<em> }</em>
<em>public static void printLarger(int sales1, int sales2){</em>
<em> if (sales1>sales2){</em>
<em> System.out.println(sales1+" is larger");</em>
<em> }</em>
<em> else {</em>
<em> System.out.println(sales2+" is larger");</em>
<em> }</em>
<em> }</em>
}