Java Currency converter

I am a beginning Java developer and I have a question regarding a little "tryout" applet I'm writing. This is my code so far:
//Applet 01 - Euro Converter - Build_001
import java.applet.*;
import java.awt.*;
public class Euro extends Applet
     TextField invoerbedrag;
     TextField koers;
     Button eurogulden;
     Button guldeneuro;
     Label uitvoer;
     String
     public void paint (Graphics pen)
          invoerbedrag.setBounds(100,30,100,25);
          koers.setBounds(250,30,100,25);
          eurogulden.setBounds(125,100,100,25);
          guldeneuro.setBounds(225,100,100,25);
          uitvoer.setBounds(150,150,100,25);
          pen.drawString("Invoer:",100,20);
          pen.drawString("Koers:",250,20);
          pen.setColor(Color.black);
     public void init()
          uitvoer=new Label("");
          add(uitvoer);
          invoerbedrag=new TextField("");
          add(invoerbedrag);
          koers=new TextField("2.20371");
          add(koers);
          eurogulden=new Button("Euro > Gulden");
          add(eurogulden);
          guldeneuro= new Button("Gulden > Euro");
          add(guldeneuro);
}It's all in Dutch, but it only is the layout. Now I have to make the number in the "invoer" textbox be dived by the number in the "koers"
textbox when I click on button "guldeneuro" and I have to make to number in the "invoer" textbox be multiplied by the number in the
"koers" textbox when I click on the button "eurogulden". The result of a click should be displayed in the "uitvoer" label. An other thing that is important is that the numbers could be both decimal and non decimal. Could someone write me a piece of code that does the job and explain me the working?
Thanks for your help.

Okay I have made some progress:
//Applet 01 - Euro Converter - Build_001
import java.applet.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Euro extends Applet
     TextField invoer;
     TextField koers;
     Button eurogulden;
     Button guldeneuro;
     Label uitvoer;
     public void paint (Graphics pen)
          invoer.setBounds(100,30,100,25);
          koers.setBounds(250,30,100,25);
          eurogulden.setBounds(125,100,100,25);
          guldeneuro.setBounds(225,100,100,25);
          uitvoer.setBounds(150,150,100,25);
          pen.drawString("Invoer:",100,20);
          pen.drawString("Koers:",250,20);
          pen.setColor(Color.black);
     public void init()
          guldeneuro.addActionListener(this);
          eurogulden.addActionListener(this);
          uitvoer=new Label("");
          add(uitvoer);
          invoer=new TextField("");
          add(invoer);
          koers=new TextField("2.20371");
          add(koers);
          eurogulden=new Button("Euro > Gulden");
          add(eurogulden);
          guldeneuro=new Button("Gulden > Euro");
          add(guldeneuro);
     public void actionPerformed(ActionEvent actionevent)
          actionevent.getSource();
             String s = actionevent.getActionCommand();
            if(s.equals("Euro > Gulden"))
                if(invoer.getText() != "")
                    Double double1 = new Double(invoer.getText());
                    double d = double1.doubleValue() / koers.getText();
                    Double double3 = new Double(d);
                    uitvoer.setText(double3.toString());
                    return;
            } else
            if(s.equals("Gulden > Euro") && invoer.getText() != "")
                Double double2 = new Double(invoer.getText());
                double d1 = double2.doubleValue() * koers.getText();
                Double double4 = new Double(d1);
                uitvoer.setText(double4.toString());
}But when compiling I get some error's:
C:\Program Files\Java\Java Development Kit\bin\Euro.java:35: addActionListener(java.awt.event.ActionListener) in java.awt.Button cannot be applied to (Euro)
          guldeneuro.addActionListener(this);
          ^
C:\Program Files\Java\Java Development Kit\bin\Euro.java:36: addActionListener(java.awt.event.ActionListener) in java.awt.Button cannot be applied to (Euro)
          eurogulden.addActionListener(this);
          ^
C:\Program Files\Java\Java Development Kit\bin\Euro.java:64: operator / cannot be applied to double,java.lang.String
double d = double1.doubleValue() / koers.getText();
^
C:\Program Files\Java\Java Development Kit\bin\Euro.java:70: cannot find symbol
symbol : variable Invoer
location: class Euro
if(s.equals("Gulden > Euro") && Invoer.getText() != "")
^
C:\Program Files\Java\Java Development Kit\bin\Euro.java:73: operator * cannot be applied to double,java.lang.String
double d1 = double2.doubleValue() * koers.getText();
^
5 errors
Any ideas??

