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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr.nextdouble(); minutestraveled = scnr.nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system.out.println("miles: " + milestraveled); } }
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. which cable would she prefer to use? jennifer would prefer to use because its metal sheath reduces interference.
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
This graph compares the cost of room and board at educational institutions in texas.
Answers: 1
You know the right answer?
Append newValue to the end of vector tempReadings. Ex: If newValue = 67, then tempReadings = {53, 57...
Questions
question
Mathematics, 25.09.2020 03:01
question
Mathematics, 25.09.2020 03:01
question
Chemistry, 25.09.2020 03:01
question
English, 25.09.2020 04:01
question
Geography, 25.09.2020 04:01
question
Mathematics, 25.09.2020 04:01
Questions on the website: 13722362