Coding help...not wanting name input

Hi, ive been working on this ongoing program, adding little here and there. And i finally got it to stop working when stop is entered into the name selection. But while im in the second loop of "does not equal stop" it dispays the print System.out.print("Please enter the employees name"); but does not wait for me to enter the name and jumps to the next step. I have tried to make the second while loop variable "name" different then the first loop but that didnt work. If you can please help me that would be greatly appreciated.
import java.util.Scanner;
public class WeeklyPay
public static void main(String[] args)
Scanner input= new Scanner (System.in);
double rate;
double hours;
double weekly;
String name;
String stop;
String name2;
System.out.println("Hello!"); //Welcome Text
System.out.println("This program computes an employees weekly pay"); //Explains what its for
System.out.print("Please enter the employees name:"); //Asks for employees name
name = input.nextLine(); //Saves next input as name
if( ! (name.equalsIgnoreCase("stop")) )
System.out.print("Please enter the hourly rate of the employeee:"); //Asks for hourly rate
hours = input.nextDouble(); //Saves next input as hours
System.out.print("Please enter the number of hours the employee works a week:"); //Asks for number of hours worked in a week
rate = input.nextDouble(); //Saves number of hours a week
weekly = rate*hours; //Computes weekly pay
System.out.printf("The employee:%s\n", name); //Displays Employees name
System.out.printf("Weekly pay : $%6.2f%n", weekly); //Displays weekly pay
while( ! (name.equalsIgnoreCase("stop")) )
System.out.println("Please enter the employees name:"); //Asks for employees name
name2 = input.nextLine(); //Saves next input as name
System.out.print("Please enter the hourly rate of the employeee:"); //Asks for hourly rate
hours = input.nextDouble(); //Saves next input as hours
System.out.print("Please enter the number of hours the employee works a week:"); //Asks for number of hours worked in a week
rate = input.nextDouble(); //Saves number of hours a week
weekly = rate*hours; //Computes weekly pay
System.out.printf("The employee:%s\n", name2); //Displays Employees name
System.out.printf("Weekly pay : $%6.2f%n", weekly); //Displays weekly pay
System.out.println("Program has been terminated"); //Program will terminate
}

test
import java.util.Scanner;
public class WeeklyPay 
    public static void main(String[] args)
        Scanner input= new Scanner (System.in);
        double rate;
        double hours;
        double weekly;
        String name;
        String stop;
        String name2;
        System.out.println("Hello!"); //Welcome Text
        System.out.println("This program computes an employees weekly pay"); //Explains what its for   
        System.out.print("Please enter the employees name:"); //Asks for employees name
        name = input.nextLine(); //Saves next input as name
        if( ! (name.equalsIgnoreCase("stop")) )
        System.out.print("Please enter the hourly rate of the employeee:");  //Asks for hourly rate
        hours = input.nextDouble(); //Saves next input as hours
        System.out.print("Please enter the number of hours the employee works a week:"); //Asks for number of hours worked in a week
        rate = input.nextDouble();  //Saves number of hours a week
        weekly = rate*hours; //Computes weekly pay
        System.out.printf("The employee:%s\n", name); //Displays Employees name
        System.out.printf("Weekly pay : $%6.2f%n", weekly); //Displays weekly pay
        while( ! (name.equalsIgnoreCase("stop")) )
        System.out.println("Please enter the employees name:"); //Asks for employees name
        name2 = input.nextLine(); //Saves next input as name   
        System.out.print("Please enter the hourly rate of the employeee:");  //Asks for hourly rate
        hours = input.nextDouble(); //Saves next input as hours
        System.out.print("Please enter the number of hours the employee works a week:"); //Asks for number of hours worked in a week
        rate = input.nextDouble();  //Saves number of hours a week
        weekly = rate*hours; //Computes weekly pay
        System.out.printf("The employee:%s\n", name2); //Displays Employees name
        System.out.printf("Weekly pay : $%6.2f%n", weekly); //Displays weekly pay
        System.out.println("Program has been terminated"); //Program will terminate
}Edited by: Broodwich on Oct 10, 2008 8:00 AM

Similar Messages

  • My MacBook Pro keeps making copies of a document that I am trying to save. I don't want to duplicate the file. I only want to save it on both my hard drive and my external hard drive. I do not want to change its name for every save, which the computer see

    My MacBook Pro keeps making copies of a document that I am trying to save. I don't want to duplicate the file. I only want to save it on both my hard drive and my external hard drive. I do not want to change its name for every save, which the computer seems insistent on doing. Help!!

    11lizzyp wrote:
    can't be saved because the file is read-only.
    I did not create the file to be read-only. I created to be able to continue to add to it as I work on it.
    More on versions here:
    http://support.apple.com/kb/ht4753
    local snapshots:
    http://support.apple.com/kb/HT4878
    Sounds like a permissions problem ie read only.
    If running repair permissions from your DiskUtility.app does not sort it,
    Someone should jump in here with erudite and concise fix.

  • Framemaker uses $filename for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen?

    Framemaker uses <$filename> for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen? In compiling our books it would be helpful to not have this extension appear as it then requires us to create extra files without them.

    See: System Variables

  • I do NOT want Firefox to remember my sign-on user name for my e-mail account. How can I get rid of this?

    When I start typing my user name for hotmail, it automatically pops up. I do NOT want this. How do I get rid of it?

    *Click the (empty) input field on the web page to open the drop down list
    *Highlight an entry in the drop down list
    *Press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Deleting_autocomplete_entries
    *https://support.mozilla.com/kb/make-firefox-remember-usernames-and-passwords
    * https://support.mozilla.com/kb/Form+autocomplete

  • I want to update to LION,on my Macbook Pro duo core, (october 2006) because Adobe CC needs at least that. I know my computer is old, but works perfect to me and I do not want to stay in Adobe CS6 since I have access to Adobe Cloud CC. Please help.

    I want to update to LION,on my Macbook Pro CORE 2 DUO, (october 2006) because Adobe CC needs at least that. I know my computer is old, but works perfect to me and I do not want to stay in Adobe CS6 since I have access to Adobe Cloud CC. Please help.
    I probably dont want to go to Mountain Lion either because I've heard that it will slow down my computer, So, Lion 10.7 will be the perfect OS X for me.
    I have ne newest release of Snow Leopard installed and works great.
    Thank you ALL for your help.

    you will be ok updating to the new software but there will be some trade off. i have 3 macbooks 2006 that are all running the latest versions.
    some of the trade off are
    1-2 less of battery life
    slow wake ups from sleep
    slower start up time about 30-40 seconds longer then what you have now
    the operating system will use high % of your processer while idealing
    these are not the things you want to hear about a new os compared to the old one but this is how it is even with a new macbook pro. but it's not the end of the world. just make sure you have at least more then 2GB of ram and have a good harddrive and you will be ok.

  • Trying to sync iPod with library, but receive this message, "The iPod is synced with another itunes library.  Do you want to erase this ipod and sync with this itunes library".  I do not want to erase my iPod... Any suggestions??  Please help!!

    Trying to sync ipod with itunes library, but I keep getting this message, "  The ipod is synced with another itunes library.  Do you want to erase this ipod and sync with this i tunes library?" 
    I do not want to erase my ipod!!!  Any suggestions?? please help!

    Another way. You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive (works the same with an SD card) into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
    Using The iPad Camera Connection Kit
    http://support.apple.com/kb/HT4101
     Cheers, Tom

  • My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    Restart your WiFi router and printer by removing power for 30 seconds.

  • For some reason itunes will not even open It is asking me to reinstall?  PLease advise.  I do not want to loose all of my music, apps, video etc help!

    Can someone help with itunes, for some reason all of a sudden my iteunes will not open.  It wants me to reinstall.
    I do not want to loose anything. My 2 children have itunes and they have a music list as well as many apps. please help???

    Adobe is a company... do you mean Acrobat?
    >subscription to Creative cloud cs6
    Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    If yes
    Some general information for a Cloud subscription
    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    If no
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • We have 3 iPads 3 iPhones 3 Apple id's.  We want to use 1 calendar we can all access on each device and have each device update or sync and we all receive notifications from the one calendar. We do not want to share photos contacts, ect.  Please help

    We have 3 Apple Id's, each ID using an iPad and an iPhone (3 id's, 3 iPads, 3 iPhones). We want to use one calendar on all 6 devices and have that one calendar update or sync to all devices.  We would like all 6 devices to provide notifcations from the one unique calendar as well.  We do not want to share contacts, photos, ect.  Please suggest how to achieve this, with the name of the calendar, if I am to get one from the App store, and how to set this up.  Please talk in easy terms as I am technically Challenged. Thank you.  3 iPad air 2, 2 iPhone 6 plus, 1 iPhone 4s.

    Hello there MizzouTrojan,
    If I understand correctly you want all 6 devices to have access to a single calendar that each device gets notifications for and can edit. You can do that with an private iCloud shared calendar. First sign into www.icloud.com and use these steps from the following article to share a calendar:
    iCloud: Share a calendar with others
    Share a calendar privately
    Click the Share button to the right of the calendar name in the sidebar, then select Private Calendar.
    Note:    You can also share the same calendar publicly. For instructions, see the next task, “Share a calendar publicly.” 
    Type the invitee’s email address in the Add Person field and press Return.
    Click the pop-up menu with the invitee’s name and choose access privileges (View & Edit or View Only). 
    For each person you want to share the calendar with, repeat steps 2 and 3.
    When you’ve invited everyone and set their privileges, click OK.
    Invitation emails are sent from your iCloud email address to the participants you specified.
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • Is there a way to increase the icon size (and the text below) without using zoom?  I am trying to help out someone who has moderate visual impairment that does not want to use zoom just to see the icons and their labels.

    Is there a way to increase the icon size (and the text below) without using zoom in iOS 7?  I am trying to help out someone who has moderate visual impairment that does not want to use zoom just to see the icons and their labels.

    Hello Apple.
    It seems you have gone to great lengths to improve accessibility in many areas of the iPad. Why was this obvious problem with icon text size missed?  (It's not with the Mac.). And for so long too.
    Do you employ people with actual accessibility problems to help you do UI design?
    I think too, that some buttons are too close for people who might have motor control problems.
    I love my iPad but I fear as I age, the iPad might not keep up with me.

  • Is there another way i could turn my phone on? it wont turn on or show me the battery screen to show its charging. i already tried to hold the on and home button at the same time but it does not want to turn on. please help?

    is there another way i could turn my phone on? it wont turn on or show me the battery screen to show its charging. i already tried to hold the on and home button at the same time but it does not want to turn on. please help?

    Device Not Recognised
    For PC
    http://support.apple.com/kb/TS1538
    For Mac
    http://support.apple.com/kb/ts1591

  • My ipod touch is in DFU mode 5g I need help, do not want to lose my data, please help in Spanish

    I need help, do not want to lose my data, PLEASE HELP IN SPANISH

    Una vez que el dispositivo está pidiendo ser restaurado con iTunes ... ya es demasiado tarde para salvar nada ... y usted debe continuar con la recuperación de ...
    Vea aquí> http://support.apple.com/kb/HT1808
    Es posible que tenga que probar más de una vez ... Asegúrese de seguir todos los pasos ...
    Tómese su tiempo ... Preste especial atención a los pasos 3 y 4.
    Para minimizar la pérdida ...
    Después de haber recuperado su dispositivo ...
    Re-sincronizar su contenido o restauración de la última copia de seguridad ...
    Restaurar desde copia de seguridad> http://support.apple.com/kb/ht1766
    Once the Device is asking to be Restored with iTunes... it is too late to save anything... and you must continue with the Recovery...
    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.
    To minimise loss...
    After you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup  >  http://support.apple.com/kb/ht1766

  • BADI Error: Field GOITEM-ACCT is not ready for input ? HELP!

    I get this error message when testing my BADI in the MIGO Transaction.  The BADI is the MB_MIGO_BADI.  It is from the Line_modify method.  Here is the entrie message:
    BAdI: Field GOITEM-ZZREG_ACCT is not ready for input. (Change is not copied over)
    Message no. MIGO050
    Diagnosis
    The contents of field GOITEM-ZZREG_ACCT have been changed in BAdI MB_MIGO_BADI (method LINE_MODIFY). The field, however, is not ready for input, so the change cannot be copied.
    In method LINE_MODIFY, only the contents of fields that are ready for input can be changed.
    The field is defined correctly in the screen as an input/output field - so it does not relate to that.
    HELP!!!!!

    Yes - I have reviewed all of the code and I never do any modify to the screen attributes of a field - although it sure acts like it.  The screen lets me put in data and it stays there up until it finishes the method line_modify.  The error is when i press return after i enter the field- it completes the BADI method and then goes to the main program and does field validation and always comes back with some internal table field called "work" with a value of 0 and it should be a value of 6.
    Thanks! 
    Scott

  • Help anyone pls!!! I DO NOT WANT TO UPDATE TO HE NXT LEVEL WEBOS

    My phone keeps popping up for me up update my webos i do not want to.... it accidentally clicked over to update and now i do not know how to turn off this update. I assume there has to be away not to update my phone. I took the battery out so the update would not be completed and this is were i am stuck! i put the battery back and it automatically starts the update I tried the chat support of course they were no help telling me there is no way to stop the update but i believe there is a way! I tried to hit the orange but sym and r to restart and that didnt seem to help. I also tried to click the top button 3 times and that doesnt work either! All suggestions would help
    Post relates to: Pre p100eww (Sprint)

    Read this: Understanding webOS System Updates.
    There are ways to get around it (charge your battery in a separate charger,  if you have one, keep your phone in airplane mode, etc, etc) but eventually the phone will take the update.
    I have to echo what wushu2004 says, why do you not want the update?
    P.S.  If you continue to interrupt the process, you may get into a situation where it will no longer start up, causing you to resort to using the webOS Doctor tool, which will also install the latest update (and doing this works but has a few ramifications)

Maybe you are looking for

  • Share microsoft office documents not saving on all users

    Set up new user account for my wife shared my "desktop" where regular microsoft excel and word documents we use are saved Wife's account can access documents and save, but when testing and i try on my user, the file alterations have not been done. I

  • Re: Easy Cost Planning

    Hi All i have created an investment project structure and attached 2 levels of WBS Elements. When i'm executing the " Easy Cost planning" the system is showing the following message. " No WBS elements have been created for the Project yet" and the de

  • InCopy crashes when exporting stories

    I am using InCopy CS6 and I have tried unsuccessfully to export from Story view to PDF. I select all of the appropriate options in the PDF Export dialog box. However, when I click the Export button, I get this error message: Adobe InCopy CS6 has stop

  • Mrp- order type

    Hi, we defined 3 order types like zp01,zp02, zp03 for std orders, r&d orders, sample orders resp in one plant. In oppr we mentioned the conversion order type between planned order to zp01. incase of std orders, it can be converted into zp01 order typ

  • Flash and SEO for Ecommerce Web Design

    Hi I am working with a web design company in the UK and was wondering if there are any indications of when Flash could be recognised by Google? This is a major issue as the design features are fantastic but SEO is a nightmare. I would love to introdu