subject

Append newValue to the end of vector tempReadings. Ex: If newValue = 67, then tempReadings = {53, 57, 60} becomes {53, 57, 60, 67}. #include
#include
using namespace std;
int main() {
vector tempReadings(3);
int newValue = 0;
unsigned int i = 0;
tempReadings. at(0) = 53;
tempReadings. at(1) = 57;
tempReadings. at(2) = 60;
newValue = 67;
/* Your solution goes here */
for (i = 0; i < tempReadings. size(); ++i) {
cout << tempReadings. at(i) << " ";
}
cout << endl;
return 0;
}
2.Remove the last element from vector ticketList.
#include
#include
using namespace std;
int main() {
vector ticketList(3);
unsigned int i = 0;
ticketList. at(0) = 5;
ticketList. at(1) = 100;
ticketList. at(2) = 12;
/* Your solution goes here */
for (i = 0; i < ticketList. size(); ++i) {
cout << ticketList. at(i) << " ";
}
cout << endl;
return 0;
}
3. Assign the size of vector sensorReadings to currentSize.
#include
#include
using namespace std;
int main() {
vector sensorReadings(4);
int currentSize = 0;
sensorReadings. resize(10);
/* Your solution goes here */
cout << "Number of elements: " << currentSize << endl;
return 0;
}
4. Write a statement to print "Last mpg reading: " followed by the value of mpgTracker's last element. End with newline. Ex: If mpgTracker = {17, 19, 20}, print:
Last mpg reading: 20
#include
#include
using namespace std;
int main() {
vector mpgTracker(3);
mpgTracker. at(0) = 17;
mpgTracker. at(1) = 19;
mpgTracker. at(2) = 20;
/* Your solution goes here */
return 0;}

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, abelxoconda
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
image
Computers and Technology, 22.06.2019 19:10, sammigrace5820
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, raiapowell
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
image
Computers and Technology, 23.06.2019 23:30, jamalchris9353
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
You know the right answer?
Append newValue to the end of vector tempReadings. Ex: If newValue = 67, then tempReadings = {53, 57...

Questions in other subjects: