Homework 8

 

1. Write a program that reads in a product computation of the following form:

 

N0 * N1 * N2 * N3 * Ö * Nn =

... and returns the product of the given ints, along with the number of terms in the product. Note that you donít know how many integer values the user will enter until they enter an equal sign (=).

An example run of your program might look like this (with the user input in red):

Please enter a product to be computed, followed by an = sign.
: 4 * 56 * 2 * 7 * 4 =
The product of the 5 numbers entered is 12544

Turn In a printout of the source code for your program and two screenshots, one showing your program running with the input from above, and the second screen shot showing your program running for the below input:

111 * 222 * 333 * 444 * 555 * 666 =

2. Explain the strange answer you get for the second input above (111 * 222 * Ö)

Turn in your source code, the two screen shots, and the answer to question 2.