Assignment: Each question is worth 20 points. Type your answers in a separate document. 1. Give two examples of legal identifiers in C++ and two examples of illegal identifiers. 2, Write a for loop in C++ to add 3 + 6 + 9 + … + 3n, n>=1. 3. Define function definition, function prototype, and function call. Give examples. 4. Give an example of a switch statement in C++, show how you can translate the statement into an if statement. 5. Write a C++ program that lets the user enter ten values into an array. The program should then display the largest value stored in the array.
Assignment:
Each question is worth 20 points.
Type your answers in a separate document.
1. Give two examples of legal identifiers in C++ and two examples of illegal identifiers.
2, Write a for loop in C++ to add 3 + 6 + 9 + … + 3n, n>=1.
3. Define function definition, function prototype, and function call. Give examples.
4. Give an example of a switch statement in C++, show how you can translate the statement into an if statement.
5. Write a C++ program that lets the user enter ten values into an array. The program should then display the largest value stored in the array.
Each question is worth 20 points.
Type your answers in a separate document.
1. Give two examples of legal identifiers in C++ and two examples of illegal identifiers.
2, Write a for loop in C++ to add 3 + 6 + 9 + … + 3n, n>=1.
3. Define function definition, function prototype, and function call. Give examples.
4. Give an example of a switch statement in C++, show how you can translate the statement into an if statement.
5. Write a C++ program that lets the user enter ten values into an array. The program should then display the largest value stored in the array.