Respuesta :
Answer:
Following are the code to this question:
In question 1:
tempReadings.push_back(newValue); //using array that store value in at 3 position
In question 2:
ticketList.pop_back(); //defining ticketList that uses the pop_back method to remove last insert value
In question 3:
currentSize = sensorReadings.size(); /defining currentSize variable holds the sensorReadings size value
In question 4:
cout<<"Last mpg reading: "<<mpgTracker.at(mpgTracker.size()-1)<<endl;
//using mpgTracker array with at method that prints last element value
Explanation:
please find the attachment of the questions output:
- In the first question, it uses the push_back method, which assigns the value in the third position, that is "53, 57, 60, and 67 "
- In the second question, It uses the pop_back method, which removes the last element, that is "5 and 100"
- In the third question, It uses the "currentSize" variable to holds the "sensorReadings" size value, which is "10".
- In the fourth question, It uses the mpgTracker array with the "at" method, which prints the last element value, which is "20".
![Ver imagen codiepienagoya](https://us-static.z-dn.net/files/d5c/0d8591501cc15c01870ecbeba5ed17d0.png)
![Ver imagen codiepienagoya](https://us-static.z-dn.net/files/d39/f3d3fbe2fe8ed998e19297c846852233.png)
![Ver imagen codiepienagoya](https://us-static.z-dn.net/files/d6e/eac60a3252885e015714104bf25c4d5b.png)
![Ver imagen codiepienagoya](https://us-static.z-dn.net/files/ded/a34e0343b2b1bdb1471a97c25766177a.png)