Output doesnt show??

//import java.text.*;
//import java.util.Locale;
public class Firm
     private Employee[] empObj;
     //private double raisedPay;
     //Firm constructor
     public Firm(Employee[] empObj)
          //this.empObj = new Employee[empObj.length];
          for(int i=0;i<empObj.length;++i)
               this.empObj[i] = empObj;
     /*My main method creates four objects, two each of classes HourlyEmployee
     * and ExemptEmployee*/
     public static void main(String[] Args)
          HourlyEmployee he1 = new HourlyEmployee("Jack Bauer",20.00,50);
          HourlyEmployee he2 = new HourlyEmployee("John Smith",22.00,30);
          ExemptEmployee ee1 = new ExemptEmployee("Joe Black",4000.00);
          ExemptEmployee ee2 = new ExemptEmployee("Dave Mirra",1000.00);
          System.out.println("The Hourly Employees Pay\n"+he1.toString());
          System.out.println("The Hourly Employees Pay\n"+he2.toString());
          System.out.println("The Exempt Employees Pay\n"+ee1.toString());
          System.out.println("The Exempt Employees Pay\n"+ee2.toString());
          /*System.out.println("Newly set parameters.\n");
          he1.setPay(25.00,35);
          ee1.setPay(4500.00);
          System.out.println("The New Hourly Employees Pay\n"+he1.toString());
          System.out.println("The New Exempt Employees Pay\n"+ee1.toString());
          Employee[] empEmpl = {he1,he2,ee1,ee2};
          Firm firmObj = new Firm(empEmpl);
          firmObj.payRaise();*/
     /*public void payRaise()
          //NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US);
          System.out.println("***************************************************\n");
          for(int i = 0;i<empObj.length;++i)
               if(empObj[i] instanceof ExemptEmployee)
                    raisedPay = (empObj[i].getPay() * 1.2d);
               //empObj[i].setPay(raisedPay);
               //System.out.println("The current pay before a raise is: "+nf.format(empObj[i].getPay()));
               //System.out.println("The pay after a raise is: "+nf.format(raisedPay));
               //else(empObj[i] instanceof ExemptEmployee)
               //empObj[i].getPay();
class ExemptEmployee extends Employee
     private double paypermonth;
     ExemptEmployee(String name,double paypermonth)
          super(name);
          this.paypermonth=paypermonth;
     public void setPay(double pm)
          paypermonth=pm;
     public double getPay()
          return paypermonth;
     public String toString()
          String str = super.toString();
          return str;
abstract class Employee
     //private local variables
     private String name;
     private double paypermonth;
     //constructor
     Employee(String n)
          name=n;
     public double getPay()
          return paypermonth;
     //toString() method
     public String toString()
          double amount = getPay();
          Object[] values = {new String(name),new Double(amount)};
          String str= String.format("Employee Name: %s\nEmployee Pay: \n",values);
          return str;
class HourlyEmployee extends Employee
     private double payperhour;
     private int hours;
     //constructor
     HourlyEmployee(String name,double payperhour,int hours)
          super(name);
          this.payperhour=payperhour;
          this.hours=hours;
     public double getPay()
          return payperhour*hours;
     public void setPay(double pph,int h)
          payperhour=pph;
          hours=h;
     public String toString()
          String str = super.toString();
          return str;
Can someone tell me why the output is not showing when I compile. I am receiving no errors. This is the output.
The Hourly Employees Pay
Employee Name: Jack Bauer
Employee Pay:
The Hourly Employees Pay
Employee Name: John Smith
Employee Pay:
The Exempt Employees Pay
Employee Name: Joe Black
Employee Pay:
The Exempt Employees Pay
Employee Name: Dave Mirra
Employee Pay:
I dont know why I am not getting any pay for the employees. Any ideas? I have commented out all of the code that I thought would of conflicted with the output, and I still am not able to figure out what I am doing wrong.

String str= String.format("Employee Name: %s\nEmployee Pay: \n",values);There's only one replacement variable in there (the %s thingy). Everything else is a literal. So of course it's only going to print:
Employee Name: (some replacement string here) (newline)
Employee Pay:(newline)
because that's exactly what you told it to do.

Similar Messages

  • AppBuilder Application doesnt show the output

    Hi All,
      I am doing the sample application in AppBuilder, when i run the application it opens a new browser window but it doesnt show the output.
    this is the problem, how to resolve this?
    If any body come across this issue please help me.
    Regards,
    Sravanya

    Hi Sravanya K,
    There seems to be some compatibility issue with latest Chrome update. (All the other pre requisites have nt had any releases very recently)
    Last release of other Pre requisites :
    Node JS - 5th june 2014 ( Node.js ChangeLog )
    JDK - (its to be manually updated).
    APP Builder (appbuilder-1.0.1252.zip is the last release which happened a long time back )
    Google Chrome - Can find latest release logs in Chrome Releases and chrome has an Update almost everyday
    UI5 Liraries - As per OpenUI5 - Download  16 th July 2014 is the last release of Ui5 libraries.
    More over App builder does not need any internet connectivity to atleast run the sample applications / templates of SuperList,Chart. (so the issue might be internally in the system using these pre requisites )
    So i certainly doubt the Auto Update feature of Google Chrome , causing this issue.
    Though this currently have nt worked in latest version of chrome in my system , other major browsers are still supported .
    As a work around can suggest to work with other browsers.
    I also tried with Safari , Firefox and  safari  worked satisfactorily -
    (Chrome, Safari are recommended for App Builder ) (Firefox worked partially)
    attached is the screenshot of Sample Application running in Safari
    Regards
    Virinchy

  • In column Chart when Y values are grater than y linear axis maximum it doesnt show the Bar

    Hi Guys,
    In column Chart when Y values are grater than y linear axis maximum it doesnt show the Bar.But i want show the bar upto the max limit of y linear axis without changing the max limit.
    Consider following example:
    Y values are 80 90 200 300
    and following are the output :
    Left:When i am not setting maximum property of linear axis.
    Right :When i am setting maximum property of linear axis to 200.
    In right 4th bar is not visible bcoz value for that bar is 300 which is excedding  maxium.But i want the 4th bar to appear same as 3rd bar.
    How i can do this?
    Thanks in advance.

    Are you going to show the bar going past the maximum value?
    If not, then you should change the Y value when entered into the array to the maximum value allowed. i.e.
    if(itemYValue > maxAllowedValue) {
         itemYValue = maxAllowedValue;
    Where maxAllowedValue is a variable you set on the application to control the maximum value for the chart.
    This is assuming that you are loading the values into an Array before updating the chart dataprovider with that array.

  • My iphone doesnt show up in my itunes. It shows up when i plug it into another laptop. Similarly, when i use someone else's iphone, that shows up in my itunes. Obviously my itunes wont recognise my iphone. Please help

    My iphone doesnt show up in my itunes. It shows up when i plug it into another laptop. Similarly, when i use someone else's iphone, that shows up in my itunes. Obviously my itunes wont recognise my iphone. Please help

    Hello ashbyy123,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    2. Check the USB cable
    3. Verify that Apple Mobile Device Support is installed
    4. Restart the Apple Mobile Device Service
    5. Verify that the Apple Mobile Device USB Driver is installed
    6. Check for third-party software conflicts
    Have a nice day,
    Mario

  • I have purchased music on my ipod touch but it doesnt show in my itunes library on my computer.... please help

    I have purchased music on my ipod touch but it doesnt show in my itunes library on my computer.... please help

    azmama3 wrote:
    I have purchased music on my ipod touch but it doesnt show in my itunes library on my computer.... please help
    With your iPod connected to your computer and iTunes running, select your iPod form the left pane, click the File menu in top bar, from there select "transfer purchases from iPod"
    Stedman

  • I tried to restore my iphone but when it was restoring it said a problem occurred and now it just shows the itunes symbole and its telling me to connect to it but when i try to it  doesnt show up on my computer

    i tried to restore my iphone but when it was restoring it said a problem occurred and now it just shows the itunes symbole and its telling me to connect to it but when i try to it  doesnt show up on my computer

    Hi there starbaeza,
    You may find the information in the article below helpful.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    -Griff W. 

  • Ordered my iphone 6 plus from atnt on september 29 when will it be ship to my house but it doesnt show anything on atnt order information! what should i do? please answer my question!

    ordered my iphone 6 plus from atnt on september 29 when will it be ship to my house but it doesnt show anything on atnt order information! what should i do?
    the truth is that i order my iphone 6 plus on september 26 from atnt store and on site but my credit card was declined
    so i tried it the next day but it works but from atnt site doesnt show anything(it only show my order on iphone 6 plus just like the last time)
    when will it say your order has been shipped?
    when will it be ship to my house?
    and also im going to use atnt next on iphone 6 plus
    please answer my question!

    This is a user to user technical support forum.  We can't possibly answer your question.

  • HELP !! My iPod keeps freezing i can go on it for about 10 secs then it freezes, i have to keep restarting it and it doesnt show up on itunes when i try to restart it please HELP

    I can go on it for about 10 secs then it freezes,
    i have to keep restarting it and it doesnt show up on
    itunes when i try to restart it please HELP!! >.<
    HASNT BEEN JAILBREAKED ASWELL

    - Try a reset. Nothing is lost
    iOS: Troubleshooting applications purchased from the App Store
    - If still problem, see it iTunes nows sees the iPod so you can restore the iPod.
    - Next see if placing the iPOd in recovery mode will allow a restore. For recovry mode:
    iPhone and iPod touch: Unable to update or restore
    - Last, try DFU mode and restore.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

  • Hey, my ipad is disabled and i cant open. i tried connecting it with itunes in recovery mode to restore it but it wont work it doesnt show and options itunes doesnt detect my ipad in recovery mode. what do i do know? please help!!!

    Hey, my ipad is disabled and i cant open. i tried connecting it with itunes in recovery mode to restore it but it wont work it doesnt show and options itunes doesnt detect my ipad in recovery mode. what do i do know? please help!!!

    If you followed these instructions and you were unable to enter recovery mode, I'm still leaning toward a hardware problem.  Also, since you have IOS-7, read this.  It might help.

  • I have a mac  book pro that i bought in late 2009. My current software is snow leopard version 10.5.8. I would like to get the new lion operating system but I cant without first getting the latest version of snow leopard. it doesnt show on software updat

    I have a mac book pro that i bought in late 2009. My current software is snow leopard version 10.5.8. I would like to get the new lion operating system but I cant without first getting the latest version of snow leopard. however when I go to update my software it doesnt show that any update is available.

    10.5.8 is Leopard, not Snow Leopard. You need the Snow Leopard DVD;
    You can get it only by phone now from Apple.
    In the US, call 1-800-MY-APPLE and ask for a sales assistant. Last quoted price was $19.99 for the single-user and $29.99 for the family licence.
    For other countries, check here; http://support.apple.com/kb/HE57
    Don't forget to ask for Sales; the tech support guys can't help.
    If you want Lion, rather than Mountain Lion, the same Sales team can give you a download code to use at the Mac AppStore.
    To get the App Store, you need to update your new Snow Leopard from 10.6.3 (which is the version on the installer) to 10.6.8 with the combo update; http://support.apple.com/kb/DL1399
    Be warned that the upgrades will render a lot of older software unusable, and will need new drivers for printers and scanners in all likelihood.

  • Ipod shuffle 4th gen charges plays but doesnt show up in windows or itunes

    Ipod shuffle 4th gen charges plays but doesnt show up in windows or itunes tried to check usb driver but computer says it is working properly

    Just disconnecting it without ejecting should not cause permanent damage.  It may cause data corruption, if iTunes was in the process of syncing at the time.  But iTunes should still see the shuffle and (maybe) tell you to Restore it.
    Is it possible that the "accident" damaged the USB cable? 
    Make sure you have done this on the shuffle since the problem occurred
    http://support.apple.com/kb/HT1655
    And you should also shut down (power off) the computer, if you have not already.
    Have you tried more than one USB port on the computer (not a hub if you use one)?  You can also try it with all other USB devices disconnected, except for standard keyboard and mouse (if normally used).
    If those things do not help, what version of Windows do you use?

  • HT5925 when I connect my Ipod touch it doesnt show on my itunes screen

    my ipod doesnt show on my itunes screen when I plug it

    Hello alexglvn,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    1. Update iTunes
    2. Check the USB cable
    3. Verify that Apple Mobile Device Support is installed
    4. Restart the Apple Mobile Device Service
    5. Verify that the Apple Mobile Device USB Driver is installed
    6. Check for third-party software conflicts
    Best of luck,
    Mario

  • My iphone wont turn on, the screen is just barely lit and has a greyish appearance; plus when i plug in my iphone to my macbook pro it doesnt show up in my itunes

    my iphone wont turn on. the screen is just barely lit and has a greyish appearance; plus when i plug in my iphone to my macbook pro it doesnt show up in my itunes. what do i do?

    http://support.apple.com/kb/ht1808

  • IPod shows up under my computer, but doesnt show up in iTunes

    When i plug in the iPod, a window pops up showing the folders contained on the iPod, but the iPod doesnt show up in iTunes.

    here is a place to start
    iTunes Does Not Recognize Your iPod

  • I am trying to restore  info from a 3g to a 3gs when I plug in the 3gs it shows that i have it backed up but when i plug in the 3g it doesnt show my name on there at all

    I need help restoring from my computer

    My 3gs randomly shuts off so I went to apple they said it was battery.  I replaced battery and it would not boot back up. So put old battery back.  So now I am trying to use my old phone 3g.  When I plug in 3gs and back up it shows that I did. So I eject and plug in 3g phone , when I click restore from backup it doesnt show my other phone 3gs and my name at all.???  can you help

Maybe you are looking for

  • Customers updated with wrong Telephone number - SD_CUSTOMER_MAINTAIN_ALL

    Hi All, When we are updating bulk of customers, a particular telephone (ADR2-TEL_NUMBER) is updated for the bulk of customers. This is weird. This is happening when we update customer master with SD_CUSTOMER_MAINTAIN_ALL. This is not happening all th

  • XL Reporter- Expressions in Parameters.

    Hi, In XL Reporter for a UDF field we needed to allow users to select multiple options. E.g. for a UDF field named "Country" which includes a list of  countries if the user wants to select all the countries he/ she should be allowed to multi select t

  • Changing plant assignment to company code

    Hi, Need your help urgenly!!! We have a plant AXXXX assigned to company code AXXXX over a year and we have number of open PO's , GR's and delivery etc for this plant and now we want to change the assignment as plant AXXXX to be assigned to company co

  • I can't open up iPhoto on my MacBook Air.

    I have had my MacBook Air for almost 2 years.  When I ordered it, iPhoto was already installed and worked for a few months.  I was able to upload photos easily.  I'm afraid somehow I accidently deleted or uninstalled it without realizing it.  For mon

  • Rsh is broke ?? [solved]

    Hi, I'm new to Arch. I've installed "openssh", "cvs" and "netkit-rsh" packages using pacman. I can ssh into a remote machine without a problem. but I can't use cvs to work with a remote repository. # cvs -d :ext:username@remote_machine/homes/username