Java

Problem 2-4 Pennies Problem

Problem 2-4. Pennies Problem. Here’s an old problem. Today, I’ll give you a penny. Tomorrow, I’ll give you two pennies. I’ll keep doubling the amount I’ll give you for 30 days. How much will you have at the end of the month (better use a long integer type to keep track)?

Respuesta :

it is easy to type this in Java

Explanation:

class pennies 1

{

public static void main ()

{

System.Out.println("Here’s an old problem. Today, I’ll give you a penny. Tomorrow, I’ll give you two pennies. I’ll keep doubling the amount I’ll give you for 30 days. How much will you have at the end of the month (better use a long integer type to keep track)?")

}

}