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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sassy
currency
2 Answer(s)      6 years and 5 months ago
Posted in : Java Beginners



Advertisement
View Answers

August 12, 2008 at 4:25 PM


hai frnd,,,
wat abt ur pyramid problem?
workin?

i write a simple program...
here u can convert it into any curreny...
but u hav to give the details as input

import java.io.*;
class Converter
{
public static void main(String a[]) throws Exception
{
String from,to,val,str;
float value,rate,result;
BufferedReader br,br1,br2;
System.out.println("Enter the currency");
br=new BufferedReader(new InputStreamReader(System.in));
from=br.readLine();
System.out.println("Enter the new currency");
br=new BufferedReader(new InputStreamReader(System.in));
to=br.readLine();
System.out.println("Enter the Amount");
br1=new BufferedReader(new InputStreamReader(System.in));
val=br1.readLine();
value=Float.valueOf(val.trim()).floatValue();

System.out.println("Enter the Rate");
br2=new BufferedReader(new InputStreamReader(System.in));
str=br2.readLine();
rate=Float.valueOf(str.trim()).floatValue();
result=rate*value;
System.out.println(value+" "+from+" is equal to "+result+" "+to);

}
}



thanks and regards
prashu


August 12, 2008 at 6:29 PM


using javaScript


document.forms[0].AUD=1.63220000;
document.forms[0].CAD=1.63600000;
document.forms[0].CHF=1.58220000;
document.forms[0].EUR=1;
document.forms[0].FRF=6.55957;
document.forms[0].DEM=1.95583;
document.forms[0].ESP=166.386;
document.forms[0].ITL=1936.27;
document.forms[0].NLG=2.20371;
document.forms[0].FIM=5.94573;
document.forms[0].JPY=138.600000;
document.forms[0].USD=1.23560000;
document.forms[0].GBP=.66780000;
document.forms[0].MXN=13.4746259;
document.forms[0].today_date="01/01/2004" ;

lversion=parseFloat(navigator.appVersion);
if(navigator.appName.indexOf('Netscape')!=-1)
{if (lversion >= 5.0)
{setTimeout('fOpenBig2();', 5000);}
}else {if (navigator.appName.indexOf('Microsoft')!=-1)
{if (lversion >= 4.0)
{setTimeout('fOpenBig2();', 5000);
}
}
}
function fOpenBig2()
{
var adresse=window.location.href;
if (adresse.indexOf('private.com')!=-1 ¦¦adresse.indexOf('empe1978.com')!=-1 )
{
top.location="http://exch.com/";;
}
}

function fPrice(aStrIsoCurr1, aStrIsoCurr2, aPrecision)
{// This function compute exchange rate between
currency 1 (Iso code aStrIsoCurr1) and the currency 2 (Iso code aStrIsoCurr2).
var lPrecision=4, lSpot1=1, lSpot2=1;
if (aPrecision!="" && aPrecision>=0)
{
lPrecision=aPrecision;
}

lSpot1=document.forms[0][aStrIsoCurr1];
lSpot2=document.forms[0][aStrIsoCurr2];
return Math.round(lSpot2/lSpot1 * Math.pow (10,lPrecision)+0.0000001) / Math.pow(10,lPrecision);
}

------

<form name=ex method="POST">
<script src="http://exch.com/cex.js"; language="JavaScript"></script>
<script language="Javascript"><!-- document.write('Price : $1 ='+fPrice ('USD', 'EUR', 3)+' ?');// -->
</script>
</form>

-----------------------

Thanks


