Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a for loop that will read a number and add all the integers from 1 to that number. For example, if the number

C++ image text in transcribed
Write a for loop that will read a number and add all the integers from 1 to that number. For example, if the number is 5, it should add up 5+4+3+2+1 and sum should be 15. The input/output should be the following (the user input is in bold): 1. Please enter an integer: 7 The sum of 7 to l is: 28 Write a for loop that will take a base and an exponent and will write the result of base raised to the power of exponent. The input/output should be the following (note the user input is in bold): 2. Please enter base: 3 Please enter exponent: 4 The result is: 8 3. Re-write the exercise program using for loop. Ask the user to input the initial energy level. Each time a pushup being done the energy level goes down 2 units. Pushups can only be done when energy level greater than zero. Show the output how many pushups were done. The L/O should be the following (the user input is in bold): Please enter your level of energy (in mumber units): 10 You can perform 5 pushups Write a Bank-CD program that given the principal amount of deposit, number of years the money would be deposited and interest rate, will calculate the CD mature amount. The program will: 4. a. prompt for principal amount, number of years and interest rate. b. calculate the value of the CD at the end of its term write out the year number and the income generated by CD for that year. c. Principal: Interest Rate (%): Number of Years: 1000 5 3 Year Principal Interest Income Total Value 1000.00 1050.00 52.50 1102.5055.13 50.00 1050.00 1102.50 1157.63

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What changes led to the evolution of performers' unions?

Answered: 1 week ago

Question

* develop a model of learning for technique and insight;

Answered: 1 week ago

Question

Identify the different methods employed in the selection process.

Answered: 1 week ago

Question

Demonstrate the difference between ability and personality tests.

Answered: 1 week ago