C++, simple loop, switch/if statement, function,array

profilehelix2569

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.

    • 6 years ago
    • 30
    Answer(2)

    Purchase the answer to view it

    blurred-text
    • attachment
      hwm.zip

    Purchase the answer to view it

    blurred-text
    • attachment
      Task-1.docx
    • attachment
      Task2.docx
    • attachment
      Task-3.docx
    • attachment
      Task4.docx
    • attachment
      Task5.docx