How do you program using Java?

How to write a program to compute a monthly telephone bill using java code with loop?

  • The main method that begins by prompting the user to enter the cost per minute for local calls. It should repeatedly process calls. It should prompt the user for the type of call, either local or long distance and the length of the call in minutes. It should then call processLocal or processLongDistance as appropriate. After the cost of each call has been calculated, the total cost thus far for local and long distance service should be accumulated. Then it should prompt the user to determine whether there are more calls to process. After all calls have been processed, it should compute and display the monthly total. Assume that there is a $5.00 minimum for long distance service. A method called processLocal that is passed the call length and the cost per minute. The maximum cost for any local call is $2.00. It calculates, displays and returns the cost of the call. A method called processLongDistance that is passed the call length. Long distance calls are charged at $1.00 for the first twenty minutes, meaning all long distance calls cost at least $1.00. Calls longer than twenty minutes are charged five cents per minute thereafter. It calculates, displays and returns the cost of the call. Input and output for this program should be done using the showInputDialog and showMessageDialog methods of the JOptionPane class.

  • Answer:

    paste the code that you have started and will be more than willing to help you write it and figure it out. This is a pretty strait forward program and won't take much time to code once you get started.

None at Yahoo! Answers Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.