Advertisement
Guest User

fk this easy class is retarded

a guest
Sep 22nd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. // Dan Hardison
  2. // The second activity of a budget calculator designed to help people manage their finances.
  3. // CS 007
  4. // 09/16/2014
  5. import java.util.Scanner; // needed to get input from user
  6. public class P1A4_Hardison_3812280 {
  7.  
  8.  
  9. public static void main(String[] args) {
  10. String userName; // store & test variables. Int used for simple numbers, double used in case of dollar amounts or percentages.
  11. int hoursWorked; // store variable for later
  12. int othoursWorked; // store variable for later
  13. int rentDue; // store variable for later
  14. int foodBudget;
  15. int funBudget;
  16. double otwageEarned;
  17. double carBill;
  18. double wageEarned; // store variable for later
  19. double grossPay; // store total earnings for later
  20. double eBill; // double used for these variables because of possible decimals for percentages
  21. double sBill;
  22. double wBill;
  23. double gBill;
  24.  
  25.  
  26. System.out.println("Welcome to Dan's calculator"); // Introduction to program
  27. System.out.println("This program will assist you in calculating your budget!");
  28. System.out.println("Coded by Dan Hardison");
  29. System.out.println("---------------------");
  30.  
  31. // Get Scanner set up & get information
  32. Scanner keyboard = new Scanner(System.in);
  33.  
  34. // get information w/ scanner
  35.  
  36. System.out.println("Please enter your own name");
  37. userName = keyboard.nextLine();
  38.  
  39. System.out.println("How many hours do you work per week?");
  40. hoursWorked = keyboard.nextInt();
  41.  
  42. System.out.println("How many overtime hours did you work?");
  43. othoursWorked = keyboard.nextInt();
  44.  
  45. System.out.println("What is your current job's wage?");
  46. wageEarned = keyboard.nextDouble();
  47.  
  48. System.out.println("What is your current job's overtime wage?");
  49. otwageEarned = keyboard.nextDouble();
  50.  
  51. System.out.println("What percentage of your pay goes towards the electric bill?");
  52. eBill = keyboard.nextDouble();
  53.  
  54. System.out.println("What percentage of your pay goes towards your water bill?");
  55. wBill = keyboard.nextDouble();
  56.  
  57. System.out.println("What percentage of your bill goes towards your sewage bill?");
  58. sBill = keyboard.nextDouble();
  59.  
  60. System.out.println("What percentage of your bill goes towards your gas bill?");
  61. gBill = keyboard.nextDouble();
  62.  
  63. System.out.println("How much money do you want to spend on food?");
  64. foodBudget = keyboard.nextInt();
  65.  
  66. System.out.println("How much money do you want to spend on entertainment?");
  67. funBudget = keyboard.nextInt();
  68.  
  69. System.out.println("How much money do you have to spend on your car each month?");
  70. carBill = keyboard.nextDouble();
  71.  
  72. grossPay = (wageEarned * hoursWorked)+(othoursWorked * otwageEarned);
  73.  
  74. // print variables
  75. System.out.println("Hello, " + userName);
  76. System.out.println("You've worked this number of hours:" +hoursWorked);
  77. System.out.println("You've worked this number of over-time hours:" +othoursWorked);
  78. System.out.println("Your current wage is: " +wageEarned);
  79. System.out.println("You spend this percentage of your pay on electricity:" +eBill);
  80. System.out.println("You spend this percentage of your pay on water:" +wBill+ "%");
  81. System.out.println("You spend this percentage of your pay on sewage:" +sBill+ "%");
  82. System.out.println("You spend this percentage of your pay on gas:" +gBill+ "%");
  83. System.out.println("You want to spend this much money on food: $" +foodBudget);
  84. System.out.println("You want to spend this much money on entertainment: $" +funBudget);
  85. System.out.println("Now let Dan's Budget Calculator™ do the rest!");
  86. System.out.println("-----------------------------------------------");
  87. System.out.println( );
  88. // Doing the math for their gross income
  89.  
  90.  
  91. }
  92.  
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement