Create an account to track your scores
and create your own practice tests:
Test: Computer Science
#include <iostream>
#include <string>
using namespace std;
int main() {
string name;
cout << "Tell me your name: "<<endl;
getline(cin, name);
sayHello();
return 0;
}
void sayHello(string nameToGreet){
cout << "Hello, " << nameToGreet << "!"<< endl;
}
1. | Why would the above program fail? |
There is no problem.
nameToGreet
was never defined.
name
is not the right type.
sayHello
should not be of type void
.
sayHello
doesn't exist at the point it is called.
Computer Science Tutors in Top Cities:
Atlanta Computer Science Tutors, Austin Computer Science Tutors, Boston Computer Science Tutors, Chicago Computer Science Tutors, Dallas Fort Worth Computer Science Tutors, Denver Computer Science Tutors, Houston Computer Science Tutors, Kansas City Computer Science Tutors, Los Angeles Computer Science Tutors, Miami Computer Science Tutors, New York City Computer Science Tutors, Philadelphia Computer Science Tutors, Phoenix Computer Science Tutors, San Diego Computer Science Tutors, San Francisco-Bay Area Computer Science Tutors, Seattle Computer Science Tutors, St. Louis Computer Science Tutors, Tucson Computer Science Tutors, Washington DC Computer Science Tutors
Popular Courses & Classes
MCAT Courses & Classes in Chicago, Spanish Courses & Classes in Washington DC, Spanish Courses & Classes in Houston, MCAT Courses & Classes in Houston, LSAT Courses & Classes in Chicago, SSAT Courses & Classes in Seattle, SSAT Courses & Classes in San Diego, ACT Courses & Classes in Denver, SSAT Courses & Classes in Dallas Fort Worth, Spanish Courses & Classes in New York City
