Question (1): Write a program that asks the user to enter an integer greater than zero and store it in a variable called “n". Then it calculates the final value that will be stored in a variable...


Question (1): Write a program that asks the user to enter an integer greater than zero<br>and store it in a variable called “n

Extracted text: Question (1): Write a program that asks the user to enter an integer greater than zero and store it in a variable called “n". Then it calculates the final value that will be stored in a variable called “s" according to the following equation. 1х 2 2 x 3 3 x 4 4 x 5 Nx (N+ 1) .. ( + or - ) 2 3 4 5 N+1 And add an exception when the user enters any value other than integer shows the message “You entered non integer value, please try again.", and let the user to enter a new value. Enter an integer: 4 Example 1 S = -2.0 Enter an integer: a You entered non integer value, please try again. Ехample 2 Enter an integer: 4 S = -2.0

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here