Rank the following in terms of abstraction, with 1 being the lowest / closest to the bare metal of a computer, and 4 being the highest level / greatest amount of abstraction (4pts)
True or False: The object (.OBJ) files created by the compiler are meant to be read by humans. (1 pt).
Which of the following lines could be used to store user input into the firstName variable? Circle your answer (2 pts)
cin >> firstName;
cout >> firstName;
cin << firstName;
cout >> firstName;
cin
to take input (cout
is used for output). Once we're using cin, we also need to use the proper operator. The >> operator is what we want, and will extract input from the default input stream. The << operator, on the other hand, will output to the default output stream.The following code is almost correct, but would fail to compile. Add to it so that it would compile and successfully and print “Hello World” to the console. Hint: there are two different changes you could make, either one of which would fix the issue. (3pts)
#include <iostream>
int main()
{
cout >> "Hello, world\n";
return 0;
}
#include <iostream>
int main()
{
std::cout >> "Hello, world\n";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout >> "Hello, world\n";
return 0;
}