Still can't get make my code into a Applet :)

this is my code.
import java.io.*;
class calculator2
public static void main(String[] ars)
     int num1,num2,num3,num4,num5,num6,sum;
num1 = num2 = num3 = num4 = num5 = num6 = sum = 0;
     /*Program statemants start here*/
          try
               BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
               System.out.println("Input Rent");
               num1 = Integer.parseInt(br.readLine());
               System.out.println("Input Utility bills");
               num2 = Integer.parseInt(br.readLine());
               System.out.println("Input mobile bills");
               num3 = Integer.parseInt(br.readLine());
               System.out.println("Input food");
               num4 = Integer.parseInt(br.readLine());
               System.out.println("Input soialising");
               num5 = Integer.parseInt(br.readLine());
               System.out.println("Input savings");
               num6 = Integer.parseInt(br.readLine());
               sum=num1+num2+num3+num4+num5+num6;
               System.out.println("Enter your income: ");
               int income = Integer.parseInt(br.readLine());
               income -= sum;System.out.println(income);
          catch (IOException ioe) {}
          catch (NumberFormatException nfe) {
               System.out.println("That wasn't a valid number!");
i want to run that program as an applet is that possable? if it is, can i used an HTML doucment like this :
<HTML>
<HEAD>
<TITLE>A Simple Program</TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
or is that not possible, any advice you can give would be gratefully recieved
thanxs
Anthony

Here is a working code:
import java.applet.*;
import java.io.*;
class Calculator2 extends Applet {
   public Calculator2() {
      int num1,num2,num3,num4,num5,num6,sum;
      num1 = num2 = num3 = num4 = num5 = num6 = sum = 0;
      /*Program statemants start here*/
      BufferedReader br = null;
      try {
         br = new BufferedReader(new InputStreamReader(System.in));
         System.out.println("Input Rent");
         num1 = Integer.parseInt(br.readLine());
         System.out.println("Input Utility bills");
         num2 = Integer.parseInt(br.readLine());
         System.out.println("Input mobile bills");
         num3 = Integer.parseInt(br.readLine());
         System.out.println("Input food");
         num4 = Integer.parseInt(br.readLine());
         System.out.println("Input soialising");
         num5 = Integer.parseInt(br.readLine());
         System.out.println("Input savings");
         num6 = Integer.parseInt(br.readLine());
         sum=num1+num2+num3+num4+num5+num6;
         System.out.println("Enter your income: ");
         int income = Integer.parseInt(br.readLine());
         income -= sum;System.out.println(income);
      } catch (IOException ioe) {
      } catch (NumberFormatException nfe) {
         System.out.println("That wasn't a valid number!");
         System.out.println("Someone else did my homework for me! ");
   public static void main(String[] ars) {
      new Calculator2();
   public void init() {
      new Calculator2();
   public void stop() {
   public void start() {
}

Similar Messages

  • I still can't get a redemption code it won't accept my serial number what happened to Adobe it used to be user friendly

    I still can't get a redemption code it won't accept my serial number what happened to Adobe it used to be user friendly

    Bentnote if you are unable to redeem your redemption code then please contact Costco.
    If you were provided a serial number then please register it under your account at http://wwww.adobe.com/.  You can find more details regarding locating and registering your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.

  • How can I get the verification codes for system updated

    I still can't get the verification codes to be sent to my mobile phone after I updated my system to ios 8.0 since yesterday

    Hello Slordan2012
    Log in to appleid.apple.com and resend the verification email to then verify the address. If you cannot get pass that, then you can always force the restore on your iPad and then enter in the password to bypass trying to turn it off.
    Apple ID: Associating and verifying email addresses with your Apple ID
    http://support.apple.com/kb/he68
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    Regards,
    -Norm G.

  • Thanks so much for the offer of help. I'm using 10.9.2 OSX. I have Numbers 2.3 (554). I tried the new version but it was "dumbed down" so much (to make it usable on multiple platforms) that it was of no use on iMac.   I still can't get my contacts to open

    Thanks so much for the offer of help. I'm using 10.9.2 OSX. I have Numbers 2.3 (554). I tried the new version but it was "dumbed down" so much (to make it usable on multiple platforms) that it was of no use on iMac.
    I still can't get my contacts to open in Numbers like they used to do. I have a group of five addresses in a test folder in Mail called "untitled group." But no amount of pasting, dragging, etc can get them to open up in Numbers. My "real" folder has almost 100 addresses so I can't do it one by one.
    Thoughts?
    Thanks again.
    Bob

    Bob,
    You can place contacts in a table In Numbers by the following methods:
    Numbers 2.3:
    drag from contacts
    Numbers 3.2
    copy from contacts, then paste into Numbers
    In both cases you need to open System preferences, then select the "Security & Privacy panel and allow Numbers aaccess your contacts information.

  • HT203242 I've tried all of the suggested solutions, but I still can't get my cd drive recognised.  If I delete the driver and rebot, the cd drive appears, but as soon as the driver automatically installs, the driver disappears into the Q: drive

    I've tried all of the suggested solutions, but I still can't get my cd drive recognised on my laptop.  If I delete the driver and reboot, the cd drive appears, but as soon as the driver automatically installs, the driver disappears into the Q: drive, which is not accessible and neither is the CD drive

    I had the same or similar problem after installin iTunes 11 on my Acer Laptop with Vista. The new iTunes ran but I
    completely lost access to my CdRom/DVD drive. Error Code 19 was displayed in Windows Device Manager. Found out
    this is more widespread of a problem than expected.  After trying several forum recommended fixes, the Only thing that gave me back my CdRom drive was doing a Windows Restore to a date prior to iTunes 11 install.  I got my drive back but it also restored me to the prior 10.0.7.21 vers of iTunes which no longer worked due to missing files. iTunes help
    recommended a Reinstall.  I am reluctant to do that for several reason.  That's where I am at for now until I find out if there are any other risks for using iTunes 11 vs. Registry Errors vs. Losing access to my CdRom drive.  Brad

  • STILL can't get Videos into 5G iPod I give up I'm bringing it back

    I have the Black 30GB, after a week of trying iSquint , Handbrake ,Movies for my iPod and now MPEG Streamclip I still can't get videos in my iPod . I give up, it's scratched to bits and I handle it with extreme care . This was the worst $300.00 I've ever spent .

    I had trouble with that too, but figured it out. Here are some things to check:
    1.) Preferences in iTunes with the iPod connected. I put mine on automatic update of all podcasts, just to make sure nothing is missed.
    2.) On the iPod, go to Settings > Main Menu > Videos > On
    3.) On the iPod, got to Videos > Video Settings > TV Out OFF, Widescreen OFF, TV Signal (in US is NTSC, in Europe is PAL).
    After I configured #3, all worked. I'm not sure the widescreen setting makes a difference, but I do know the TV settings do.
    I think you won't have any problems if you go down this checklist. Too bad they don't mention it in Apple support.
    G5 Tower   Mac OS X (10.3.8)  

  • I deleted my ibooks author file but the preview is still available on my ipad, can I get the ibook back into ibooks author to continue to edit?

    I deleted my ibooks author file but the preview is still available on my ipad, can I get the ibook back into ibooks author to continue to edit? I have not published anything, just previewed on my ipad but the file seems to be deleted from my imac which is what I was using ibooks author on. Any help is welcome!

    It's not a 'process' at all.
    If it was easy/straightforward, people would be turning store versions into iBA versions left/right and all **** would break loose. It's not and that's a good thing, sorry
    Work up from whatever version you have.
    Any work you value should be backed up....period. That backup should be used and tested regularly. Consider this a lesson learned, perhaps. Good luck in the future.

  • I can't get into my Apple TV show because they said I had the wrong ID - Password. So I changed it through ITunes, i still can't get on to Apple tv

    Help????
    I can't get into my Apple TV shows because they said I have the wrong ID/Password. So I went to ITunes like they told me to and changed it all. I still can't get into Apple TV. Any suggestions???

    If you've not done so unpower and restart it after 30 secs or so.
    `You will presumably have checked all your credentials and password are correct.
    If still playing up I'd probably go to Settings menu and reset everything - you'd need to then enter all ID credentials etc again.
    If that still failed I'd factory restore via iTunes with a microUSB cable.
    AC

  • TS4268 Ever since I uploaded i0s7 I haven't been able to receive I messages or face time. I have took it to the apple store and they couldn't figure it out. I have also followed the trouble shooting from I tunes and still can't get it working

    Ever since I uploaded i0s7 I haven't been able to receive I messages or face time. I have took it to the apple store and they couldn't figure it out. I have also followed the trouble shooting from I tunes and still can't get it working

    Hi,
    Strikes -
    Go into compositionReady and have 3 variables you will be able to set them like this
    strike1 = 0;
    strike2 = 0;
    strike3 = 0;
    So on the wrong item click have
    if(strike1 == 0) {
    PLAY STRIKE1 ANIMATION
    strike1 = 1;
    else if(strike2 == 0) {
    PLAY STRIKE2 ANIMATION
    strike2 = 1;
    else if(strike3 == 0) {
    PLAY STRIKE2 ANIMATION
    strike3 = 1;
    So this will make it so when the wrong item is clicked each strike will be played in order.
    Random Scrolling -
    You should look into the Math.Random function to make things random in edge.
    This is an example of the Random function. It will generate a random number up to 100.
    var random = Math.floor (Math.random () * 100);
    Lose Screen Score -
    So we can create another variable in compositionReady for the lose score.
    score = 0;
    Now when the user gains a point to add to the score you could do this code on the click
    score++;
    which would add 1 to the score, However you can add however much you like to the score doing "score + 2" and so on.
    To edit a text with the score at the end which I'm assuming you will want to do you will use .html
    so $("Text").html("You score is " + score);
    I hope this helps!

  • How can I get the HTML codes in illustrator?

    Hi, I am a graphic designer, and I am getting into the web world, I wanna know how can I get the HTML codes to upload a web design made using Illustrator,...¡?Does any one know?Please let me know...

    everyone here is right, dreamweaver is better and you will need to understand html for this to work. HOWEVER, you can make a functional website using just illustrator and notepad (or text edit if you're on a mac).
    Design your site in illy, slice it up with the slice tool. http://s23.postimg.org/mv311kpp7/test_illy.jpg 
    Save for web and select html and images, you'll get an html file and an images folder. Open the HTML file in your text editing program and it will look like this: http://s10.postimg.org/f32nf6r2h/html_stuff.jpg   you'll have to know HTML codes but you can find tutorials online for most stuff, you'll just have to figure it out. In my fake site, i linked a button to google so i had to add <a href> tags to the code. http://s22.postimg.org/5avpadhch/a_href.jpg  save the html file and open it in your web browser, hopefully not IE. You can't tell in the picture but the middle button actually does link to google. http://s21.postimg.org/qd77slqmf/firefox.jpg

  • How can I get my materials back into EBP 5.5?

    I have executed an initial replication of a single material into a clean EBP 5.5 (SRM 5.0) , i.e. no product master has ever existed
    After changing MATERIAL filters in R3AC1 and afterwards replicating using R3AS I managed to get more materials into the EBP 5.5 but found out that my filter settings had to be changed. So i deleted all product master (COM_PRODUCT_DELETE_ALL) succesfully changed my filter and ran R3AS but no materials was replicated... I have checked SMQ1 and SMQ2 which were empty. I have even tried to go back to the starting point of replicating just the one material and still no luck (even synchronized filter with R/3). I have gone through a number of notes. I have gone into SMWP and there are some red lights but e.g. 'Adapter Status Information' and 'System Settings' looks fine.
    How can I get my materials back into EBP 5.5? Is it a problem of changing filters and doing intial replications continuosly?
    While writing the above I have just now created a new material in ECC 6.0 and set up the filter to replicate just this new material and it was succesfully replicated to EBP 5.5 with product master! I guess something has to be cleaned up before I can get my materials back into EBP 5.5??? How???

    I managed to replicate all my materials with the broad range filter definition after working my way through all the errors in SMW01. However, I still don't understand why I couldn't make an initial replication of a single material (previously deleted)... anyway it is working now
    Thanks for all the help!

  • Hello, all of a sudden without apparent reason I can't get "MAIL" to function. It starts up but I get the color wheel turning like crazy and never ends. I've tried restarting and I still can't get it to work. PLEASE HEEELP!?

    hello, all of a sudden without apparent reason I can't get "MAIL" to function. It starts up but I get the color wheel turning like crazy and never ends. I've tried restarting and I still can't get it to work. PLEASE HEEELP!?

    In the Desktop Manager > Sync > Configuration, make sure the calendar options are set to override Outlook.
    Set it also to notify you of the changes, so you will have to approve any changes.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Read the manual; still can't get it right

    i've followed instructions on setting path and classpath, but still can't get the HelloWorldApp to work right. it makes the .class file fine but the java HelloWorldApp command gives this to stdout
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp
    maybe i have the classpath set wrong..currently it's set to C:\jdk1.3.1_01\bin\;"." is it supposed to be somewhere else? well when i use codewarrior it all works fine but i only have a trial version of it and would like to do the command line thing 1) because it's free and 2) because i like typing the commands ...also i have the exact same problem to overcome on my linux box..same error message as above.
    any help is greatly appreciated..
    TheFueley
    [email protected]

    Hello Fueley,
    I can see that you are running JDK 1.3.1_01 on a Windows OS of some kind. On different Windows OS you have a a different place to set CLASSPATH environment variable. For instance, in Windows/95 you can set CLASSPATH environment variable in the autoexec.bat file. While in Windows/NT you set CLASSPATH environment variable in the Environment tab of the System Properties of the Control Panel.
    First clear your classpath by typing in a DOS window:
    C:> set CLASSPATH=
    Then point your classpath to the current directory. The current directory is indicated by a period. The quotation marks are not needed.
    To set your classpath, type in a DOS window:
    C:> set CLASSPATH=.
    If you want to, you can add other paths your classpath, for example, the dt.jar and tools.jar
    C:> set CLASSPATH=.;C:\jdk1.3.1_01\lib\dt.jar;C:\jdk1.3.1_01\lib\tools.jar
    See http://java.sun.com/j2se/1.3/install-windows.html#Classpath for more information.
    -Merwyn,
    Developer Technical Support,
    http://www.sun.com/developers/support.

  • Purchased Lion, installed it - once I log in - i get the curtain and message to hold the power button till it shuts down.  Worked with the disk repair utility - fixed permissions - still can't get past the "black curtain of death"  any suggestions?

    purchased Lion, installed it - once I log in - i get the curtain and message to hold the power button till it shuts down.  Worked with the disk repair utility - fixed permissions  to hold the power button till it shuts down.  Worked with the disk repair utility - fixed permissions - still can't get past the "black curtain of death"  any suggestions?
    My machine was patched to date 10.x.x.  I was lucky to get an internet connection and I selected the option to re-download Lion... its curruently being downloaded.  What if that doesn't work?
    Any thougths would be appreciated.
    Joe

    And you have a workstation? not a notebook. 
    Usually a driver or hardware, nothing that Disk utility will fix.
    You know of course what a Prohititory Sign is?
    prohibitory sign, kernel panic
    Forum devoted to Lion:
    Mac OS X v10.7 Lion Communities
    Tips and FAQs
    FAQ kernelpanic
    Resolving Kernel Panics
    Avoiding eliminating Kernel panics
    Lion App Compatibility Table - RoaringApps
    RoaringApps Mac OS X Lion Application Compatibility
    did you make sure your apps, drivers, and hardware support Lion?

  • Still can't get airplay to work!!!!!

    Grrrrrrrrr. Still can't get airplay to work with either my iPad or my iPhone to my atv2. Everything has the latest firmware, including my airport extreme. Airplay is turned on in options on the atv2.
    Everything is on the same network. I even switched networks but still nothing.
    I do not see the blue icon that let's me stream to the tv.
    What the heck am I doing wrong?

    Hi,
    Your profile indicates you are running v10.5.7. If that's the case, you need to update your system software to v10.5.8 which is the minimum requirement for the iPad.
    Click the Apple () menu then click: Software Update...
    And make sure Bluetooth is not enabled on either the iPad or the iPhone. Tapping Settings / General / Bluetooth.
    Carolyn

Maybe you are looking for