Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Telephone
- */
- import java.util.*;
- public class Telephone
- {
- public static void main (String [] args)
- {
- Scanner console = new Scanner (System.in);
- int hours;
- int minutes;
- int starthour;
- int endhour;
- double pricemin;
- System.out.print ("Enter the time the call begins in 24 hour format:");
- starthour =console.nextInt ();
- System.out.print ("Enter the time the call ends in 24 hour format:");
- endhour =console.nextInt ();
- minutes= (starthour-endhour/10);
- pricemin = (minutes * .40);
- System.out.println ("Call Summary: ");
- System.out.println ("Call start at" + starthour + "for" + minutes + "minutes");
- if (starthour >= 1800)
- if (endhour <= 800) {
- System.out.print (pricemin* .50);
- System.out.print ("The total cost of the call is" + pricemin* .50 *.07);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement