Hi,
I don't know why my java program won't add up the numbers but here is the code:
import java.util.Scanner; /* Design, code and test a program to enable a user to type in four savers' balances and the percentage bonus (which is the same for everyone). The program should then output the new balances for each saver. */ class saverBonus { public static void main(String[] args) { Scanner input = new Scanner(System.in); double newBalance, bonus, fourSavers, sum, percentageBonus; sum = 0; System.out.print("Please input the first savers' balance: "); fourSavers = input.nextDouble(); System.out.print("Please input the second savers' balance: "); fourSavers = input.nextDouble(); System.out.print("Please input the third savers' balance: "); fourSavers = input.nextDouble(); System.out.print("Please input the fourth savers' balance: "); fourSavers = input.nextDouble(); sum = fourSavers + fourSavers; System.out.print(fourSavers + sum); } }
What can I do to alter the code to make it add up the numbers together?
Thanks