daniel_lawson9999

Daniel Lawson Chapter 3 Self Check Problems 13-17 odd

Mar 31st, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. /**
  2.  * Created by Daniel on 3/31/2016.
  3.  Pg. 185 please complete 13 to 17 only odd numbers (Self-Check Problems)
  4.  13.
  5.  
  6.  a. 1.6
  7.  b. 2
  8.  c. 36.0
  9.  d. 64.0
  10.  e. 10.0
  11.  f. 116.0
  12.  g. 7
  13.  h. 5
  14.  i. -5
  15.  j. 8.0
  16.  k.11.0
  17.  l. 102
  18.  m. 17
  19.  n. 20
  20.  o. 3 // used calculator
  21.  p. 14.0
  22.  
  23.  15.
  24.  grade = 2.7
  25.  grade = 2.7
  26.  grade =3
  27.  min = 2
  28.  x = 16.0
  29.  x = 8.0
  30.  count = 25
  31.  count = 5
  32.  a = 3
  33.  
  34. 17.
  35.  */
  36. /**
  37.  * Created by Daniel on 3/31/2016.
  38.  */
  39. public class selfCheck17 {
  40.     public static void main (String[] args){
  41.  
  42. System.out.print(counterQuarters(124)); // print statement to test method
  43.     }
  44.     public static int counterQuarters(int cents){
  45.         double money = cents /100.0;
  46.         double dollars = Math.floor(money);
  47.         double extraCents = (money - dollars)*100;
  48.          int quarters =  (int)extraCents / 25;
  49.         return quarters;
  50.  
  51.  
  52.  
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment