Write a program that calculates the sum and product of 2, 4, 6, 8,..., n, where n is a user entered even integer value.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Write a program that calculates the sum and product of 2, 4, 6, 8,..., n, where n is a user entered even integer value.

Post by answerhappygod »

Write A Program That Calculates The Sum And Product Of 2 4 6 8 N Where N Is A User Entered Even Integer Value 1
Write A Program That Calculates The Sum And Product Of 2 4 6 8 N Where N Is A User Entered Even Integer Value 1 (20.93 KiB) Viewed 43 times
Write a program that calculates the sum and product of 2, 4, 6, 8,..., n, where n is a user entered even integer value. You will define two methods sumToN[int n) and productToN(int n) that calculate these two values. The following is a sample run: Enter a positive even number: 16 2+4+...+16 = 72 2*4*...*16= 10321920
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply