Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Daniel on 3/31/2016.
- Pg. 185 please complete 13 to 17 only odd numbers (Self-Check Problems)
- 13.
- a. 1.6
- b. 2
- c. 36.0
- d. 64.0
- e. 10.0
- f. 116.0
- g. 7
- h. 5
- i. -5
- j. 8.0
- k.11.0
- l. 102
- m. 17
- n. 20
- o. 3 // used calculator
- p. 14.0
- 15.
- grade = 2.7
- grade = 2.7
- grade =3
- min = 2
- x = 16.0
- x = 8.0
- count = 25
- count = 5
- a = 3
- 17.
- */
- /**
- * Created by Daniel on 3/31/2016.
- */
- public class selfCheck17 {
- public static void main (String[] args){
- System.out.print(counterQuarters(124)); // print statement to test method
- }
- public static int counterQuarters(int cents){
- double money = cents /100.0;
- double dollars = Math.floor(money);
- double extraCents = (money - dollars)*100;
- int quarters = (int)extraCents / 25;
- return quarters;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment