Need help with output please

Thank you for taking a look ill post my code and then my problem
import java.util.Scanner;
public class intrest
    public static void main( String[] args )
     Scanner input = new Scanner( System.in );
        System.out.print("Deposit:");
     double Value =input.nextInt();
     double Rate = 0;
        if (Value >250000 || Value <10000)
          System.out.print("Error: minimum deposit 10,000 and Maximum deposit 250000");
     else if (Value <25000)
          Rate = 2.76;
     else if (Value  <50000)
                Rate = 3.16;
     else
          Rate = 3.20;
     double Interest = (Value / 100 * Rate);
        System.out.println ("Interest:" +Interest) ;
     System.out.println ("Rate:    " +Rate) ;
}my goal for this program is to get the interest rate if the value is between 10k and 250k, if its any other value it should bring up an error however when i do input a number out of that range it gives me the error but it also displayes the interest rate and the interest gained although it does not work it out (both stay at 0 which is good),
i want it to only show the error if the first statement is true "{code}if (Value >250000 || Value <10000){code}" ive tried using "Else If" but its still showing me the interest rate and interest gained, can anyone help would really appreciate it
thank you very much

Do a if condition check....if you dont want to use exit...below is the modified code
import java.util.Scanner;
public class test
    public static void main( String[] args )
     Scanner input = new Scanner( System.in );
        System.out.print("\n Deposit:");
     double Value =input.nextInt();
     double Rate = 0;
        if (Value >250000 || Value <10000)
          System.out.print("\nError: minimum deposit 10,000 and Maximum deposit 250000");
        else if (Value <25000)
                  Rate = 2.76;                  
             else if (Value  <50000)
              Rate = 3.16;
     else 
          Rate = 3.20;          
             double Interest = (Value / 100 * Rate);
             if ((Interest != 0) || (Rate !=0))
    System.out.println ("\n\n Interest:" +Interest +"\n\n Rate :"  +Rate);         
}

