Help with Methods


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Help with Methods

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Posts
    2

    Help with Methods

    I am a beginner in Java. I have been learning java by myself during the last few weeks and facing some difficulties with a question i got from a collegue of mine who did java at uni level. I don't know have to work with methods and she can't remember as well. Could some please help me out ??

    Question:-

    A telephone cost plan:

    Local calls are charged at $0.50 per minute(between 9a.m and 9pm). Long distance calls (> 200 miles) are charged at $1.10 per minute((between 9a.m and 9pm). From 9p.m to 9a.m,calls are charged at half the normal rate.

    I have to write a program which calculates the total cost of an arbitrary number of calls. For each call, the person using the phone needs to enter a time value (in 24hr mode), a distance (in miles), and a call length (in minutes). The program must then display the cost of that call and also adds the cost onto a cumulative total.

    When the phone user has no more calls to process, a time value of -999 instead of a legal time. When the program reads this sentinel value it displays the total cost of all the processed calls and ends.

    Thnx.

    Your help would be very appreciated.

  2. #2
    Join Date
    Feb 2004
    Posts
    541
    Well you'll have to be a little more specific before we can help you. Post what you have so far and let us know specifically which bits you're having trouble with and then we'll be able to help

  3. #3
    Join Date
    Apr 2005
    Posts
    5
    I agree with Mike. When I was doing Java in college these posts were everywhere. You shouldn't want someone to create a solution for you. Jump into documentation and books and figure it out.

    When you think you have or run into specific problems, reply.

    --tony

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center