Quick question need help

Okay my problem is writing a code for payrole. I have to write the code to be 1.5 basepay for every overtime hour between 41 and 60, and be 2 times basepay for every hour over 60. I have done that, which isnt the problem....
I am using a for loop to allow the user to select the number of employees they want to do at one time. However I am a bit perplexed. After the for loop is over I need to be able to add all the salarys together and come up with a total payrole salary, and I just do not understand how to do that, I will post my java code, sorry if its a little rough, I am just beginning.
import java.util.Scanner;
public class FigureWages {
     public static void main(String[] args){
          Scanner input =new Scanner(System.in);
          System.out.print("Enter Number of Employees= ");
          double NumbEmploy = input.nextDouble();
          for (int i = 0; i < NumbEmploy; i++)
               System.out.print("Enter Employee Number= ");
               double EmployNumb = input.nextDouble();
               System.out.print("Enter Base Pay= ");
               double basepay = input.nextDouble();
               System.out.print("Enter Hours Worked= ");
               double hours = input.nextDouble();
               if (hours < 60 )
                    double overtime1= ((hours-40)*(1.5*basepay)) + (40*basepay);
                    System.out.println("Employee Number= "+EmployNumb);
                    System.out.println("Base Pay= "+ basepay);
}     System.out.println("Hours Worked= "+hours);
                    System.out.println("Pay= " + overtime1);
               else if (hours > 60)
                         double overtime1= ((hours-60)*(2*basepay))+(20*(1.5*basepay))+(40*basepay);
                         System.out.println("Employee Number= "+EmployNumb);
                         System.out.println("Base Pay= "+ basepay);
                         System.out.println("Hours Worked= "+hours);
                         System.out.println("Pay= "+ overtime1);
               }

now doesn't this look better?
i changed one of your methods
public class Member {
    private String firstName;
    private String lastName;
    private double heightInches;
    private double weightPounds;
    private int yearOfBirth;
    private int yearOfJoiningClub = 1990;
    private String membershipNumber;
    private int currentYear;
     * Constructor for objects of class Member
    public Member(String first,String last,double height,double weight,int birth,int join,String memberNumber,int curYear ){
        firstName = first;
        lastName = last;
        heightInches = height;
        weightPounds = weight;
        yearOfBirth = birth;
        yearOfJoiningClub = join;
        membershipNumber = memberNumber;
        currentYear = curYear;
    //Behaviors
    public String getFullName() {
        String full;
        full = firstName + " " + lastName;
        return full;
    public int calculateYearsJoined() {
        int yearsJoined;
        yearsJoined = currentYear - yearOfJoiningClub;
        return yearsJoined;
    public int calculateAge() {
        int ageOfMember;
        ageOfMember = currentYear - yearOfBirth;
        return ageOfMember;
    public int calculateAgeOfAtJoining() {
        int ageOfJoining;
        ageOfJoining = yearOfJoiningClub - yearOfBirth;
        return ageOfJoining;
    public boolean getsDiscount(){
        if(calculateAge() < 12) {
            return true;
        if(calculateAge() >= 65) {
            return true;
        if(calculateYearsJoined () >=10)
            return true;
        return false;
}

Similar Messages

  • Re: Quick Question,  Need help with If else returns please!

    if(calculateYearsJoined () >=10)w(<-- Honda, Harley, BMW, Triumph, Ducati racer)

    now doesn't this look better?
    i changed one of your methods
    public class Member {
        private String firstName;
        private String lastName;
        private double heightInches;
        private double weightPounds;
        private int yearOfBirth;
        private int yearOfJoiningClub = 1990;
        private String membershipNumber;
        private int currentYear;
         * Constructor for objects of class Member
        public Member(String first,String last,double height,double weight,int birth,int join,String memberNumber,int curYear ){
            firstName = first;
            lastName = last;
            heightInches = height;
            weightPounds = weight;
            yearOfBirth = birth;
            yearOfJoiningClub = join;
            membershipNumber = memberNumber;
            currentYear = curYear;
        //Behaviors
        public String getFullName() {
            String full;
            full = firstName + " " + lastName;
            return full;
        public int calculateYearsJoined() {
            int yearsJoined;
            yearsJoined = currentYear - yearOfJoiningClub;
            return yearsJoined;
        public int calculateAge() {
            int ageOfMember;
            ageOfMember = currentYear - yearOfBirth;
            return ageOfMember;
        public int calculateAgeOfAtJoining() {
            int ageOfJoining;
            ageOfJoining = yearOfJoiningClub - yearOfBirth;
            return ageOfJoining;
        public boolean getsDiscount(){
            if(calculateAge() < 12) {
                return true;
            if(calculateAge() >= 65) {
                return true;
            if(calculateYearsJoined () >=10)
                return true;
            return false;
    }

  • Quick Question **PLEASE HELP** .jar file?

    Hey everyone, im pretty new to the java scene but I have a really quick question that hopefully someone can help me with.
    I'm really interested in making a .jar file out of my code. And basically I just want to make one. but i understand there are certain things like main class's, etc. that need to be made in order to make a .jar file.
    So basically Say I opened up a new project in blueJ. I made 1 new class called "main." Inside of it I had nothing for conductors and no variables declaired untill the bottom part where i write my code.
    say i write...
    System.out.println("hello");
    and that is it.
    What steps from there do i do to make a jar file and have it be able to be executed and SEE the "hello" printed somewhere NOT in blueJ??
    (I understand there is something about a "static" method? Im not really sure but if somoene could enlighten me on how to make a .jar file that would be great.)
    Thanks a lot everyone!
    Tom

    I don't know anything about BlueJ, but this section of Sun's tutorial explains how to
    write a program that outputs a single line of text to the console:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
    Deploying an application as an executable .jar file is covered here:
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
    The first two sections - "Using JAR Files: The Basics" and "Working with Manifest
    Files: The Basics" - contain the information you need to understand this process.

  • Question: Need help with overcoming the following message:  "Nothing was imported.

    Need help with overcoming the following message:  “Nothing was imported.  The file(s) or folder(s) selection to import did not contain any supported file types, or the files are already in this catalogue”.
    The photos being scanned are old film shots.  They have NOT been previously scanned.  I am using Photoshop Elements 9 software.
    QUESTION:  how do I override this STOP and or circumvent the photo comparison option????
    Thanks for the help. Bob K ---  [email protected]

      Are you scanning as jpeg, tiff or some other format?
    Are you using continuous numbering for files names as by definition scanned files have no exif data.
     

  • Quick Question Need Some Help

    i try to open i chat and i get an error message saying
    You can't use this version of the application iChat with this version of Mac OS X.
    4.0.8
    i updated to snow leperd 2day and it wont let me go on
    please help awnser asap thank you

    Thanks a bunch. I was having the same exact problem with Safari and Ichat and this solved it. So simple too. Thanks for the help.

  • Quick question: need some help with a lens effect filter

    I'm playing with the iphone 8mm video cam app and they have this familar lens effect... as seen here
    http://www.youtube.com/watch?v=Dkh7Ok8cQmw
    Would anyone know the name of this effect... it's almost like a hard pulsating vignette that you'd see in old 70's home films
    I wanted keep the video as clean as possible and use a plug-in or method to re-create that effect in post-production....

    Having done 8mm film transfers for over 20 years, I can say that I've NEVER seen the frame of the film jump like that vignette does. To me, it makes it look very fake. The rest of the effect looks OK; the image jitter, the light flicker, etc, but the vignette should be stable.
    -DH

  • Long-time Eudora user, rookie Mail user--have questions, need help!

    Hi, all!
    As the subject heading says, I've been using Eudora for a very long time (way past its shelf life) and have been playing around with Mail off and on over the past year.  (Now, in Eudora's defense, the expiration date on it was a "Best by..." not a "Use by..." date   and it's been working fantastically for years! )
    I recently started to plunge into Mail more deeply and have a couple of questions.
    1. Drafting vs. queuing. 
    I am used to Eudora's system where a bunch of drafted messages sit in an Outbox.  They stay there until I flag QUEUE for the ones I'll eventually be mailing.
    It's a good system.  A quick look at the flags in the Outobx lets me know which I still to need to work on, and which ones are ready to go out (or need a final review before sending).   The user then selects "Send Messages" and it e-mails the ones queued in the Outbox, but not the remaining draft emails that haven't yet been queued.
    How do I set up something like that in Mail?
    Right now, all I have is a list of draft messages and I cannot tell which ones are still really drafts and which are ready to be sent!
    2.  Work-around to try and mirror Eudora's system.
    I tried creating a new mailbox called Queue, in which I can park the emails I've done editing.  Of course, the problem with such a scheme is that when I want to send messages, I either have to put them back into the Drafts mailbox, from where I can select and send everything (including ones I haven't finished editing!), or drag them into Mail's Outbox where they go out instantly.  That's a little freaky and I can see disasters happening (emails going out when I'm wanting to drag other messages to a different mailbox).
    3.  Disable auto-sending? 
    Is there a way of turning off and on the Outbox's automatic sending action?  That could be the simplest solution for me.  I'd really like to send messages only via a menu command--yet, from I've determined, Mail's Send menu command will send any messages selected in the Draft mailbox.  Again, I see screw-ups with that as the wrong draft could be selected and Mail would send it out. 
    4.  Display of badges for mailboxes.
    This is more of a curiosity, but is there a way of having a user-created mailbox show how many e-mails are in there?
    Solutions?
    What do you all do as to work flow?  How do you go about creating and revising a bunch of e-mails, but only sending out certain ones?  And ensuring that only the ones you want to go out, go out?!

    Thank you for posting all this info.  Unfortunately i have no idea how to do flags and how to use a smart mailbox as a place to store emails i am not ready to send.  Eudora is vastly superior in all the things it empowers the user to quickly and easily do, in the traditional Apple spirit of intuitiveness, clear direct normal (not esoteric) communicatioin and user friendliness.
    about three weeks ago i was pretty much forced into Mountain Lion bcause my old MacBook is barely functioning at all and i got a new MacBook Pro.  So, good bye Eudora that i've used since 1995, only because i couldn't find another mail program that did what it does.  I wonder why there aren't others.  I've tried MailForge, it's a great attempt but it seems to have run out of steam and isn't working well enough. 
    I am using Mail and Gmail. The result is i'm suffering a whole range of loss of functionality in email, and am not getting a lot of messages, they are here somewhere but i can't always find them, i have to go to my old computer, enduring a kind of freeze where a beachball is a sign of progress, a trackpad that barely works for drag and drop anymore and a battery that needs reaplacing. i think the hard drive is failing. but i still need it to retrieve my email reliably, to a poiint where i see i 'm going to have to put money into it so it can keep working, for email.  what a poor solution. I am trying as best i can to have Mail communicate better. 
    i just wanted to thank you for your encouraging posts and giving me something to follow up on to try to use, to address this one of many loss of Eudora problems. Why wouldn't a mail program give you the option to queue mail?   Why take away options and functionality?   sorry, i'm just ranting because i've had a very frustrating last few weeks related to numerous new OS challenges, but email is the only really serious one. 
    I really like your idea of badges to show number of new messages, i think that's what you meant, you didn't say 'new', but another great and helpful thing about Eudroa is sorting mail into mail boxes and opening those mailboxes that get new mail each time you download mail, so you kow what's new. You can immediately see it.  In Apple Mail, i find i have to dig through each of the 12 'on my mac' mailboxes/folders i created so far, to see if there is new mail in them. A lot of extra trouble for something that a superior email program can do for you.

  • Captivate 8 Quiz question need help!!!

    Hi,
    I am trying to create a quiz in captivate 8. When the user answers the question correctly, i want correct caption to show ( which is showing ) but i also want a trophy (image)  to appear to give the user a little motivation to go to the next question.
    If user selects the wrong choice of the multiple choice question twice, they will be directed back to the slide where the answer is ( remediation ) and from there i want the next button to change to 'return back to quiz button'
    Thats how i want quiz to be like.
    I have created the advance action to pop up the trophy (image) when user is right but then remediation doesnt work, means when they come back from the section where the answer is, they cant select the right answer as the quiz has not been reset.
    These are grave issues i am dealing with. If there is any solution to this, please kindly help me out. I would be really grateful if there is anyone to sort this out.

    Thankyou for your reply. Yes i tried that but once i preview that particular slide, the 'next button' takes time to go to the next slide ( like i have to click more than once to go to the next slide) and it is happening on every slide that has remediation on.
    So i thought i make a 'return button' that is only visible when the user comes back from the quiz. Not sure how to do that as i am already using advance action on quiz slides, On success on the quiz slide to show the correct caption and the trophy. And on last attempt they go back to the slide where the answer is but once they come back they can't select the answer ( its locked ) and remediation slides does not go forward as quickly as other content slides.
    I hope you understand what i mean ?

  • Rotated a picture went into savingbeen in savings for 3days cannot delete or get to my other photos  iphone 5s question need help

    question; on i pnone 5s  rotated a photo in my photos been in saving mode for 3 days cannot delete or cancel also can't get to any more of my pics

    Reset the phone. Hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone should reboot and release the problem you are experiencing.

  • Quick Question PLEASE HELP!!!

    How would I get the length of the array calling this? I tried this and that doesn't seem to work...
        public int numRows(){
            return this.length;
        }

    platypus1 wrote:
    I have an array, sorry I am new to this stuff...but I want this to work on whatever array I call it on. So if i call myNums.numRows() or myArray.numRows() so that it returns the length of myNums or myArrayYou can't add a method to an array. You need to write a class that aggregates the array, and then you can write that method, and that method should then return myArray.length.
    Another option is to make the method take an argument.

  • Iphone question, need help please!

    i have a iphone 3G s and my battery was charged full.  my son was playing a game and it just shut off by itself and i tried to turn it on nothing happened so i thought dang maybe the battery went dead already, tried to charge it and it is doing nothing at all.  can someone please help, not sure what to do??  thanks so much!!

    Try a reset ( covered in the basics section of the manual):
    iPhone User Guide (For iOS 4.2 and 4.3 Software)

  • Question Need Help

    I have an Ipod Video 30G. Im trying to put videos on but there is no audio. I know you have to convert something but i dont know what. If there's any programs i should download then that would be great. Please Help!

    Never Mind i figured it out it has to be exported as MP4 instead of MP2.

  • Big ipod-problem/question, need help!!! PLEASE!!!

    1.) I was transfering songs onto my 20 GB clickwheel ipod
    2.) Itunes hung up, first time.
    3.) I plugged the ipod out
    4.) next time i plugged it in, nothing worked, and everything on my ipod was GONE!
    5.) Now i don't have any songs on it, i have tried resetting, new ports and the normal thing
    6.) the songs ARE there, because both the on my computer, and on the ipod it shows that alot of GB's are used!!
    Please help!!!

    It would appear that the iPod hard drive has become corrupt and unreadable. This doesn't mean that the songs are not on your iPod, hence the fact that the iPod reports used space and iTunes may show them.
    You should restore the iPod and then reload the songs from iTunes.

  • Quick question pls help

    i ordered
    Asus - Essentio Desktop / Intel® Core™ i7 Processor / 16GB Memory / 4TB Hard Drive
    and im just trying to figure out just what graphics card it has all it says is nividia gtx560 is it the ti version or which one is it i copy and paste the name on the search it sends me to the one i hope i have which is the ti but i just called best buy and they said it doesnt come with that one so im just tryint to figure out just what card it comes with the sku number is 2838773 thank you for your help

    According to a poster on best buys reviews for the product, it is the TI. Another poster asked a question stating it was not the TI but a poster that had the computer said the nvidia software on the computer said it was the ti.
    Crystal
    Superuser
    Forum Guidelines | Terms & Conditions | Community Guidelines | What is a Superuser?
    *Remember to mark your questions solved and click the star to give kudos to show your thanks!*
    While I used to be a Best Buy Employee, I no longer have any affiliation with Best Buy.
    My opinions do not in any way shape or form represent Best Buy's Official decisions.

  • A quick question.Pls Help

    I have created this code to access the horizontal elements of an array which are adjacent to each other.Does anybody knows how can i access the array diagonally?Starting from the first element, then the second and so on.
    for (int i=r-Hksize; i<r+Hksize; i++;){
         for (int j=c-Hksize; j<c+Hksize; j++;){
    pix = band1[i*c +j];
    pix_cdis = band1[i*c +j + 1];
    matrix1[pix][pix_cdis]++;
         return matrix1;
    Cheers
    Maria

    Assuming that you have a 2D array of same number of rows and columns.
    String[][] anArray = new String[10][10];
    //initialize array elements
    for (int i = 0; i < anArray.length ; i++)
          System.out.println(anArray[i]);
    hope this helps you.

Maybe you are looking for

  • Always reopen tabs from last session?

    I'm excited to see the "Reopen all windows from last session" option in the History menu. Is there a way to make Safari automatically reopen all windows from last session every time I open the program (like in Firefox)?

  • Will my LED 27 Cinema Display work with the new Mac Pro?

    Will my LED 27 Cinema Display work with the new Mac Pro?

  • Can't open or move file - In use by Mac OS X

    I have a file (movie) I am trying to move to a new external hard drive. I can't move it cause it says it is used by Mac OS X and cannot be moved or if I try to open it says it can't be opened. The permissions are set correctly on this file and it pla

  • Interactive pages don't work on Skill soft LMS

    Hi, We are working on a course using captivate 6 and some interactive pages are developed using flash and integrated in captivate. these interactivities work fine if we review it from any LMS or offline but our client has Skill soft LMS where these i

  • 10.3.9 minimum requirement

    I'm finally going to take the plunge and get an iPod. While I am very disappointed with not having Firewire, I do appreciate the new thinner design. My question is, I see the minimum system requirement is OS X 10.3.9 - I'm fine, as my Powerbook G4 is