Similar Messages

  • I have need help with something Please respond Quickly :)

    I have need help with something Please respond Quickly  ok so i have the linksys wrt54g Version 2.2 and i upgraded the firmware to V4.21.4 from this site http://homesupport.cisco.com/en-us/wireless/lbc/WRT54G and i clicked V2.2 for the router. So after i upgraded i lost internet ability i can't use the internet so i had to downgrade back to V4.21.1 but i want the things that newer update sloves. Please Help. Everything thing says DNS error? aka Modem.
    $$Cgibbons$$

    Ya i tried that i tried restoring and redoing everything when i downgrade back to .1 it works fine though?
    $$Cgibbons$$

  • Subquery results need help with output

    Requirements:
    There is request to dump every day’s data from one table into text file.
    Tables:INSPECTION_RESULTS
    NJAS
    Primary Key: RES_SYS_NO
    Parent table: INSPECTION_RESULTS
    Child table: NJAS
    Purpose:
    1. obtain output results for the MIN and MAX RES_SYS_NO from INSPECTION_RESULTS table for yesterday’s date.
    2. Create comma delimited file for following columns using above table data output.
    Script thus far:
    SELECT NJA_RES_SYS_NO||','||NJA_TEST_REC_NO||','||NJA_LIC_ST_ID||','||NJA_ETS_ID||','||NJA_SW_VER||','||NJA_TECH_ID||','||NJA_VIN||','||NJA_LIC_NO||','
    ||NJA_LIC_JUR||','||NJA_LIC_SRC||','||NJA_MODEL_YR||','||NJA_MAKE||','||NJA_MODEL||','||NJA_VHCL_TYPE||','||NJA_BODY_STYLE||','||NJA_CERT_CLASS||','||
    NJA_GVWR||','||NJA_ASM_ETW||','||NJA_ETW_SRC||','||NJA_NO_OF_CYL||','||NJA_ENG_SIZE||','||NJA_TRANS_TYPE||','||NJA_DUAL_EXH||','||NJA_FUEL_CD||','
    || NJA_VID_SYS_NO||','|| NJA_VRT_REC_NO||','|| NJA_ARMSTDS_REC_NO||','|| NJA_RSN_F_N_TESTABLE||','|| NJA_DYNO_TESTABLE||','||
    NJA_CURR_ODO_RDNG||','|| NJA_PREV_ODO_RDNG||','|| NJA_PREV_TEST_DT||','|| NJA_TEST_TYPE||','||
    NJA_TEST_START_DT||','|| NJA_TEST_END_TIME||','|| NJA_EMISS_TEST_TYPE||','|| NJA_TEST_SEQ_NO||','
    ||NJA_LOW_MILE_EXEMP||','||NJA_TIRE_DRY||','|| NJA_REL_HUMID||','|| NJA_AMB_TEMP||','||NJA_BAR_PRESS||','|| NJA_HCF||','||
    NJA_GAS_CAP_ADAP_AVL||','|| NJA_GAS_CAP_REPL||','|| NJA_OVERALL_GAS_CAP_RES
    FROM NJAS
    WHERE NJA_RES_SYS_NO IN (SELECT MIN(NJA_RES_SYS_NO) FROM INSPECTION_RESULTS WHERE NJA_RES_SYS_NO IN
    (SELECT MAX(NJA_RES_SYS_NO) FROM INSPECTION_RESULTS, (SELECT SYSDATE-1 FROM DUAL))
    It works but not sure if I am getting accurate results. Can anyone help me fine tune this subquery script? Thanks!
    Scott

    Duplicate post
    See my answer in your other posting here Re: need help with script

  • Need help with Fancybox please

    Hola
    I need some help with Fancybox.
    I bought this template and it came without facybox, so I thought
    that this will be a great help to learn some about jQuerry, but I'm lost
    Why is NOT working on my page?
    I just cannot figure this out.
    Can you please check my page?
    http://tummytime.biz/pages/portfolio_fancy.html
    I got Windows 8, Dreamweaver CC
    Thanks a lot.

    There are a couple things that could be causing a couple browsers' collective heads to implode.
    Remove the <! right before your </head> tag...
    </script>
    <!
    </head>
    <body>
    You have two calls to the fancybox css file, you only need one.
    Aside from that I'm not seeing any code problems jump out at me.
    EDIT: Ah, didn't scroll far enough. You have more than one reference to the jquery library. Typically, only one is needed and two or more will cause them all to fail. Usually, you can use the "latest" link and cover all your bases.
    If you aren't using those referenced scripts at the bottom of your page, delete them.

  • Need Help With Home Please

    If anyone here is good with Java, I need serious help with my homework, please give me your instant messenger screen name and we can chat, thanks alot!!
    Angela

    I don't understand how people get themselves into
    these situations as school, if you don't want to learn
    it don't sign up for the class.....You never got yourself into this situation.... I think everyone has on occassion.
    My very first "serious" university program was to solve a second order, non-linear differential equation using the Runge-Kutta method. This is NOT the easy way to learn a computer language and I have to admit I did take "shortcuts" using more experienced people than me.
    That was before the web though...
    God am I really that old?

  • Need help with debugging PLEASE

    Hi,
    I'm new to Java and was given an assignment to debug a program. I am completely lost and really havent gone over most of the stuff that is in this program. I would greatly appreciate any help with this that I can get.
    Here is my code:
    import java.util.*;
    import javax.swing.*;
    public class IndexHitFrequency
    private final int NUMBER_OF_SIMULATIONS = 1000;
    private int indexHit[] = new int [10];
    public IndexHitFrequency()
    Random generator = new Random(); // for generating random number
    int array[] = {6, 2, 4, 8, 5, 0, 1, 7, 3, 9 };
    //convert to ArrayList and sort it
    List list = new ArrayList(Arrays.asList(array));
    for (int i = 0; i < NUMBER_OF_SIMULATIONS; i++)
    //generate random number
    int randomNumber = generator.nextInt(array.length);
    // get index hit
    int index = Collections.binarySearch(list, randomNumber) ;
    // save index hit to array
    if(index > -1)
    indexHit[index]++;
    }//end for
    String output = "Index\tFrequency\t\n";
    //append the frequency of index hit to output
    for (int i = 0; i < indexHit.length; i++)
    output += i + "\t" + indexHit[i] + "\t\n";
    //display result
    JTextArea outputArea = new JTextArea();
    outputArea.setText(output);
    JOptionPane.showMessageDialog(null, outputArea, "Search random number 1000 times" ,
    JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
    }// end constructor
    public static void main (String [] args)
    new IndexHitFrequency();
    } // end class IndexHitFrequency
    I get these errors after trying to compile:
    "IndexHitFrequency.java": Error #: 300 : method asList(int[]) not found in class java.util.Arrays at line 17, column 40
    "IndexHitFrequency.java": Error #: 300 : method binarySearch(java.util.List, int) not found in class java.util.Collections at line 24, column 34

    C:\Java\Tutorial\rem>javac IndexHitFrequency.java
    IndexHitFrequency.java:15: asList(java.lang.Object[]) in java.util.Arrays cannot
    be applied to (int[])
    List list = new ArrayList(Arrays.asList(array));
                                    ^
    IndexHitFrequency.java:22: cannot find symbol
    symbol  : method binarySearch(java.util.List,int)
    location: class java.util.Collections
    int index = Collections.binarySearch(list, randomNumber) ;
                           ^
    2 errors
    C:\Java\Tutorial\rem>Copied source and compiled in DOS window ( XP's cmd.exe) and got these error messages...
    I think these error are more clear than the ones you posted, so this should help you resolve the problem...
    - MaxxDmg...
    - ' He who never sleeps... '

  • HT3702 need help with purchase please!!!

    My husband mistakenly hit the purchase button las night for an apple app and now it has been taken out of our account, but was deleted off the phone as soon has he realized that he hit the purchase button how do we get a refund please we need HELP!!!

    All sales are final
    You can try contacting itunes and asking for an exception

  • I need help with this please

    javax.servlet.ServletException
    at com.evermind.server.http.EvermindPageContext.handlePageThrowable(EvermindPageContext.java:595)
    at com.evermind.server.http.EvermindPageContext.handlePageException(EvermindPageContext.java:537)
    at jsp.addservice._jspService(addservice.jsp:515)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:847)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:229)
    at mil.usmc.m4l.servlets.M4LServlet.forward(M4LServlet.java:34)
    at mil.usmc.m4l.servlets.EditService.doGet(EditService.java:120)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at mil.usmc.m4l.filters.M4LCMSFilter.doFilter(M4LCMSFilter.java:150)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
    Edited by: user11237193 on Apr 27, 2010 10:58 AM
    I am getting error and I ned help with it Thank you for your help.

    I'd enter the dell service tags in here to find out what OS the pc was designed for.
    http://www.dell.com/support/contents/us/en/19/Category/Product-Support/Self-support-Knowledgebase/locate-service-tag?~ck=mn
     For windows I'd ask over here.
    http://answers.microsoft.com/en-us/windows
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • PLEASE NEED HELP WITH OUTPUTTING HDV/DV!! 16:9 to 4:3!! NEED HELP NOW!

    ok. I started out with HDV footage. Imported that edited it native HD into final cut 5, didn't downconvert. Now I am trying to output the finished work onto a dv camera through firewire. At first i nested the HDV sequence into a NTSC sequence, but the video wouldn't go through to the camera, only audio. I thought it was a connection problem, but then i played some DV footage and it went to the camera fine. So then i exported the DV sequence as a quicktime movie in NTSC form, but that really cropped the 16:9 footage and made it unwatchable. How can i take the 16:9 HDV footage, and letterbox it so that it fits inside a 4:3 frame without cutting off any of the original frame, and then export that to a DV camera? Let me know if you need more info, please help this is due tomorrow!! ahhhhh!

    When you Export using QuickTime Conversion, to DV Stream, you get an option of what the aspect ratio should be. Select 16:9 and the DV stream will be what you're looking for. Opening that in FCP and sending it to the camera should work out well.

  • Need help with output one field horizontally please

    I know I have seen some ideas and threads about this, but it is not really what I need. I have a report in CR XI that seems to be on the right path. The problem I am having is one field that needs to be in details could provide multiple results (products and services) which duplicates all the records. Some customers I'll have 3 lines, the next 9 ... depending on how many P&S they have.
    What I have done is moved all fields from the details section to group1 which so far seems fine and left my P&S field in details.
    The output is normal:
    prod1
    prod2
    prod3
    prod4
    etc.....
    What I need is this: prod1, prod2, prod3, prod4, etc.
    Any ideas greatly appreciated.
    In the group header add a formula
    WhilePrintingRecords;
    Global StringVar ProductList;
    ProductList := '';
    in the details
    WhilePrintingRecords;
    Global StringVar ProductList;
    If ProductList  = '' then
       ProductList  :=
    else
         ProductList := ProductList & ', ' & ; ''
    In the group footer
    WhilePrintingRecords;
    Global StringVar ProductList;
    ProductList
    Edited by: Terry Mergl on Apr 20, 2010 9:15 PM

    What you have should do it.  Is there an issue?  Please explain in detail, giving sample data, current results, and expected results.
    Carl

  • New to itunes and need help with library please

    some of my albums have various artists. i cant get them to show up as 1 album it shows as an album for every song. can anyone help me please?
    another problem i am having is my album artwork does not show up when I insert a cd to rip. I am also having trouble with the itunes suddenly getting all garbled up so i cant even see the screen untill I close itunes and open it back up. grrrr!! i sold my Zune to get this ipod touch and am wondering if I have made a mistake.
    thanks for any help you can give me
    Carri

    according to you we are on the same page here. When you rip a regular cd into itunes, it does not have the album artwork engrained into the song file. This is just an example, Say you ripped a Metallica cd into itunes such as "Master of Puppets." The song on the album "Disposable Heroes" will not have the album artwork with it.
    You need to get an apple account, just go to the itunes store and sign up. After you do that you can click on one of the songs from the album you ripped. Right click it, and go to the choice "get album artwork". itunes will automatically modify the artwork for all the songs on that album. That is it. I may have a post later on your other problems. Ask me if you don't fully understand what i said.

  • Need help with output for D5

    Hi,
    I need some help getting my film in sync to a D5.
    The film was shot on MiniDV and edited drop frame (29.97).
    What we did first is output on miniDV and dubbed that to a D5 for color correction. Everything was in sync with the timeline. Then my friend color corrected. Since then several shots have been replaced, not effecting the timing at all. We checked that everything was hitting at the same timecodes and everything was cool.
    Now I've output another tape onto MiniDV and tried to dub it to D5 but the shots are not hitting at the same timecode. They assure me that everything is drop frame on their end. Not sure what might be causing the problem. Not sure what to try next?
    Need suggestions and ideas.
    thanks.

    if you had a downconvert from your "color corrected d5" you could place it in the timeline and see whats up.

  • I need help with hyperlink PLEASE!!!!!!!

    I hope somebody can help me with this question. I create some
    button in flash 8. My web page is divided in three frames( using
    the frame tag), two rows and the second row has two colums. My
    question is how can i make one of my buttons to open a new web page
    but in a different frame. The button is in column number 1 of row 2
    and when the user click this button i want that this new page open
    in column number 2 of row 2. How can ia do that? please help
    me

    valla23 wrote:
    > I hope somebody can help me with this question. I create
    some button in flash
    > 8. My web page is divided in three frames( using the
    frame tag), two rows and
    > the second row has two colums. My question is how can i
    make one of my buttons
    > to open a new web page but in a different frame. The
    button is in column number
    > 1 of row 2 and when the user click this button i want
    that this new page open
    > in column number 2 of row 2. How can ia do that? please
    help me
    Always best to google before posting, especially if you
    urgent to meet deadline.
    Forum archives:
    http://groups.google.com/advanced_group_search?q=group:macromedia.flash.*&hl=en&lr=&ie=UTF -8
    Search "flash in frames"
    the very second result, so happen to be from me, exhaling
    exactly how to set it up.
    http://groups.google.com/group/macromedia.flash/browse_thread/thread/6b0047b0a65be8a0/9f8f c0765bf2297e?lnk=st&q=&rnum=2&hl=en#9f8fc0765bf2297e
    Personally posted that couple of hundreds of times in past 8
    years.
    Please try to utilize the search before posting so we don't
    need to hammer same
    topic over and over and over and over and over .....again...
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Need help with output type EDI for ERS

    All,
    I want to be able to run and ERS settlement and have the invoices created sent via EDI/XML to the supplier.   I have several questions on the set up.
    1)  I have output type ERS6 which is defined as ERS EDI.  I assume because it does not start with Z* this is SAP standard, so I shouldn't have to modify any of this.
    2)  I've added my supplier to this output type. 
    3)  I assume I need to create a partner profile for this supplier?  If so can someone tell me the message type to use?
    Is there any set up I'm missing in this process?   I've executed ERS but do not get an idoc and I'm fairly certain it's because I haven't done the partner profile set-up.
    Thanks for your help.
    Sandra

    Hi,
    You don't have to modify thise setup unless you have any customized requirement.
    You are missing partner profile setup.Carry out the setup and run MRRL tcode to create the idocs
    Enter the following values using tcode WE20.
    Field                                       Value
    Message type                         GSVERF
    Partner type                             LI (vendor)
    Partner function                        LF (vendor)
    Port                                         SUBSYSTEM ( Port to your middleware)
    Output mode                            such as Collect IDocs
    Basic type                                GSVERF01
    Application                                 MR
    Output type                                ERS6 or the type you have defined
    Regards,
    Karuna

  • Need help with dates  please-urgent

    Hi folks, please help me with this if you can.
    I run a weekly job, and need to have my java code create and use 2 dates to capture data for the whole week.
    begin_date mm/dd/yyyy (String) to be 7 days prior to current date
    end_date mm/dd/yyyy (String) to be the currecnt date
    Note: please take into account the cases where the CURRENT_DATE is the first week of the month. As a result the 7 days prior will fall into the previous month. i.e if end_date="06/04/2003" then the begin_date will be "05/29/2003 Thanks a bunch

    http://java.sun.com/j2se/1.4.1/docs/api/index.html
    See the Calendar and DateFormat classes.

Maybe you are looking for

  • CC 2014 2.2 on Mac unstable and constantly giving program error message

    This is the least stable version of PS I've ever used on a Mac. It feels like Painter ten years ago. With files over a certain size - it seems like over a medium numbers of layers - I constantly get the stupid error where it can't save the file "beca

  • How can I change a PDF to a Word document?

    Where in the product can I edit and change a PDF to Word Format?

  • Two different 0CALDAY from 2 different dates

    Hi all, In my infocube, I've 4 different date fields : 0CRM_ACFR_K (Actual Start Date) 0CRM_ACTO_K (Actual End Date) 0CRM_PLFR_K (Planned Start date) 0CRM_PLTO_K (Planned End date) In a BEx query, my customer wants to use selection screen for both pl

  • Custom Buttons

    Hi Gurus, I want to create some custom buttons on Runtime Prompts (like Add, Remove etc)? How I create Custom button and associate to the Business Rule? Thanks & Regards, Sravan Kumar.

  • Confused - DNG Converter RC for RAW files from d810 - doesn't work...

    hi everyone - sorry for the stupid question, but i've never had to do this before. i read somewhere here that if you download camera raw 8_6 and dng converter 8_6 you can convert raw files from d810. i just tried that with the dng converter and it sa