Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Anita Thapa
Java prog
1 Answer(s)      5 years and 9 months ago
Posted in : Java Beginners



Advertisement
View Answers

November 20, 2008 at 4:37 AM


Hi friend
i hope it helps u to resolve the probleam
you do changes in calculation part as ur requirement.

import javax.swing.JOptionPane;

public class JOption {
public static void main(String[] args) {
String ans;
ans = JOptionPane.showInputDialog(null, "Cost of Machine");
double cost = Double.parseDouble(ans);
ans = JOptionPane.showInputDialog(null, "Life of Machine");
double life = Double.parseDouble(ans);
ans = JOptionPane.showInputDialog(null, "Enter the cost of Capital in %");
double perc = Double.parseDouble(ans);

double LeaceRent = cost*life* perc;
JOptionPane.showMessageDialog(null, "Annual Lease Rent = " + LeaceRent);

System.exit(0);
}
}


Thanks...


Related Tutorials/Questions & Answers:
java prog
java prog  find out a string from the collection of string in java
java prog
java prog  write a java program to accept a file name as command line argument.Append the string "file modified by program" to the end of the same file and print the contents of the modified file
Advertisements
java prog
java prog  Write a Java applet that inputs a person's date of birth (month, day, year): ā?¢ Informs the person if the year of birth is a prime number. ā?¢ Informs the person if the year of birth is a leap year. ā?¢ Computes
java prog que
java prog que  create a class that returns the reverse of each word in the given string. For example if we give "who are u?" as input, it should return "ohw era u
servlet prog - Java Interview Questions
servlet to jsp? how a thread or request pass from one servlet prog to one jsp prog? is it possible of communicating from servlet to jsp prog? please explain briefly with one java code example? Thanks in advance
Java entry prog.
Java entry prog.  Dear sir I will enter the dept code, dept name and insert into dept_mast and save. Pl. Dept_mast Dept_code Char(2) Primary key (no duplicate key allowed) Dept_name Char(25
Java prog - Java Beginners
Java prog  Write a program on Java that ask the user to input: Cost of Machine, Life of Machine, Cost of capital in Percentage, in an JOption pane window and that calculates and outputs Annual Lease rent.  Hi friend i
java applet prog
java applet prog  applet to display scrolling text from right to left in an applet window using thread. text should be accepted by html parameter
Hashtable java prog - Java Interview Questions
Hashtable java prog  Create a hashtable with some student hall ticket numbers and their results. when we type a hallticket number,it shud display the results? please provide the detail java code for this? thanks in advance
Hashtable java prog - Java Interview Questions
Hashtable java prog  Create a Hashtable with some students hall ticket numbers and their results. when you type a hall tickets number,it shud display the results? please provide the java code detaily for this query?thanks
NEED A PROG
NEED A PROG   whats the program to add,delete, display elements of an object using collecions. without using linked list   Hi Friend, Try the following code: import java.util.*; class CollectionExample { public
turbo C prog.
turbo C prog.  Is is possible print ASCII value of a alphabets using turbo C prog
question "writing prog"
question "writing prog"  Hello I want helping for this question, please Write a program that reads some friendsā?? names, stores them in an array, and then prints out on the screen all friends who start by a particular letter
Solution to C prog
Solution to C prog   Hi, Pls any body help, why the following prog crashing while running. #include<stdio.h> #include<conio.h> int main(){ int n,*fact(int *n); printf("Enter the number:"); scanf
make a prog for this query
make a prog for this query  write a program implementing interface for personal data n salary details. interface must contain abstract methods. steps for the program are 1) store the data in text file 2)display salary when emp id
turbo C prog.
turbo C prog.  Is it possible to print ASCII value A to Z with out using scan ? also give to simple example of binary search ...   #include<stdio.h> #include<conio.h> void main() { for(char c='A';c<
turbo C prog. Q3
turbo C prog. Q3  What is the difference between if and ladder if ? Describe ladder if with example. What is the purpose of the parameter passing ? please Describe with example.   if statement is used to write
Prog Error - JSP-Servlet
Prog Error   Place Ad function Browse() { Advertisement Management System Create Ad State: City: Main Category: Sub Category: Title
(ForPro) turbo C prog. Q4
(ForPro) turbo C prog. Q4  I need to learn some easy foxpro program.. for example sum,interchange, loop etc
Spring Hello World prog - Spring
Spring Hello World prog  I used running the helloworld prog code mentioned in http://www.vaannila.com/spring/spring-mvc-tutorial-1.html I'm getting null pointer exception. as shown below. I added all the jars and my
prog. using radio buttons for simple calculator
prog. using radio buttons for simple calculator  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Calculator extends JFrame { private final Font BIGGER_FONT = new Font
prog. using radio buttons for simple calculator
prog. using radio buttons for simple calculator  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Calculator extends JFrame { private final Font BIGGER_FONT = new Font
if i run this prog, i got exeption in thread "main" java.lang.ArrayIndexOutOfBoundsException:0 at Maxof2.main(Maxof2.java:9), whats the resolution for ths?
if i run this prog, i got exeption in thread "main" java.lang.ArrayIndexOutOfBoundsException:0 at Maxof2.main(Maxof2.java:9), whats the resolution for ths... with run command. Run your code with the following statement: java Maxof2 5 6
interface variables - Java Beginners
interface variables  why interface variable is by default final? what was the necessisity to make it final? plz explain me with good java prog
java - Struts
java  how to use frames in struts prog -- any sample example prog give
Servlet & Jsp - Java Interview Questions
servlet to jsp? how a thread or request pass from one servlet prog to one jsp prog? is it possible of communicating from servlet to jsp prog? please explain briefly with one java code example? Thanks in advance.   Hi Friend, Try
Java servlet sql connectivity error - JSP-Servlet
Java servlet sql connectivity error  Hi, I have been trying... successful so far. However when i try to connect to sql through a normal java program it gets connected & the prog works.But when i use a servlet prog with a html form
java compilation error - Development process
java compilation error  i have a requirement in my prog where i need to create multiple references while looping is going on for example i have a for loop like for(int i=0;i<5;i++) { String s=new String("naveen"); } now
Array list java code - Java Interview Questions
and address when an employee id is given? need detail java prog...Array list java code  Create an employee class with an employee id's... an employee id is given, display his name & address? Please provide the DETAIL java code
hashcode() and equals() - Java Interview Questions
hashcode() and equals()  can you give one hashtable prog using equals() and hashcode()?PLease..thanks in advance
Servlet & Jsp - Java Interview Questions
Servlet & Jsp   is it possible of communicating from SERVLET to JSP prog without using SENDREDIRECT? i mean,is there any other ways? Please let me know briefly with java code. Thanks for providing the sendRedirect prog
Equals() and Hashcode() - Java Beginners
these methods while using Hashtable? Please Explain it detaily along with an java.... Thanks   can you give one hashtable prog using equals() and hashcode
How to extract the entire line with specific data from a Text in java?
How to extract the entire line with specific data from a Text in java? ... of them don't contain number. in Java what method or function could i use to do my prog? i know how to read specific line from text with the lineNumber
problem in java script - Java Server Faces Questions
problem in java script  hi deepak i want to apply validation on email field of form nd i make this prog. but this is not working plz send me solution of my prob asap . ss function validate() { var error=false
Array list java program - Java Interview Questions
Array list java program  Create an employee class with an employee... an employee id is given, display his name & address? Please provide the DETAIL java... we can display his name and address when an employee id is given? i need java
java
java  diff bt core java and java
java
java  what is java
Java
Java   Whether Java is pure object oriented Language
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
java  write a java program using filenotfoundexception
Advertisements
 

 

 

DMCA.com