Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Code required, please use 108 as an input and it should not result in negative monthly payments Good news!! You won the grant price

C++ Code required, please use 108 as an input and it should not result in negative monthly payments

Good news!! You won the grant price just for being awesome!! However, as in many things in life, there is a catch. Your prize will be paid to you in monthly installments.

The payments will start in the amount of 1 dollar. Obviously that is not too much of a price at the beginning. But here are two rules we can apply every month to increase the installments.

Rule A - Double the installment amount.

Rule B - Triple the installment amount.

You are free to apply Rule A every month, but Rule B can be applied only every other month.

To maximize payments.

1st month's payment 1 dollar.

2nd month's payment 2 dollars. (doubled the amount)

3rd month's payment 6 dollars. (triple it every other months)

4th month's payment 12 dollars. (double the amount)

5th month's payment 36 dollars. (triple it every other month)

6th month's payment 72 dollars. (double the amount)

7th month's payment 216 dollars. (triple it every other month)

and so on ...

Write a program that will compute the monthly payment amounts you will get over a given number of months.

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions