{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw3 - EME5 Homework 3(Problems 3-11 3(Ch 4 Problem 3 Write...

This preview shows pages 1–4. Sign up to view the full content.

EME5 Homework 3 (Problems 3-11) 3. (Ch. 4, Problem 3) Write a program that reads an integer and determines and prints whether it is odd or even. 4. (Ch.4, Problem 4) What does the program print? 5. (Ch.4, Problem 7) Write a program using a for-loop to print the following sequence including commas: 2, 4, 6, 8, 10, 12, 14, 16 1 4 9 16 25 36 49 64 81 100 Total is 385 6. (Ch. 4, Problem 9) Write a program that calculates and prints the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
average of several integers. 7. (Ch.4, Problem 12) What is the value of the sum after the code is executed? sum = 4
8. (Ch. 4, Problem 15) Write a program that will display the total amount of money with the interest compounded annually from 1 to 30 years. The user enters the principal and rate of interest. The mathematical relationship is y = p (1 + r ) n where y is the amount, p the principal invested, r the interest rate, and n the number of years. Draw the flowchart for the program. Test your program with the invested principal of \$10,000 and 5% interest rate.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}