Question: 1) Write a program to calculate the sum of all input numbers as follow: Use loop to accept an unspecified number of integer inputs. When
1) Write a program to calculate the sum of all input numbers as follow: Use loop to accept an unspecified number of integer inputs. When a value of 0 is entered, print out the calculation and exit the program. Note: 0 is not counted in calculation. If the number is even, SQUARE that number before adding it to the Sum. If the number is odd, CUBE that number before adding it to the Sum. 2) Write a program that inputs a sequence of numbers, the program gets input from user until it receives a number 0. Calculate the sum of all non-negative numbers of that sequence and the quotient of that sum with the sum of all negative numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
