hw3 - EME5 Homework 3 (Problems 3-11) 3. (Ch. 4, Problem 3)...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
average of several integers. 7. (Ch.4, Problem 12) What is the value of the sum after the code is executed? sum = 4
Background image of page 2
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. Output:
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 04/21/2008 for the course EME 005 taught by Professor Cheng during the Fall '07 term at UC Davis.

Page1 / 5

hw3 - EME5 Homework 3 (Problems 3-11) 3. (Ch. 4, Problem 3)...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online