Casting needed? or what?

I have created a program that requires user input to sums. Most of the time answrs to sums will we whole Integers (eg 3 +2, 6*5). The answers to such sums are stored in an int variable. However for sum like 4/3 the answer is 1. Can i cast an Int to a double so in such cases the precise answer is displayed?

You should store your answer in a double to start with. Once the value is stored in an integer the decimal part is discarded.
BTW: You are using the term sum incorrectly. Only addition produces sums. 3 / 4 produces a quotient or ratio.

Similar Messages

  • Explicit cast needed to convert java.* to to oracle.*

    Hello,
    I am trying to compile and run the following JSP but keep getting the "Incompatible type for = Explicit cast needed ..." error. The JSP and oracle procedure code are as follows:
    <%@ page language="java" import="java.sql.*" %>
    <%@ page import="oracle.jdbc.driver.*" %>
    <HTML>
    <HEAD>
    <TITLE>
    SimpleQuery JSP
    </TITLE>
    </HEAD>
    <BODY BGCOLOR=EOFFFO>
    <TABLE BORDER=1 BGCOLOR="C0C0C0">
    <TH BGCOLOR="white"> <I>Node ID</I> </TH>
    <%
         Connection con = null;
    OracleCallableStatement cstmt= null;
         ResultSet rs = null;
    try {
              String SYSTEM_DB_DRIVER =
    "oracle.jdbc.driver.OracleDriver";
    String SYSTEM_DB_URL =
    "jdbc:oracle:thin:@myserver.com:1521:";
    String SYSTEM_DB_FILE = "CONN_STRING";
    String SYSTEM_DB_USER = "UNAME";
    String SYSTEM_DB_PASSWORD = "PASSWD";
              Class.forName(SYSTEM_DB_DRIVER);
    con = DriverManager.getConnection(SYSTEM_DB_URL +
    SYSTEM_DB_FILE, SYSTEM_DB_USER, SYSTEM_DB_PASSWORD);
              cstmt = con.prepareCall("call eaicl_p_requirement.open_rule_dtl(?,?)");
              cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    <<I think I have to pass the p_product_id_in here but not sure how>>
              cstmt.execute();
              rs = ((OracleCallableStatement)cstmt).getCursor(1);
              while(rs.next())
              {%>
         <TR>
         <TD ALIGN=CENTER> <%= rs.getString(1) %> </TD>
         <TD ALIGN=CENTER> <%= rs.getInt(2) %> </TD>
    </TR>
              <%}
                   rs.close();
    cstmt.close();
    con.close();
    catch(Exception e)
    %>
    </TABLE>
    </BODY>
    </HTML>
    The Oracle PL/SQL package.procedure it is calling is:
         PROCEDURE open_rules_dtl (
              prc_rules_dtl_out          OUT     rc_fetch_rule_dtl,
              p_product_id_in          IN          NUMBER )
         IS
              vrc_rules_dtl               rc_fetch_rule_dtl;
         BEGIN
              OPEN vrc_rules_dtl FOR
                   SELECT
                        r.rule_id,
                        r.rule_name,
                        r.rule_objective,
                        r.rule_description,
                        r.clearance_requirement,
                        r.rule_type
                   FROM
                        eaicl_rule r
                   WHERE
                        r.is_old = 'N' AND
                        r.product_id = CHR( p_product_id_in )
                   ORDER BY
                        r.rule_name
              prc_rules_dtl_out := vrc_rules_dtl;
    END open_rules_dtl;
    I keep getting the following error on the webserver:
    [05/Dec/2001:16:56:02] info ( 632): JSP: JSP1x compiler threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\iPlanet\Server4\https-wacc\config\..\ClassCache\_jsps\_ss_test5_jsp.java:84: Incompatible type for =. Explicit cast needed to convert java.sql.CallableStatement to oracle.jdbc.driver.OracleCallableStatement.
              cstmt = con.prepareCall("call eaicl_p_requirement.open_rule_dtl(?,?)");
              ^
    I'm not sure how to fix it. I also need to pass the p_product_id parameter to the procedure.
    Hope someone can point me in the right direction. Thanks.

    Here's how you do an explicit cast:cstmt = (OracleCallableStatement)con.prepareCall("call eaicl_p_requirement.open_rule_dtl(?,?)");

  • My cellular network is not working on my iphone 5 after updating to ios 8.1.2 !! It was working fine on ios 8.1.1and it was not jillbreak or hacked to unlock. I need help, what can I do?

    My cellular network is not working on my iphone 5 after updating to ios 8.1.2 !! It was working fine on ios 8.1.1
    my phone was not jillbreak or hacked to unlock. i need help, what can I do?

    Did you do the Reset Network Settings as I described above?
    There is no way to go back. You can try reseating your nanoSIM or replacing it. Or call your cell provider and have them check the provisioning on your phone.
    Or Restore your iPhone from your backup in iTunes.

  • My cellular network is not working on my iphone 5 after updating to ios 8.1.2 !! It was working fine on ios 8.1.1 i need help, what can I do?

    My cellular network is not working on my iphone 5 after updating to ios 8.1.2 !!
    It was working fine on ios 8.1.1 i need help, what can I do?

    I have this problem too - and it is on a BRAND new iPhone 6 - I have definitively tracked the issue to the moment I upgraded to iOS 8.1.2 - and am beyond frustrated. No fix to tell you about, sorry…but you can read my post here if you are into the whole "misery loves company" thing: iOS 8.1.2 Cellular data problem (Definitive - maybe)

  • Ever since I updated my Mac to Maverick it has become exceedingly slow everywhere. Also annoying, when I go into Applications to open something, it now automatically opens 3 things I don't need. What can I do to fix this?

    Ever since I updated my Mac to Maverick it has become exceedingly slow everywhere. Also annoying, when I go into Applications to open something, it now automatically opens 3 things I don't need. What can I do to fix this?

    Reinstall Lion, Mountain Lion, or Mavericks without erasing drive
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu.
    Reinstall Lion, Mountain Lion, or Mavericks
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • HT1459 I did an update on my ipod touch, now it says it is in restore mode. i don't want to lose my info, but my ipod won't do anything now.  thanks itunes; it was working fine until i did the update you said i needed.  what do i do now??????

    I did an update on my ipod touch, now it says it is in restore mode. i don't want to lose my info, but my ipod won't do anything now.  thanks itunes; it was working fine until i did the update you said i needed.  what do i do now??????

    No one here said anything about an update or your device needing it.
    FYI, you are not addressing Apple here, we are all users like yourself.
    If the device is in recovery mode, the only option is to restore it.  All data on the device is gone.  This should not be an issue if the device has been used as designed and regularly synced/backed up.

  • I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    You will need a Mac, with OS X 10.6+ on it, to be able to develop iOS apps.
    There is some info on these pages :
    developer site : https://developer.apple.com
    developing for iOS 7 : https://developer.apple.com/ios7/
    developer support : https://developer.apple.com/support/
    developer forums : https://devforums.apple.com/index.jspa (you will need to be a registered developer to access them)

  • Hi i have a macbook its osx 10.4.11 core duel and i think its tiger already installed but it needs updating what do i do  thanks

    hi i have a macbook its osx 10.4.11 core duel and i think its tiger already installed but it needs updating what do i do  thanks

    Hi Paul
    The current version of OS X is Snow Leopard (OS X 10.6) and you should be able to order an installation disk for your MacBook from the on line Apple Store. 
    Soon, a newer version of OS X (called Lion) is being released, but I don't think that it will run on a Core Duo because that particular processor is 32 bit only.
    Bob

  • I need buy what productions for PDF forms?

    Hi:
    My requirement:
    1、Adobe Reader can edit and save Pdf forms,can add signature and barcode;
    2、I upload pdf file by web upload or by email or copy files;
    3、My back-end system(J2EE,Weblogic or Tomcat)  receive pdf files ,then extract XML datas from PDF by SDK(Adoble supply ?).
    question:
    1、I need buy what productions or modules of LiveCycle ES?
    2、Adobe supply SDK of extracting XML datas from PDF?
    Thanks

    You need to buy LC Forms for this use case. LC forms contains the API to extract data in XML format from the PDF.

  • HT201471 My wife got an ipad air model A1474 (WIFI only) in an airport shopping centre. She needed connectivity what can we do now to correct this mistake as the model is a mismatch for our environment in Nigeria where WIFI is not common

    My wife got an ipad air model A1474 (WIFI only) in an airport shopping centre. She needed connectivity what can we do now to correct this mistake as the model is a mismatch for our environment in Nigeria where WIFI is not common

    Mifi devices are usually quite small. Think Credit Card size, and maybe slightly thicker. So not really a big device you need to carry around.
    In any case if you are still within the 14 day return period you may be able to return it to an Apple retail store. It needs to be an Apple Owned store, not sure Authorized Resellers will let you do it.
    Other than that, bob points out, you may want to try to use the iPhone as a hotspot for the iPad.  If your Carrier supports it.  Like the Mifi device, the iPhone will share its cellular internet connection out to other devices over a Wireless network the iPad can use.

  • Heey guys whats up listen i have a problem i lost my iphone and it has all my pic's and some information that i really really need it what should i do .... is there any way that i can get back the i phone ??? please help me

    heey guys whats up listen i have a problem i lost my iphone and it has all my pic's and some information that i really really need it what should i do .... is there any way that i can get back the i phone ??? please help me

    You can look for it.
    If you find it, you will have it back.
    If you had find my iphone activated on the iphone BEFORE it was lost, then you may be able to track it.

  • Hello. I ve got a question. I accidentally bought membership but it doesnt have Adobe Muse that I need. What should I do? Can I extend my membership for the right one, or should I first get the money back. What kind of membership do I need to have Adobe M

    Hello. I ve got a question. I accidentally bought membership but it doesnt have Adobe Muse that I need. What should I do? Can I extend my membership for the right one, or should I first get the money back. What kind of membership do I need to have Adobe Muse software?

    Plans are listed at Creative Cloud pricing and membership plans | Adobe Creative Cloud
    The drop down at individual plans does show that you may subscribe to only Muse
    You probably need to cancel what you have... You need Adobe support to cancel a subscription
    -start here https://forums.adobe.com/thread/1703848
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
    --and two links which may provide more details, if the above links don't help you
    -http://helpx.adobe.com/x-productkb/policy-pricing/return-cancel-or-change-order.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html

  • My iphone all the time has a restore needed sign, what should I do?

    my iphone all the time has a restore needed sign, what should I do? I tried the support steps & it didn't work =(

    Unable to Update or Restore..?
    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps..
         Take your time... Pay particular attention to Steps 3 and 4.
    Some users have reported as many as 8 or 9 attempts were necessary before success.
         If the issue persists...
    Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
         Be sure to make an appointment first..

  • I Have An Iphone 4s And When I Listen To Music With My HeadPhones I Cant Lower The Volmume of The Music Beacuse Then It Will Have No Sound I Can Only Listen To The Music With The Volume Loud I Need Help What Can I Do ?

    I Have An Iphone 4s And When I Listen To Music With My HeadPhones I Cant Lower The Volmume of The Music Beacuse Then It Will Have No Sound I Can Only Listen To The Music With The Volume Loud I Need Help What Can I Do ?

    Hi Yendy14,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    Click on the link to see more details and screenshots. 
    Troubleshooting iPhone, iPad, and iPod touch accessories
    http://support.apple.com/kb/TS2634
    Cheers,
    - Judy

  • Hi i active my i cloud but my yahoo email was stolen and they change my apple id  and passworrd and icant turn off my icloud it need apassword  what can i do to turn it off .......and my iphone cant download applications from apple store?im from iraq

    hi i active my i cloud but my yahoo email was stolen and they change my apple id  and passworrd and icant turn off my icloud it need apassword  what can i do to turn it off .......and my iphone cant download applications from apple store?im from iraq please help me

    You're gonna have to figure out a way to call AppleCare...there is no AppleCare where you live...somewhere, & ask to talk to "Account Security". Here's a list of worldwide support numbers:
    http://support.apple.com/kb/HE57

  • Ive got a blocked iphone and it needs repairs what will happen if i bring it into an apple store

    ive got a blocked iphone and it needs repairs what will happen if i bring it into an apple store

    ShowaM wrote:
    ... what will happen if i bring it into an apple store
    They will evaluate it...
    Be sure to make an appointment first...

Maybe you are looking for