The Artima Developer Community
Sponsored Link

Java Answers Forum
could anyone help me to solve this problem

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
henry

Posts: 3
Nickname: hlz3
Registered: Jul, 2002

could anyone help me to solve this problem Posted: Aug 5, 2002 5:47 PM
Reply to this message Reply
Advertisement
i am doing a very simple program which is calculating the charge for the call. i have already written the program, but i had a problem is: i want to keep asking using user to input the duration for the call, but i don't know how to using return value. could anyone fix it up for me please thanks a lot:here are the program


import TerminalIO.*;
public class Callcharge{

KeyboardReader reader= new KeyboardReader();
ScreenWriter writer= new ScreenWriter();

int initialcost=25;
double charge;
double time;

public void run(){

time= reader.readDouble (" Please enter the calling time in seconds");
while(time<=0)
time= reader.readDouble(" Invalid duration, please enter another duration");

charge = initialcost +(time/30 *35);
writer.print(" The charge for the call is");
writer.println(charge);
reader.pause();

}
public static void main (String [] args) {
Callcharge tpo= new Callcharge();
tpo.run();
}
}

Topic: Available Disk Space ! Previous Topic   Next Topic Topic: question about linked list

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use