C++, simple loop, switch/if statement, function,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.
6 years ago 30
Answer(2)
Purchase the answer to view it
- hwm.zip
Purchase the answer to view it
- Task-1.docx
- Task2.docx
- Task-3.docx
- Task4.docx
- Task5.docx
other Questions(10)
- Evaluate education and training programs that exist in jails and prisons across America. Explain why you believe that t hese programs are beneficial to the inmates they are designed to help? Justify why you think we spend too much money trying to rehabi
- list at least two ways in which we may communicate messages unintentionally ?
- Assignment 4: Legal and Ethical Considerations in Marketing, Product Safety, and Intellectual Property
- Conflict Management Report
- Music and Culture Essay with Examples
- bus
- EVALUATING ART
- week 11
- Homework
- Homework