Question: In java Complete the following: a) Suppose we want to compute the amount of money in a bank account with compound interest. If the amount

In java Complete the following:

a) Suppose we want to compute the amount of money in a bank account with compound interest. If the amount of money in the account is m, the amount in the account at the end of the month will be 1.005m. Write a recursive method that will compute the amount of money in an account after t months with a starting amount of m.

b) Suppose we have a satellite in orbit. To communicate to the satellite, we can send messages composed of two signals: dot and dash. Dot takes 2 mi- croseconds to send, and dash takes 3 microseconds to send. Imagine that we want to know the number of different messages, M(k), that can be sent in k microseconds.

If k is 0 or 1, we can send 1 message (the empty message).

If k is 2 or 3, we can send 1 message (dot or dash, respectively).

If k is larger than 3, we know that the message can start with either dot or dash. If the message starts with dot, the number of possible messages is M(k 2). If the message starts with dash, the number of possible messages is M(k 3). Therefore the number of messages that can be sent in k microseconds is M(k 2) + M(k 3).

Write a program that reads a value of k from the keyboard and displays the value of M(k), which is computed by a recursive method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!