How to use Methods to organize my code and use Methods as databanks to store values?
<p>I had to write a program that calculates the cost of calls.
The cost of the call is determined according to the following rate schedule.</p>

<p>a) Any call started between 8am and 6pm, Monday-Friday, is billed at a rate of $0.40 per minute.</p>

<p>a) Any call started before 8am and after 6pm, Monday-Friday, is billed at a rate of $0.25 per minute.</p>

<p>a) Any call started on Saturday or Sunday, is billed at a rate of $0.15 per minute.
The user has to enter the day of the week, the hour they started and minutes, and also the number of minutes they spoke( use a 24-hour clock *hint)</p>

<pre><code>Ex:
Day: Monday
Hour: 00
Minutes:00
Minutes talked:10,080

Output = $2,682,00.
Enter another? (y/n)
</code></pre>

<p>And here is what I have so far....</p>

<pre><code>import javax.swing.JOptionPane; //          
public class LongDistance
{
public static void main ()
{   
    double Rate40 = 0.40;
    double Rate25 = 0.25;
    double Rate15 = 0.15;
    //
    int d1=01 ;
    int d2=02;
    int d3=03;
    int d4=04;
    int d5=05;
    int d6=06;
    int d7=07;
    //
    String StartMinute;
    int StartMinutes;
    //
    String TalkTime;
    int TalkTimes;
    //
    String Day;
    int Days7;
    //
    String Hour;
    int Hours24;

    int Night = 1440;
    int Evening = 1080;
    int Morning = 480;
    int PastMidNight = 0;

        Day = JOptionPane.showInputDialog("enter start day:\n");

        Days7 = Integer.parseInt(Day);

        Hour = JOptionPane.showInputDialog("enter start hour:\n");

        Hours24 = Integer.parseInt(Hour);
        int HoursInMins = Hours24 * 60;

        StartMinute = JOptionPane.showInputDialog("enter start minute:\n");

        StartMinutes = Integer.parseInt(StartMinute);

        TalkTime = JOptionPane.showInputDialog("enter talk time:\n");

        TalkTimes = Integer.parseInt(TalkTime);

            do{
                    TalkTimes+=HoursInMins;
                    if ( TalkTimes &gt; 1080 &amp;&amp; TalkTimes &lt; 1440 )
                    { 
                        Night-=HoursInMins;
                        Night*=Rate40;
                        System.out.println("Total Call Cost = $" + Night);
                    }
            }while ( Hours24 &gt; 480 &amp;&amp; Hours24 &lt; 1080 &amp;&amp; Days7 != 06 &amp;&amp; Days7 != 07 );
}
</code></pre>

<p>}</p>
