Computer Science, asked by techelectricorg, 1 month ago

At the birth of Marie, his grandfather Nestor opens a bank account. Then, every birthday, the grandfather of Marie verses 100$ into her bank account and he adds the double of her age. For example, when she was two years old, he verses 104$ (100$ + (2*2years) $). Write a java program that allows determining how much money Marie will have during her nth birthday

Answers

Answered by sujatalagah29
0

Answer:

package ssPackage;

import java.util.Scanner;

public class Rough {

public static void main (String[] args)

{

//storing nestor's first amount in bank

double a = 100;

double n_a = 0;

for(int i = 1; i<= 9; i++)

{

 System.out.print("Enter the number:");

  Scanner s =new Scanner(System.in);

  int n=s.nextInt();

n_a = n_a + a + (2*i);

}

System.out.println("The money Marie will have on her 9th birthday wIill be " + n_a);

}

}

Explanation:

Similar questions