Question: Part 1 : if - statement Open the part 1 . cpp file. In the main ( ) function, prompt for 3 integers, and report

Part 1: if-statement
Open the part1.cpp file. In the main() function, prompt for 3 integers, and report whether one of the numbers is the product of the other two, as shown in the following examples:
Enter 3 integers separated by spaces: 13
2
None of the integers is the product of th e other two
Enter 3 integers separated by spaces: 6236 is the product of 2 and 3
Enter 3 integers separated by spaces: 11555
55 is the product of 11 and 5
Enter 3 integers separated by spaces: 4-7-28
-28 is the product of 4 and -7
Part 2: while-loop
Open the part2.cpp file. In the main () function, prompt once for an arbitrary number of numeric grades separated by white space, where the grades are terminated with a negative value:
Enter grades separated by white space and ending with a negative value: 89.276.095.462.388.7-1.0
The minimum grade is 62.3
The maximum grade is 95.4
The average grade is 82.32
White space means one or more space, tab, carriage return, and/or newline characters. The latter is produced by the Enter key. Hence, the grades can be placed on a single or multiple lines. If no value appears on a line, the program will keep attempting to read a value. Make sure you confirm all these input possibilities. If no actual grades are entered (only a negative value is typed), then the minimum/maximum/average should not be displayed.
A while loop is appropriate, which requires a read from before the loop starts and again as the last operation within the loop. The initial read from is called the priming read because it starts the repetition. The loop
?
its when a negative value is read.
Part 3: for-loop
One formula to compute the Euler number, e, is 1+11!+12!+13!+14!+15!+dots Here, the symbol "!" refers to the factorial function. Write a program that prompts for the largest denominator, n, in this series and uses a loop to sum up the series. Finally, display the e approximation:05
Open the part3.cpp file. In the function, use a for loop with an integer index that iterates over 1,2,3,4,dots
A loop typically assigns an initial value to an integer index, tests whether the index has reached the final value, and modifies the index on the same line. There is no need for nested loops since the value for i! can be calculated from the previously computed value of (i-1)!.
In order to display more than the standard 5 decimal digits, you need the s function, which sets the precision parameter of the stream out exactly to
Part 1 : if - statement Open the part 1 . cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!