OK, I'm fairly new to Java and I wanted to try if I could convert an easy Microsoft Excel problem into Java but I've hit a road block. I was wondering if one of you could point me in the right direction.
I'm trying to write that would double pay everyday for 35 numbers and show the output as...
You were paid $.01 on Day 1. Your total salary is $.01
You were paid $.02 on Day 2. Your total salary is $.03
You were paid $.04 on Day 3. Your total salary is $.07
Now, below is what I have so far. My question is: do I use a while Loop statement or an if-else Loop statement?
================================================== ===
import java.util.*;
import java.text.DecimalFormat;
public class MoneyMaker
{
public static void main(String[] args)
{
int numberOfDays;
double totalSalary, maximumDays, startingPay;
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter the number of days worked:");
numberOfDays = keyboard.nextInt();
}
}
================================================== =