Homework 12

·  ·  Write a program that asks the user for a value (double) for x.   The program should then ask the user for a value (integer) for N that is greater than or equal to three.  As long as the user provides an invalid N, continue to ask until he provides a valid N. Once a correct N is provided, use a for loop to calculate the sum below and then print the answer.

Hint: Google “cplusplus.com pow()” for details on how to raise x to the power k.