Similar Messages

  • Building a basic Currency Converter

    Hi, I am trying to build a pounds to euro, euro to pounds currency converter. The user enters the current exchange rate, what they want to convert and how much. I am trying to use a main class as a command line interface and a class to do the maths. My problem is trying to get them working together as I'm not great with classes. This is what I have so far... the problem is with the Converter converter = new Converter(); line. If I hover over the error symbol in Netbeans it says 'Cannot find symbol'.
    package Assignment1;
    import java.util.Scanner;
    * @author Aaron
    public class Interface {
        public static void main(String[] args) {
            Scanner scan = new Scanner(System.in);
            Converter converter = new Converter();
            double exchangeRate;
            int convertOption;
            double amount = 0;
            System.out.println("Welcome to the Currency Converter!");
            System.out.println("Please enter the current exchange rate for " +
                    "Pounds to Euros");
            exchangeRate = scan.nextDouble();
            System.out.println("Convert Pounds to Euros (1) or Euros to Pounds" +
                    "(2)");
            convertOption = scan.nextInt();
            while (convertOption == 1 || convertOption == 2) {
                System.out.println("How much would you like to convert?");
                amount = scan.nextDouble();
            if (convertOption == 1) {
                amount = converter.poundToEuro(exchangeRate, amount);
                System.out.println("" + amount);
            if (convertOption == 2) {
                amount = converter.euroToPound(exchangeRate, amount);
                System.out.println("" + amount);
            if (convertOption != 1 || convertOption != 2) {
                System.out.println("Not a valid option. Please re-run the " +
                        "program.");
    package Assignment1;
    * @author Aaron
    public class Converter {
        private double exchangeRate;
        private double amount;
        private double result;
        public Converter(double exchangeRate, double amount, double result) {
            this.exchangeRate = exchangeRate;
            this.amount = amount;
            this.result = result;
        public double poundToEuro(double exchangeRate, double amount) {
            result = amount * exchangeRate;
            return result;
        public double euroToPound(double exchangeRate, double amount) {
            result = amount / exchangeRate;
            return result;
    }

    By the way:
    There's absolutely no need to do the string appending here:
                System.out.println("" + amount);Creating a field to hold values to return from methods is unnecessary and poor form; just make them local variables:
    public class Converter {
        private double result;
        public double poundToEuro(double exchangeRate, double amount) {
            result = amount * exchangeRate;
            return result;
        }I second the suggestion not to name your class "Interface". It's syntactically OK (because the keyword is lower-case) but it's still confusing.

  • I want to restore my home page the way it was before I downloaded Firefox 4 which destroyed my home page features (news, currency converter, horoscope, weather etc.) so I deleted Firefox 4 and re-installed Firefox 3.6.17.

    The look of my home page was perfect with Firefox 3.6.17. I had a strip of whales breaching around the Google logo. Underneath I had all kinds of wonderful things (I forget what they're called) on the page which was divided into sections: weather, CNN, Reuters, currency converter, Rick Levine's daily horoscope, health tip of the day etc. I promptly removed FF4 because my home page was totally ruined and I can't figure out how to restore all these wonderful easy features. Could you kindly help me or has FF totally changed the entire home page layout and I shall never be able to restore them. I have saved a copy of my Profile on my USB stick. I have a MacBook OSX 10.5.8. Sincerely, Myrna Goldstein

    I, too had my book marks disappear when I upgraded to FF 4.0
    I am now back and enjoying FF 3.6.17 (my original) yet I am still
    without my book marks and am floundering trying to recoup.
    Any help appreciated. If unable to see my book marks in the near
    future I will definitely jump ship. It's too bad that FF people have
    created this problem. I am mystified and disgusted with their actions.

  • Currency convertion in 11.1.1.1

    Hi ,
    We are using 11.1.1.1 planning. In our multi currency application we have entity each entity assigned to one currency. we have defined exchange rates in planning application we gave the name currency rates to the table.
    we also assigned this table to scenario.
    when we enter data in functional currency for perticular entity and then we saved the data in functional currency. when we changed the currency in drop down to USD and also we ran the business rule that given by the planning tool. its not converting data.
    Iam just confused where i missed and what i missedto work the currency convertion as i expected.
    I really appreciate your help.
    Thanks,

    Have you done a retrieve (using the spreadsheet add-in) from Essbase to verify that the exchange rates were pushed to the cube?
    This retrieve can be a bit confusing, because Hyperion Planning actually stores these rates at upper levels in some dimensions. You'll want to retrieve on:
    - Currency (the top member from the dimension)
    - Version (the top member from the dimension)
    - Entity (the top member from the dimension)
    - Any other custom dimensions (the top member from the dimension)
    - Budget (or forecast, or whatever specific scenario you're referencing)
    - HSP_Rate_USD (or whatever specific currency you're reviewing)
    - HSP_Ending (or whatever specific rate type you want to review)
    I would recommend doing this retrieve directly against Essbase, and making sure you see some rates in the cube.
    Hope this helps,
    - Jake

  • Java Shapefile Converter Charset | NLS_LANG | Encoding-Problem

    Hi Forum,
    I tried to use the Java Shapefile Converter and it works fine except of a small, decisive detail.
    I use a Oracle 11 database.
    I'm from Germany and we use characters like ä, ö and ü in our language.
    In the Shapefile, which I'd like to import to the database, are these characters, too.
    So I tried to set the NLS_LANG to 'GERMAN_GERMANY.UTF8' or 'GERMAN_GERMANY.WE8ISO8859P1' but it doesn't work.
    In the table the characters after the import look like a rotated question mark.
    Has anyone an idea?
    Kind regards from Germany
    Edited by: 910195 on 25.01.2012 06:40
    Hi,
    it works with -Dfile.encoding=ISO-8859-1
    Edited by: 910195 on 30.01.2012 06:37

    What is the characterset of your database ?
    What is the column datatype in which you are storing your data ?
    While selecting the data (after insertion) did you set your NLS_LANG ?
    Are you able to view your data properly via any Unicode tool such as SQL developer ?

  • Only ConverterServlet.class is in the APPS directory from the currency converter sample?

    I have this problem, the deploytool won't extract files to iPlanet/ias6/ias/APPS directory when I deploy my bean which I intent to use rich client to access and has no web application. Today I took someone's advice and deployed the currency converter sample and found out only the ConverterServlet.class was extracted in my APPS/j2eeguide/converter folder. It is really strange as only the web application file was extracted. I am using AIX Unix with iAS 6.0 SP1 installed. I check the ksvradmin and kregedit and all is there. Please help.

    Hi, I don't know what the necessary patches are but I tried to deploy currency converter sample on my laptop which has iPlanet installed. The folders of ejb and servlet are there in the APPS. I upload the very ear file on my laptop to the AIX and then use j2eeappreg to deploy it. Guess what, no luck. Can I be sure that it is the problem of the AIX? I didn't set up the AIX enviroment so I will have to consult others if it is the AIX enviroment.

  • Dynamic currency converter

    I am following the guide provided
    HERE to build a currency converter. The static converter works very fine, but I am having issue while building dynamic version of it. 
    Basically, I have designed it as below:
    1) Data flow task: Uses a sql query to get a distinct list of all the currencies being used in the fact table and store into a recordset object 'ObjCurrency'
    2) Foreach loop container:
    Iterates through all the values in 'ObjCurrency' and each value gets stored in CurrencyCode
    2.1) Script task: A message box is used to show the current currency code
    2.2) Web service task: As stated in the above guide, I am sending the CurrencyCode variable as a 'FromCurrency' and 'USD' is my 'ToCurrency' to get a dynamic WSDL for every CurrencyCode
    2.3) XML task: Used to get 'ConversionRateResponse'
    2.4) ScriptTask1: A message box is used to show the current ConversionRateResponse
    I am getting an error at 2.2 and the error is:
    [Web Service Task] Error: An error occurred with the following error message: "Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException: Could not execute the Web method. The error is: Method 'ProxyNamespace.CurrencyConvertor.ConversionRate'
    not found..
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebMethodInvokerProxy.InvokeMethod(DTSWebMethodInfo methodInfo, String serviceName, Object connection)
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTaskUtil.Invoke(DTSWebMethodInfo methodInfo, String serviceName, Object connection, VariableDispenser taskVariableDispenser)
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()".
    Can someone please help me with this?
    Thank you in advance.

    Hi rockstar283,
    Based on my research, the issue always caused by the data type of input variable mismatch for the Web Service. For example, the input type for web service is String, the variable was of type Object. Obviously SSIS Web Service Task will not implicitly do
    a .toString() call on the input variable. So the issue occurs.
    To fix this issue, please change the type of the variable. For more details, please refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/1073ad37-ed05-4ab4-85e3-689e1cd17a68/ssis-web-service-task-error-with-wcf-service
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Currency Converter doesn't have all

    Currency Converter widget works with Yahoo. I checked yahoo currency converter service, thay have a lot of currencies. But apple widget doesn't have.
    Why, and how can I add others.

    The way to do it is to go to news feed, this has your online contacts on the right hand side, when in panorama.
    It's the first time I have found the answer so happy to be famous!

  • How to add currency converter icon to toolbar

    Does firefox 5 have an icon for currency converter? How do I add a currency converter to a toolbar?

    Hi,
    You can enable currency in the reporting output using following steps:
    Query properties> Display> select Display scaling factors for key figures.
    but using this option currency($) will be displayed after the amount. it means key figure values will be displayed like 300$, 800$.
    hope it helps..
    regards,
    raju

  • Currency convertion from SKK  to EURO

    HI Friends
    A country is joining the Euro area on a particular date. we wish to change the currency customizing to reflect this change.  For example, Slovenkia is planning on joining the Euro area from  01.01.2009.
    so we wish to change from the existing currency to Euro in the BW System .
    Anybody can give some suggestions and necessery steps for that.
    ANY THING AND EVERY THING WILL BE REWARDABLE
    Thanks in Advance
    Regards
    RK

    Hi,
    exchange rate here is how one currency converted to another currency at certain date, e.g 06.07.2007 1 USD = 41 INR ...
    http://www.x-rates.com/d/INR/table.html
    in sap system (r/3, bw, ..) it's maintained in table TCUR*, for BW normally it's transferred from r/3 via rsa1->transfer exchange rates, and the update scheduled periodically.
    or you can upload the exchange rate via flat file
    http://help.sap.com/saphelp_nw04s/helpdata/en/36/412ae30cb511d5b2df0050da4c74dc/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/36/412ad80cb511d5b2df0050da4c74dc/frameset.htm
    take a look
    http://help.sap.com/saphelp_nw04/helpdata/en/ec/076f3b6c980c3be10000000a11402f/frameset.htm
    sample code in transfer/update rules check following
    CONVERT_TO_FOREIGN_CURRENCY or 'RSW_CURRENCY_TRANSLATION'
    currency conversion
    currency translation
    in query level, try to check 'how to use variable for currency conversion' doc
    https://websmp106.sap-ag.de/~sapdownload/011000358700005669792003E/How_to_VarCC_v3.pdf
    also
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/462fe790-0201-0010-3ca4-adfd89e4f9f2
    oss note 656863
    currency translation
    hope this helps.
    Regards
    CSM Reddy

  • WADL file for Currency Converter API

    Hi all,
    I have just started creating Project Siena application. I want to create a WADL file for currency converter API.
    I have got an app key for currency converter API but do not know how to use this app key & create  a WADL file so that I can use the functions provided by currency converter API in my Project Siena Application.
    I have gone through some of the examples of WADL configuration file but those are based on BingSearch & BingTranslator API.
    Please help me.
    Thanks,

    take a look at the early version of the WADL generator
    http://social.technet.microsoft.com/Forums/en-US/82c7b717-5100-423c-aa44-effed28caf74/wadl-generator-for-project-siena?forum=projectsiena
    Also, review this article
    http://technet.microsoft.com/en-us/library/dn690140.aspx on how to create a WADL to return JSON.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft
    Online Community Support

  • Java Shapefile Converter in 11g

    I am looking for documentation on how to compile and run the Java Shapefile Converter that is supposedly included with Oracle 11g Spatial (referenced here: http://www.oracle.com/technology/software/products/spatial/index.html).
    I haven't been able to find anything about it other than this post: Updated "Oracle Java Shapefile Converter"? which only pretty much says it is included and no longer a separate download. The readme that is mentioned at the end of the thread (http://www.oracle.com/technology/software/products/spatial/files/text_files/shape2sdojava_readme.txt) is only for 10g and I haven't been able to adapt it for 11g.
    I also found a sample ShapefileToSDO file here: http://www.oracle.com/technology/sample_code/products/spatial/htdocs/sdoapi_samples/sdoapi_samples_readme.html#2
    which may work but I am unable to get it to compile. The command it mentions is:
    javac sample/*.java sample/adapter/*.java
    but it isn't finding a lot of packages needed. I am not sure what classpath to use. I tried putting ojdbc6.jar, sdooutl.jar and sdoapi.jar in the classpath and compiling but the same package error messages came up:
    "C:\sdoapi_samples>javac -classpath C:\JC_CLASSPATH\ojdbc14.jar;C:\JC_CLASSPATH\sdooutl.jar;C:\JC_CLASSPATH\sdoapi.jar C:\sdoapi_samples\sample/*.java C:\sdoapi_samples\sample/adapter/*.java
    sample\SampleShapefileToSDO.java:7: package oracle.sql does not exist
    import oracle.sql.STRUCT;
    ^
    sample\SampleShapefileToSDO.java:8: package oracle.jdbc.driver does not exist
    import oracle.jdbc.driver.*;
    ^
    sample\SampleShapefileToSDO.java:9: package oracle.sdoapi does not exist
    import oracle.sdoapi.OraSpatialManager;
    ^
    sample\SampleShapefileToSDO.java:10: package oracle.sdoapi.geom does not exist
    import oracle.sdoapi.geom.*;
    ^
    sample\SampleShapefileToSDO.java:11: package oracle.sdoapi.adapter does not exis
    t
    import oracle.sdoapi.adapter.GeometryAdapter;
    ^
    sample\adapter\AdapterShapefile.java:6: package oracle.sdoapi does not exist
    import oracle.sdoapi.OraSpatialManager;
    ^
    sample\adapter\AdapterShapefile.java:7: package oracle.sdoapi.adapter does not e
    xist
    import oracle.sdoapi.adapter.*;
    ^
    sample\adapter\AdapterShapefile.java:8: package oracle.sdoapi.geom does not exis
    t
    import oracle.sdoapi.geom.*;
    ^
    sample\adapter\AdapterShapefile.java:9: package oracle.sdoapi.sref does not exis
    t
    import oracle.sdoapi.sref.*;
    ^"...................................................
    it goes on and on with 100 errors total. I am not sure what I am missing.
    Thanks a lot!
    Edited by: user12055867 on Oct 26, 2009 5:18 AM
    Edited by: user12055867 on Oct 26, 2009 5:24 AM

    After setting up my classpath with sdoutl.jar, sdoapi.jar and ojdbc6.jar, I ran the command:
    java -cp %CLASSPATH% oracle.spatial.util.SampleShapefileToJGeomFeature -h host -p port -s orcl -u username -d password -t table -f filename -r 8307
    It worked successfully, the data was entered into the DB. Unfortunately, something is wrong with it. In uDig I cannot view it due to some rendering problem and after running some validation tests on it, I saw the errors:
    1. 'Geometry is required to be a LineString' for all the object names in the table
    I next opened mapbuilder and loaded the same shapefile into the database under the same SRID using mapbuilder's shapefile import. in uDig, this table displayed correctly with no problems!
    I followed the usage instructions for SampleShapefileToJGeom and don't see any other options which would fix this. Am I doing something wrong?
    Edited by: user12055867 on Oct 28, 2009 6:26 AM
    Edited by: user12055867 on Oct 28, 2009 6:26 AM
    Edited by: user12055867 on Oct 28, 2009 6:55 AM

  • BT Yahoo Currency Converter problem

    On my home page, the BT Yahoo Currency converter table has stopped populating the table with data. Now just shows an empty table. Used to work fine. Any explanation regarding why this has happened and how I can fix it?

    Hi Frankah,
    Thanks for the message and welcome to the forum.  I can try and find out why this has happened.  Has this change only only recently happened?  Have you changed anything on your Homepage?
    Cheers
    Sean
    BTCare Community Manager
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Is currency convertion rules mandatory

    hi friends,
      am trying to acheive currnecy convertion i am using standard application set 'Appshell' i have no 'currency convertion rules' in application 'Finance'.  But i have manitained the script logic under app 'Finance'. I have gone through some docu in which some says to maitain 'currency convertion rules' and others had not discussed about 'currency convertion rules' .
    Please guide me whether to maitain the same or not.
    My Objective is to perform the simple currency traslation.
    thanks

    As a designer of BPC applications, you may choose either to utilize the Business Rules or utilize the Script logic process.  Either way is fine and they both work on the same basic premise, enter RATES to input currencies in the RATE app, and convert the LC values associated to each ENTITY member to the ENTITY defined property of CURRENCY, for those REPORTING currenies defined in the app, such as FINANCE. I don't think there is a right or wrong way, since each work, but may require additional settings and design for the more complex translations.
    Hope this helps.

  • Currency Converter Help

    Hey I am making a java program to convert from certian currency types to another. It reads from a file w the rates .. and all currency types are 2 words long.. such as Japanese Yen, American Dollar, and so on. Now heres the code.
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class CurrencyConverter{
        public static void main(String[] args) throws FileNotFoundException{
            try{
                // Importing file with rates
                Scanner console = new Scanner(new File("rates.txt"));
                String s = "y";
                while(s.equalsIgnoreCase("y") || s.equalsIgnoreCase("yes")){
                    // Declaring variables
                    String[] currency = new String[6];
                    double[] rate = new double[6];
                    int i = 0;
                    // List currency types able to be converted
                    System.out.println("Currency types available for conversions:");
                    while(console.hasNextLine()){
                        String line = console.nextLine();
                        Scanner data = new Scanner(line);
                        currency[i] = data.next() + " " + data.next();
                        System.out.println(currency);
    rate[i] = data.nextDouble();
    i++;
    // Input currency type we are converting from and to
    System.out.println("Please enter the currency you wish to convert from:");
    Scanner input = new Scanner(System.in);
    String cfrom = input.nextLine();
    System.out.println("Please enter the currency you wish to convert to:");
    String cto = input.nextLine();
    // Input amount of currency
    System.out.println("And how much of " + cfrom + "s are we converting to " + cto + "s?");
    double amount = input.nextDouble();
    // Calculate
    int j = 0;
    while(! cfrom.equalsIgnoreCase(currency[j])){
    j++;
    int k = 0;
    while(! cto.equalsIgnoreCase(currency[k])){
    k++;
    double adollars = amount / rate[j];
    double total = adollars * rate[k];
    // format for numbers
    DecimalFormat df = new DecimalFormat("#.##");
    System.out.println((df.format(amount)) + " " + cfrom + "s equal " + (df.format(total)) + " " + cto + "s.");
    System.out.println();
    System.out.println("Would you like to make another converstion?");
    Scanner input2 = new Scanner(System.in);
    s = input2.nextLine();
    System.out.println();
    console.close();
    }catch (Exception e){
    System.out.println("Invalid Entry. Please make sure you are entering the correct currency and");
    System.out.println("and a numeric value for the amount.");
    The program just feels really wrong to me. What I really have problems with is using the Try/Catch .. I would really like to be able to have them re enter a currency type or amount instead of it going to the catch and ending the program if one is wrong. Also I am not 100% sure about my formating to double decimals on the output.
    Well thos are my 2 biggest concerns atm. Any advice even if its about something I didnt mention would be helpful. Just wanna polish this up a little and make it feel correct. Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    What I really have problems with is using the Try/Catch Yep.
    You "expect" that to happen.
    Thus it is not exceptional.
    Put the try catch around the parsing code only. On exit from there you will either have a valid value
    or you ask the user to try again.
    Also I am not 100% sure about my formating to double decimals on the output. Try it.
    Additionally note that generally (maybe always) you would not normally use a floating point type
    for money. Instead either use an integer type or the class BigDecimal.
    Floating point types can lose bits which in business represents real money.

Maybe you are looking for

  • Power consuption  report (pm)

    hi my requirement is to show the power consumption of each generator we have 4 . and also the difference. a b b-a ex : 1.07.2011 is starting reading of that month (.this is a) .        for 2.07.2011 it should subtract with 1.07.2011 (this is b)      

  • Is the Canon EOS 1Ds Mark II compatible with iPad Connection Kit

    Hi All, First post in the forum. I was wondering if the Canon EOS 1Ds Mark II is compatible with the iPad connection kit via USB, as it uses CompactFlash not SD. Thanks Dill

  • Using NetConnection for a video in subdirectory

    The following code works if the FLV I'm trying to pull is in the same directory as the SWF. How do I target an FLV in a different folder?

  • Can I transfer my voicemails from my iphone to a new iphone?

    My iphone 4s is extremely damaged...  I am going to buy a new one but i need to know how to transfer my voice mails to the new phone... I have very important voice mails i cant lose... Plz help!!! Thanx in advance!!!

  • Review Activities and AD Groups for Reviewers

    Hello, Hopefully this is the correct place to ask this question.  If not, I apologize in advance.  I have been trying to find the answer to this issue I am having and can't seem to find a solid answer.  For reference, I am using SCSM 2012 R2. Basical