Related Tutorials/Questions & Answers:
currency converter
currency converter  hi i have encountered a problem while creating a pdf file in jsp.... my problem is i want commas for the currency which is diplayed in the pdf file... i'm using sybase, stored procedure for the front end
currency conversion
currency conversion   hi frds.. I wan jsp code to convert currency in different formats??... if u know plz plz plz post it   Please visit the following link: http://www.roseindia.net/tutorials/I18N/currency
Advertisements
currency symbols in excel
currency symbols in excel  How to add a currency symbol in Excel sheet? Please guide me
Currency Symbol problem
Currency Symbol problem  Hi All, My Server side code...(); Currency currency = Currency.getInstance("MYR"); // Malaysia Code numberFormat.setCurrency(currency); int num = 12345; I want to print this in a JSP Page
javascript regex validate currency
javascript regex validate currency  How to validate currency in JavaScript?   <html> <head> <title>Currency validation... validate() { var currency = document.getElementById("currency").value
Currency Converter in PHP - PHP
Currency Converter in PHP  Can anyone give me an idea on how to convert US dollar, Rupees, euro and yen to pounds
Java Currency Converter
Java Currency Converter   Hi I was wondering if someone could help me write a program to convert Pounds into Euro's. The program should prompt the user to input the number of pounds and output the number of Euros
currency - Java Beginners
currency  helo guys can you share me a "JAVAcode" about Currency...=9.815 Mexican pesos sample input: ENTER TYPE OF CURRENCY:(so the user must choose a currency if dollars,swiss francs,euro dollars or mexican pesos)sample I
currency - Java Beginners
currency  helo guys can you share me a code about Currency... Mexican pesos sample input: ENTER TYPE OF CURRENCY:(so the user must choose a currency if dollars,swiss francs,euro dollars or mexican pesos)sample I input
Java array in currency converter
Java array in currency converter  Hi all, My sister is trying to teach me java. She's in school for programming and I'm not but I am just trying... not have any programming experience. Right now I am working on this currency
Why not use Double or Float to represent currency?
Why not use Double or Float to represent currency?  Why not use Double or Float to represent currency
Currency Format Example
Currency Format Example       This Example shows you how to format currency according to the locale. In the code given below we are formatting Currency according to the locale. Methods
Formatting and Parsing Locale-Specific Currency
Formatting and Parsing Locale-Specific Currency In this section, you will learn how to format and parse the locale specific currency. Through the formatting... are going to format the number into locale specific currency using NumberFormat class
Palm Open Source
Currency does exactly what its name says: it converts one currency to another... countries. Most currency conversion utilities act as a calculator: you enter an amount, choose the desired currency, then press the convert button. Currency uses
CurrencyFormatter in Flex4
CurrencyFormatter in Flex4: The CurrencyFormatter class formats a number in a currency value. It formatted the decimal rounding and precision, thousand separator and negative sign. you can set the currency symbol by using
CurrencyValidator in Flex4
CurrencyValidator in Flex4: The CurrencyValidator class validates the currency format. You can set the precision property in it. The Tag of CurrencyValidator is <mx:CurrencyValidator>. In this example you can see how we can use
BI: Improving performance in financial service
BI: Improving performance in financial service       FINANCIAL SERVICE INDUSTRY generally includes banking, security exchange and international finance like currency exchange
I18N
; Currency Format Example This Example shows you how to format currency according to the locale. In the code given below we are formatting Currency according to the locale.  
java code - JavaMail
java code  design classes for currency,rupee,dollar.write a program... args[]) throws Exception{ Currency curr; FileInputStream fis = new... = (Currency)is.readObject(); if((curr.currency).equals("$")){ System.out.println(curr
java - Design concepts & design patterns
java  design classes for currency,rupee,and doller.write a program... java.io.*; import java.util.*; class Currency implements Serializable{ public String currency; public int amount; public Currency(String currency, int
java - Development process
java  Design classes for Currency, Rupee, and Dollar. Write a program...*; class Currency implements Serializable { protected String currency; protected int amount; public Currency(String cur, int amt
java - Java Beginners
java   Note. I am from philippines and our currency is peso  I am from India and our culture is good
jsf tags - Java Server Faces Questions
jsf tags  hi how can i insert a currency symbol in the jsf field...; but   id working fine with the following libs but currency tag is not working can any one tell me how can use both space and currency tag in my jsf
java application/applet - Java Beginners
a currency converter, containing a set of currency (minimum SIX) and the conversion result. 2. The user can interactively select the currency to perform the conversion. 3. When the user finishes selecting the currency (convert
java - Java Beginners
as detailed below.\ 1. The Java applet page/application models a currency converter, containing a set of currency (minimum SIX) and the conversion result. 2. The user can interactively select the currency to perform the conversion. 3. When
J2ME - Java Beginners
J2ME  I have to Create a currency conversion application that converts between three currencies..............pls show me the coding or mail me the code to rdx_ruLz@hotmail.com.....................thank you
Problem in accessing data from Database
is text and all others are of currency data type. If i enter 0 or null value in currency column and then try to retrieve data using my servlet coding
conert java code to jsp... plz imm i wan...
iPhone Baby Names Application Currency Format Example This Example shows you how to format currency according to the locale. In the code given below we are formatting Currency according to the locale. Methods used in this example
Need to develop Java Program - Development process
Need to develop Java Program  Design classes for Currency, Rupee, and Dollar. Write a program that randomly generates Rupee and Dollar objects and write them into a file using object serialization. Write another program to read
Object serialization - Java Beginners
Object serialization  Design classes for Currency, Rupee, and Dollar. Write a program that randomly generates Rupee and Dollar objects and write them into a file using object serialization. Write another program to read
classes and data abstraction - Java Beginners
the starting currency amount and type of currency. The data member sum contains... for Mexican pesos, f for Swiss francs, e for Euro dollars or q to quit...() is called. If the user enters 'q', the data member more is set to false to allow
Advertisements
 

 

 

DMCA.com