Should i use if again or else if but it gives error..

i need some help on the use of nested if's i tried using them check this out.
if (customerType.equals("b"))
if (hrs>=18)
System.out.println("recommended plan is business 200 ");
else if (hrs>7&&hrs<18)
System.out.println("recommended plan is business 150 ");
else{
System.out.println("recommended plan is business 100 ");
but now i want to get to the part where the customerType is equal to C, i tried using else if but it says illigal start help please...

i use netbeans i copyied and pasted, highlighted and pressed code i'm sorry if it doesn't look neat, i tried following his instructions step by step i don't know what else to do....i'm a new user on this forum, so i don't know much about it..
import java.util.Scanner;
public class ras {
    public static void main(String args[])
     int hrs=0;       
     System.out.print(" input customer type b for business user, c for casual user & s for students ");
     Scanner sc = new Scanner(System.in);
     String customerType = sc.next();
      System.out.println("please input your usage hours per day ");
      hrs= sc.nextInt();
      sc.close();
      if (customerType.equals("b"))
      if (hrs>=18) {
       System.out.println("recommended plan is business 200 ");}
      else if (hrs>7&&hrs<18){
      System.out.println("recommended plan is business 150 ");}
      else{
          System.out.println("recommended plan is business 100 ");
      else
          if(customerType.equals("c")){
      if (hrs>=10)
       System.out.println("recommended plan is business 100 ");
      else {
      System.out.println("recommended plan is business 50 ");
      else
          if (customerType.equals("s"))
      if (hrs>=6){
      System.out.println("recommended plan is business 50 ");
      else {
      System.out.println("recommended plan is business 20 ");
          else{
          System.out.println("error please reenter your customer type properly. ");
}

Similar Messages

  • My macbook pro is version 10.7.3 and since I bought it, I try to update but it gives error, what should i do?

    My macbook pro is version 10.7.3 and since I bought it, I try to update but it gives error, what should i do?

    What are you trying to update? Are you trying to do a Software Update from the Apple menu, or something else?
    What is the error you're seeing? We are not mind readers.
    Matt

  • HT1212 iPhone diabled, tried to use iTunes to restore, but iTunes gives error message (0XE8000084). Now what to try to reset iPhone?

    iphone disabled, tried to use iTunes to restore, but iTunes gives error message (0XE8000084). How to restore iPhone?

    Try here   =   http://support.apple.com/kb/TS3221

  • How can I sync my iPod touch calendar with my iPod using wifi?  Everything else sync but but the calendar.

    For some reason my iPad2 calendar doesn't sync with my iPod touch.  iOS is up to date on both devices and everything else syncs.  I have read the manual about syncing, tried syncing via iTunes and have wifi on but neither work. I have cloud set for my backup in both.  My iPad calendar shows duplicate appointments, my iPod touch shows none unless I enter them into iPod.   Can anyone give me some help?  Thank you

    Maybe:
    iCloud: Resolving duplicate calendars after setting up your calendar application for iCloud Calendar

  • Using a datepicker with format mask MM/YYYY gives error on submit

    I'm trying to use a datepicker with the format MM/YYYY.
    The item is linked to a database column of type DATE.
    The items displays correctly (month and year), but when submitting the page, I get an "ORA-01843: not a valid month" error from the built-in DML process.
    Shouldn't Apex apply the same date format mask to the item value when trying to save it to the database?
    - Morten
    http://ora-00001.blogspot.com

    Hi Mike,
    I can/need to do that for my own PL/SQL processes, but the problem is with the Built-In DML Process....
    - Morten
    http://ora-00001.blogspot.com

  • I used the audio widget in iBA but got this error message when I tried to deliver in iTunes Producer

    -- any clue what to do? ERROR ITMS-9000: "Files of type audio/x-m4a are not allowed outside of widgets: assets/media/12%20Largo%20for%20Glass%20Armonica%20in%20G%20Minor.m4p" at Bo

    Seen this iBA User Tip?
                     ERROR ITMS-9000: "Files of type audio/x-m4a are not allowed outside of widgets:..."

  • Which CPU should I use

    Hello,
    our company want to buy new computers for the developers.
    We have to use Windows XP as our OS because of third party products.
    We develop J2SE + J2EE.
    So my question:
    Which CPU should we use?
    I searched at google but didn't found any usefull sides about benchmarking an J2SE VM or J2EE VM.
    Intel or AMD?
    Are there some issues to be regarded?
    Is the behavior of the VM different if you use an Intel or an AMD? (X86)
    Our AppServer is JBoss 3.2.3.
    Has Intel ore AMD some magic improvements for the SUN Java VM?
    Any answer would be appreciated.
    Thanks,
    Oliver

    Olli_ger,
    Thanks for asking. To add more to the question, what about dual- and
    multi-processors, such as Opteron 2xx and 8xx processors?
    That is, can, and to what extent, does the Java compiler and the JVM
    utilize multi-processors? And how is this done? Threads parceled out?
    Using what algorithms? Are there "best practices" for writing code
    that can exploit these chips?
    Given the recent emergence of dual-core processors from both AMD and
    Intel I would think Sun would have a white paper on this, but I've not
    been able to find anything.
    As I'm about to build a new system, and am looking at a dual processor
    board that could take two dual-core chips, I'd really like to know.
    Thanks again for opening the issue.
    -BC

  • X.400 VS FTAM - What should be used?

    Hi Gurus,
    We are planning GTS Customs management and by SAP
    there are 2 ways for comunicating with the customs allowed:
    X.400 and FTAM
    What should be used?
    I know X.400, but FTAM I do not know.
    Is it difficult to set up FTAM and what do we need for FTAM
    and what needs to be done for FTAM?
    Thanks
    Regards
    Dieter

    From my point of view FTAM is the better solution and X.400 is old fashioned.
    FTAM is faster and you don't have to pay for every call like with the X.400.
    You can setup up the communication to customs via SAP PI (e.g. it.x-atlas by itelligence) and you need a FTAM router.

  • Hi, please help me. Bought lightroom license but was using the free and the mode of revelation is still blocked, already desistalei and installed again on my PC but the revelation mode remains disabled. What should I do? Tks

    Hi, please help me. Bought lightroom license but was using the free and the mode of revelation is still blocked, already desistalei and installed again on my PC but the revelation mode remains disabled. What should I do? Tks

    Reset the PRAM
    Reinstall the operating system from the dvd (you will not loose your data)

  • I have a macbook pro 13" i am in India now can i use my mac charger now in India.or els should i use an power convertor.

    I have a macbook pro 13" i am in India now can i use my mac charger now in India.or els should i use an power convertor.

    you just need a socket adapter.
    your macbook charger is set for 110V to 240V.

  • Help in running Code::Blocks on Mac OSX. Should I use something else?

    I'm starting to learn programming and can't seem to get Code::Blocks running on my lap top. Terminal says "Can't execute binary file." I'm trying to build the first "Hello World" C++ program but it would not build or run. Sometimes I get the message that it cannot access folder also.
    Here's my code:
    #include <iostream>
    using namespace std;
    int main()
    cout << "Hello World !" << endl;
    What C++ software do you recommend to start? Should I use any other than Code::Blocks?

    As far as text editors, TextEdit will work, but as far as I know, you will constantly run into issues with formatting, spell-check, and other things. If you are guilty of "Which Button Do I Press?" then my first choice is likely not for you.
    If you are comfortable using the "Terminal" app, then I suggest using EMACS, (or just emacs). There is a built-in tutorial, and it is a very powerful editor, although for a non command line user it can be daunting, as most of the formatting and editing commands are all control characters (so regular characters are always entered as text). Emacs will do nice highlighting of various language elements just like XCode does. vi is another command line editing tool available on every version of UNIX. Emacs comes with Mac OS/X, as does vi. I have no idea if vi helps with programming as the first thing I do when I start to work on any Unix or Linux box is copy over some version of emacs, so i don't use it except sparingly.
    You can also continue to use XCode to edit the source files, as it does a nice job as a WYSIWYG editor and prompts you with help along the way. Just keep a terminal window open to use the command line to compile and link your program, but edit it in XCode and do a SAVE before you switch back to the terminal window.
    I also use BBEdit from Bare Bones, and some people like TextWrangler. There are at least a dozen other text editors out there that have features you can enable for programming. Do a google search for Mac OSX text editors and you'll see what I mean.
    I advise AGAINST using TextEdit, unless you set the file to "Plain Text". Also, don't use a .txt extension. Use .c, .cc, .ccp, .m, .mm, .js, or whatever the compiler expects to see for a specific language. Binaries will nearly always have a .o extension, and the final binary depends on the language, the linker and what options you provide. The default for c is a.out (or at least it used to be).
    You will also want to learn how to use "make", but that is another discussion.
    For starters, remember that "man" is your friend. If you want to look up information on Unix, and the command line on the Mac is talking to Unix, aka Darwin. Type "man man" for help getting started with the man command, and "man make" to get started with make. Note at the end of most man pages the section that says "See also", as this tells you about related commands.

  • Need experts opinion... Should I use smcFanControl?

    I've recently purchased a MacBook Pro 13" with an i7 processor and 8GB of RAM and have been watching flash player videos on the internet and playing pretty basic games that use programs such as Java and have experienced temps topping at 101 degrees Celsius. I'm not an expert with laptops, but I have done a TON and I mean HOURS of reading online for the past several days and have read posts where people have encouraged the use of smcFanControl when needed and read the opposite side where people say to not mess with it and trust in Apple's engineering. From my basic understanding, it seems like more acceptable temperatures should be around 80-90 degrees Celsius for these tasks. Am I correct in this thinking to protect my laptop? This is my 1st laptop and I want to make sure I can make it last as long as possible, so what's the truth? Should I use smcFanControl just when I plan to play games or watch flash player videos? If you've used smcFanControl for years, please speak up along with anyone else who knows a lot on this issue. Thanks!!

    daitkarsachin wrote:
    hi ,
    here is my question again..my xml will have
    <Message>
    <ATO>
    <somefiled="X" type=int value=35 />
    </ATO>
    <FIX>
    <somefiled="Y" type=String value=50 />
    <FIX>
    </Message>
    Now first i have to parse this xml ..then my java program is going to accept value from user ..and depending on user specified value i've to use either ATO or FIX fields...e.g if user value is 35 then my program should use fields within ATO node.
    You will read the XML structure into some kind of memory model. When the user supplies a value you will search for a matching value (likely from a collection such as a map or list) and return the value in that object that you locate.
    what should be done for this ..
    See above.
    and what if i change values in my xml file..will i have to restart my application to load xml again ?
    If you change the file on the filesystem, you should simply be able to re-parse the XML file and update your in-memory model. If you instead update your in memory-model, you can serialize the model back to XML on the filesystem. Neither needs to necessarily have anything to do with application start-up (other than the fact that you would normally read in the XML model then, but updating is a separate concern, as would re-reading it).
    - Saish

  • Archive and install: Should I use original or  recently installed Leopard?

    My daughter is in China and her MacBook Pro powered off during a restart after installing program updates. She needs to archive and install and I need to ship her the correct disk for it. Genius Bar said to use original disk that came with her computer, but she recently upgraded to Leopard (which I didn't think to mention to them). Which should she use for doing the archive and install? Should I send her both, just in case?
    Thanks for any advice.

    srobs:
    Welcome to Apple Discussions.
    If she is running currently running Leopard she should use the Leopard install disk else she would be back to Tiger and would have to Archive and Install again to get to Leopard. Because things can go wrong during this or any major procedure she should backup/clone prior to the Archive and Install.
    cornelius
    Message was edited by: cornelius

  • Hi, I am using my icloud on my iphone but am unable to find it on my mac book pro. It's not under my system preferences like it shows under the setup. Can I download it again? Or something. I just need to backup some files on my computer and am unable.

    Hi, I am using my icloud on my iphone but am unable to find it on my mac book pro. It's not under my system preferences like it shows under the setup. Can I download it again? Or something. I just need to backup some files on my computer and am unable.

    The minimum requirement for iCloud is Lion 10.7.5 (Mavericks preferred): the iCloud Preference Pane does not appear on earlier systems - the MobileMe pane appears on Lion and earlier but is now non-functional - you cannot now open or access a MobileMe account.
    To make use of iCloud you will have to upgrade your Mac to Lion or Mavericks, provided it meets the requirements.
    The requirements for Lion are:
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Lion is available in the Online Apple Store ($19.99). Mountain Lion (10.8.x) is also available there at the same price but there seems little point as the system requirements are the same for Mavericks (10.9.x) - which is free - unless you need to run specific software which will run on Mountain Lion only.
    The requirements for Mountain Lion and Mavericks are:
    OS X v10.6.8 or later
    2GB of memory
    8GB of available space
      and the supported models are:
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    Xserve (Early 2009)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    It is available from the Mac App Store (in Applications).
      You should be aware that PPC programs (such as AppleWorks) will not run on Lion or above; and some other applications may not be compatible - there is a useful compatibility checklist at http://roaringapps.com/apps:table

  • What query should I use to find all versions of Office 2013 64-bit installed on client computers?

    What query should I use to find all versions of Office 2013 64-bit installed on client computers? Could someone create a custom query? I need all of the client computers names and which ones have any Office 64-bit components. Thank you so much! I really
    appreciate it!

    Hi,
    You could edit the following query to meet your requirement.
    SELECT     dbo.v_R_System.Name0, dbo.v_GS_OPERATING_SYSTEM.Caption0 AS [Operating System],
                          dbo.v_GS_OPERATING_SYSTEM.CSDVersion0 AS [OS Service Pack], arp.DisplayName0,
                          CASE WHEN arp.version0 LIKE '11.0.6361.0' THEN 'SP1' WHEN arp.version0 LIKE '11.0.7969.0' THEN 'SP2' WHEN arp.version0 LIKE '11.0.8173.0'
    THEN 'SP3' WHEN
                           arp.version0 LIKE '12.0.6215.1000' THEN 'SP1' WHEN arp.version0 LIKE '12.0.6425.1000' THEN 'SP2' WHEN arp.version0 LIKE '14.0.6029.1000'
    THEN 'SP1' ELSE '' END
                           AS 'Service Pack', arp.Version0
    FROM         dbo.v_Add_Remove_Programs AS arp INNER JOIN
                          dbo.v_R_System ON arp.ResourceID = dbo.v_R_System.ResourceID INNER JOIN
                          dbo.v_RA_System_SMSInstalledSites AS ASSG ON dbo.v_R_System.ResourceID = ASSG.ResourceID INNER JOIN
                          dbo.v_GS_OPERATING_SYSTEM ON dbo.v_R_System.ResourceID = dbo.v_GS_OPERATING_SYSTEM.ResourceID
    WHERE     (arp.DisplayName0 LIKE '%Microsoft Office%edition%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Standard 2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Enterprise 2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Professional%2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Standard 2010%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Enterprise 2010%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Professional%2010%' OR
                          arp.DisplayName0 LIKE 'Microsoft Office 2000%' OR
                          arp.DisplayName0 LIKE 'Microsoft Office XP%') AND (arp.DisplayName0 NOT LIKE '%update%') AND
                          (arp.DisplayName0 NOT LIKE '%Microsoft Office XP Web Components') AND (dbo.v_R_System.Operating_System_Name_and0 NOT LIKE '%server%')
    AND
                          (arp.InstallDate0 NOT LIKE 'NULL')
    ORDER BY dbo.v_R_System.Name0, arp.DisplayName0, arp.Version0
    Full details:http://social.technet.microsoft.com/Forums/systemcenter/en-US/7baeb348-fb63-4115-8d76-2c884d18f708/sql-query-to-check-ms-office-service-pack-level?forum=configmgrreporting
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • When I plug any of my phones into the computer it does not connect.

    When I plug any of my phones into the computer it does not connect. I can hear a beep but that's it.  I checked all of my USB cords and the same results. Normally it would download my new pictures and start charging and that no longer happens. When I

  • Blu Ray Workflow: FCP7 to Toast Titanium 11

    Good Afternoon, I'm trying to get a grip on the workflow for burning a Blu Ray Disc for a client. I'm working in FCP7 - have Roxio Toast Titanium 11 as well as a Buffalo Blu Ray Burner. Can anyone provide me a step by step for taking a finished FCP7

  • User exit for Change the Tariff Number in Customs Declaration Document

    Hi Guru, Due the business requirement, user only maintain the Tariff Number in ECC, there is an solution when GTS creating the customs declaration document in GTS, there is an user exit calling the Function Module (Customized program) to get the Tari

  • Schubert-it, Preview, and Safari

    I have Schubert-it PDF Browser plugin installed and I would like to continue using it with Firefox and Chrome. I wonder if it's possible to configure the system so that Safari will use Preview instead of Schubert-it? At this point, after installing S

  • Scale image strange problem

    Hi I have loaded an image using MovieClipLoader and am using the following code to scale it to fit a photo frame: var mcLoader:MovieClipLoader = new MovieClipLoader(); ..  add listeners ... mcLoader.loadClip(filePath, frame.imageHolder); function loa