Line 7 you are indexing an unknown variable, did you mean to use list_vec as your vector's name?
BTW, naming your vector "list," especially since you have usingnamespace std; is not a good idea.
There is a C++ container, std::list. Remove std:: as you do with usingnamespace std; and you get name clashes you wouldn't have otherwise. This is one of the reasons why usingnamespace std; is considered a bad practice and should be avoided.
Your for loop would work if there were no errors.
FYI, with modern C++ (C++11) you can use an initializer list to create a vector with known values. You could create your vector like this:
2 3
// create a vector of strings using an initalizer list
std::vector<std::string> list_vec { "Rock", "Paper", "Scissors" };
In addition to Furry Guy's last post the double quotes around "Rock", "Paper" and "Scissors" are slanted double quotes. The compiler does not like this. It is looking for double quotes that are vertical not slanted.
Furry Guy's advice doesn't apply here since the assignment specifically says that the vector is called "list". Don't you just hate it when the prof requires to use bad practices??
Write a function called CalculateMortgagePayment. It should return the monthly payment. It will take in 3 parameters: the loan amount, the interest rate, and the number
of years. (Note: you only need to write the function declaration and not the logic to
calculate a monthly payment.)
Note: you only need to write the function declaration and not the logic to
calculate a monthly payment.
So the answer is simply double CalculateMortgagePayment(double loan_amount, double interest_rate, int years);
Don't forget that semicolon at the end of the declaration.
#3:
The condition for a while loop goes inside the parentheses: while (condition) statement;
Use || for logical OR | means bit-wise OR.
You need to compare the string to "quit". Do you know howto specify a literal string like that?
#4:
I guess that will work, but it's way more complicated than what I would have written. You don't need to write a whole program and you don't need to print the words out and you don't need to read words from the user. All the question asks is that you put "hello" and "world" into the vector.
#5.
Member names can't be multiple words. In other words, "first name" is not a valid member variable name.
C++ is case sensitive, so Struct and Int should be struct and int.
You have declared first name as an int. What sort of values can be stored in it it? Are they sufficient?
Seriously, is this really the final exam for the semester? I have to say that these are "first week of class" mistakes.