Answer:
The program in C++ is as follows:
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> nums;
int num;
cin>>num;
while(num != -1){
nums.push_back(num);
cin>>num; }
for (auto i = nums.begin(); i != nums.end(); ++i){
cout << *i <<endl; }
return 0;
}
Explanation:
This declares the vector
vector<int> nums;
This declares an integer variable for each input
int num;
This gets the first input
cin>>num;
This loop is repeated until user enters -1
while(num != -1){
Saves user input into the vector
nums.push_back(num);
Get another input from the user
cin>>num; }
The following iteration print the vector elements
<em> for (auto i = nums.begin(); i != nums.end(); ++i){
</em>
<em> cout << *i <<endl; }
</em>
Answer:
expr.at(g) returns a string, not a char. They are not the same thing and that is what the compiler is complaining about.
What the method does, is it takes the rightmost decade and prints it, then divides by 10 and repeats. Effectively this means the number is printed backwards, so the output is 128.
Given the options, I would choose Option C. =B1+B2+B3+B4+B5.
Here are some important points:
- we use it to do essays for school
- we can use it to do flyers for recreational events
- we can use it to do pamphlets to inform people
- it is versatile, so you can create many different types of documents
- you can create charts
This can be your opening statement
Today, there is a lot asked of a child in school. From charts to essay to projects, the average kid has at least 10 different programs they use just for one project. But there is one program that came along and changed everything, and that program is called Microsoft word. Microsoft word is valuable because it is versatile (what I wrote earlier about it being able to do many different tasks), it simplifies your experience (what i said about it being able to combine different programs into one), and it is free (you can write about how some programs charge to use their high-grade programs but microsoft is free and avaialabe on every windows
computer.)
GOOD LUCK !