Advertisement
Guest User

george bush

a guest
Aug 29th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. /**
  2. * Telephone
  3. */
  4. import java.util.*;
  5.  
  6. public class Telephone
  7. {
  8. public static void main (String [] args)
  9. {
  10.  
  11. Scanner console = new Scanner (System.in);
  12.  
  13. int hours;
  14. int minutes;
  15. int starthour;
  16. int endhour;
  17. double pricemin;
  18.  
  19.  
  20.  
  21.  
  22. System.out.print ("Enter the time the call begins in 24 hour format:");
  23. starthour =console.nextInt ();
  24. System.out.print ("Enter the time the call ends in 24 hour format:");
  25. endhour =console.nextInt ();
  26.  
  27. minutes= (starthour-endhour/10);
  28. pricemin = (minutes * .40);
  29.  
  30. System.out.println ("Call Summary: ");
  31. System.out.println ("Call start at" + starthour + "for" + minutes + "minutes");
  32.  
  33.  
  34.  
  35.  
  36.  
  37. if (starthour >= 1800)
  38. if (endhour <= 800) {
  39. System.out.print (pricemin* .50);
  40. System.out.print ("The total cost of the call is" + pricemin* .50 *.07);
  41.  
  42.  
  43. }
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement