Not yet able to add two integers using JSP

I have written the following code for adding two integers. Its not working. I am getting 0 as the answer intead of 30. Can somebody help me with it?
Zulfi
<%
String str1="0";
String str2="0";
int num3=0;
int num4=0;
int result=0;
%>
<FORM>
<input name="num1" type="text" value="10" size="30">
<input name="num2" type="text" value="20" size="30">
<%
str1=request.getParameter("num1");
str2=request.getParameter("num2");
if(str1==null) str1="0";
if(str2==null) str2="0";
num3 = Integer.parseInt(str1);
num4 = Integer.parseInt(str2);
result = num3+ num4;
%>
<input name="num3" type="text" value="<%= result %>">
</FORM>

<html>
<head>
<title>
Solution
</title>
</head>
<%
String str1="0";
String str2="0";
int num3=0;
int num4=0;
int result=0;
%>
<body>
<h1>
Adds two Numbers
</h1>
<form method="post">
<br><br>
<input name="num1" type="text" value="10" size="30"><br>
<input name="num2" type="text" value="20" size="30"><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
<%
str1=request.getParameter("num1");
str2=request.getParameter("num2");
if(str1==null) str1="0";
if(str2==null) str2="0";
num3 = Integer.parseInt(str1);
num4 = Integer.parseInt(str2);
result = num3+ num4;
%>
<input name="num3" type="text" value="<%= result %>">
Good Luck

Similar Messages

  • I would like to remove a short gray edge from two images. I need help in that I am not yet able to use PhotoShop. Could somebody kindly help me with this?

    I would like to remove a short gray edge from two images. I need help in that I am not yet able to use PhotoShop. Could somebody kindly help me with this?

    I doubt it Doc Maik, but I am certainly happy to learn The image is this one (and a similar one). They would be beautiful portraits if not for the "extra mouth". The grey edge that I would like to remove is the excess of (grey) mouth that is actually my horse's chin, but that in the pictures looks like a wider, looping mouth. Practically, looking at the picture, the "extra mouth" to the left. What I would love it to be able correct that to look like a normal mouth, which means that half of the protruding edge should be removed. I am not sure I was able to explain myself, but here is one of the two pictures. I thank you for you kindness in being available to advise me.

  • I have two iPads and one is connected to the internet but my other iPad was connected then was not and since then I have not been able to add my internet back onto my iPad it only says cannot connect to the server any help would be great thanks

    I have two iPads and one is connected to the internet but my other iPad was connected then was not and since then I have not been able to add my internet back onto my iPad it only says cannot connect to the server any help would be great thanks

    If you are having WiFi problems it is necessary to isolate whether the problem is with your network or your iPad. Note: Do NOT consider your network to be blameless if some other devices can connect to it.
    First, test your iPad on some other WiFi networks: a friends, Starbucks, Barnes &amp; Noble, etc.
    If it works well there then the problem is probably with your network. Try restarting your WiFi router by removing power for 30 seconds. If that does not help check for a firmware update for your router. If none exists which corrects the problem consider replacing the router.
    If your iPad does not function well on other networks it possibly has a hardware problem. You could try Settings > General > Reset > Reset Network Settings to see if that corrects the problem. If not, contact Apple Support or visit an Apple store for evaluation. They can provide a replacement if your iPad is bad.
    If you need more help please give the make, model, and version of your WiFi router and how you have it configured.

  • I am not being able to open two of my spreadsheets in my Ipad.  It starts

    I am not being able to open two of my spreadsheets in my Ipad.  It starts the process &amp; then quits.  At first it was one spreadsheet, and now it is two, and the ones I use the most.  What can be happening?  What can I do to correct?  I tried copy, the copies do not open either.

         I'm having the same issue.  Cannot export the file in any fashion, not from iOS devices, via email, or even from the iCloud web interface.  I can copy the file, but the copied file cannot be opened/exported either.  Very unhappy about this, I have a "backup" but it's a version of the file from before Apple launched iCloud.

  • Since downloading the latest ITunes update I have not been able to add photos to my IPad. Any hints??

    Since downloading the latest ITunes update I have not been able to add photos to My IPad. Any hints please!

    Yes I have tried to close it and re-open it, but still does not allow me whenever I click on the price the option to buy a single song.
    I think I am going to delete the version and install it again,,, by the way I using Mac.
    I will try to do it as sson as I am back home, where my Mac is.
    I want to thank you for your help,  and I will keep you post it if there is a solution or not.

  • Having an issue of not being able to add tracks to a project. It worked fine before, now nothing.

    Having an issue with not being able to add tracks in Garage Band projects. Tried adding from both the TRACKS menu up top, and the "+" button at the bottom of the project page. It used to work fine, now all of a sudden nothing.

    What is your GarageBAnd version?
    How many tracks do have already? There is a limit to the number of software instruments that you can add, depending on the amount of RAM you have installed.
    Tried adding from both the TRACKS menu up top, and the "+" button at the bottom of the project page. It used to work fine, now all of a sudden nothing.
    Are the buttons greyed out, or simply unresponsive?
    If the buttons and commands are unresponsive, I'd try HangTime's oddball problems fix and trash the GarageBand preferences file - move com.apple.garageband.plist from the Preferences folder in your user library to the Desktop - see the FAQ:
    http://www.bulletsandbones.com/GB/GBFAQ.html#oddballprobs
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    Regards
    Léonie

  • Where can I access a version 5 download? Version 6 is not yet compatible with an application I use for school.

    Is there a version 5 download available on the website? Version 6 is not yet compatible with an application I use for school.

    I think this link will work:
    ''moderator deleted a hyperlink to an unsupported version''
    I suggest, that while Mozilla is on a "rush to release updates faster than fixing bugs" kick, NO ONE should have "automatic updates" on. Go into "tools" and turn off that option, and NEVER agree to accept an update unless you know that things have been made compatible and that the bugs have been ironed out.
    It's also wrong of them to release NON-beta copies, automatically, which cause incompatibility, every few weeks. That should only happen every year or two.
    We need to ban together and quit installing their updates until they quit rushing them out too quickly.

  • HT1414 is it necessary to put in sim card in iphone at the time of restore ? My phone is stolen and i am concerned that if somebody will restore it then i will not be able to find it even using find my phone.

    is it necessary to put in sim card in iphone at the time of restore ? My phone is stolen and i am concerned that if somebody will restore it then i will not be able to find it even using find my phone.

    There is no way that you can locate the iphone at all.
    The thief can restore it and use it as their own.  You will never know or be able to tell what they do with it.
    Very sorry.  Your iphone is gone.
    Report it to the police and change your passwords.

  • Ever since downloading Itunes 11 I have not been able to add new cds to my library.  I keep getting a message that an error occured while converting the file.  An unknown error occured (-69).

    Ever since I downloaded Itunes 11 I have not been able to add new CDs to my library.  I keep getting this message: Error occured while converting the file "..." An uknown error occured (-69).

    Did you already try to restore your device? Restoring iPod to factory settings
    Other solutions for this errror are mentioned here: iTunes: Error 13019 during sync

  • HT4623 When is apple going to fix the problem of not been able to add and merge call. This seems to be a major software glitch that requires serious attention.

    When is apple going to fix the problem of not been able to add and merge call. This seems to be a major software glitch that requires serious attention.

    Who is your carrier? That feature is completely carrier dependent.

  • Can it be possible to add "Admin" -- not be able to add another "Admin"

    I have the following requirement:
         Create the following Groups:
              Admin:
                   all the users in this group, should have complete access to application +
                   manage users
                   But should not be able to add another Admin
              Staff:
                   all the users in this group, should have complete access to application
                   Can't manage users
                   Can't create another Admins
              Editor:
                   all the users in this group, should have partial access to certain pages
              SuperUser:
                   Same as Admin role except
                   He should also be able to add "Admin" user
    Question:
    Can it be possible to add "Admin" ---&gt; who should not be able to add another "Admin"

    Hi,I have the same requirement,and I need another function,I want only one user who can create user,but he can't develop application.how can i do ?
    thank you first
    lixinzhu
    2006/05/17

  • Hi can anyone explain me how to  syncronize two database using jsp?

    Hi can anyone explain me how to syncronize two database using jsp?

    I thinking than you really need the jsp page for calling the java methods whith sincronize the database.You think wrong.
    You wrote a bad question.What was bad about it?
    You need a java method for sincronize the two databases using a jsp page.No you don't, see my answer.

  • How to code the function of  add+delete+edit using jsp??

    how to code the function of add+delete+edit using jsp??i'm also using the ms sql server 2000 as a database. pls help me!!

    Hi,
    I think you will find the following useful.
    Performing Inserts, Updates, and Deletes
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html

  • Extracting music from older (not iCloud compatible) iPod- old PC was damaged & I want to be able to add/ remove songs using my new PC (can't unload software properly- PC damaged beyond repair).

    I have an old iPod that was associated with a PC that has been destroyed (I didn't unload iTunes from it before it was damaged).  I know that if I plug the iPod into my new PC, it will erase all of my old material. 
    Is there a way to extract the material from my old iPod, load it onto my new PC, and be able to manage my music & keep it on my iPod? 
    I have an iPhone, but do not want to load all of the music onto that; my iPod (though older) still works perfectly fine.  I just need to be able to add/ remove songs, etc. 
    Thanks in advance.

    I have an old iPod that was associated with a PC that has been destroyed (I didn't unload iTunes from it before it was damaged).  I know that if I plug the iPod into my new PC, it will erase all of my old material. 
    Is there a way to extract the material from my old iPod, load it onto my new PC, and be able to manage my music & keep it on my iPod? 
    I have an iPhone, but do not want to load all of the music onto that; my iPod (though older) still works perfectly fine.  I just need to be able to add/ remove songs, etc. 
    Thanks in advance.

  • For what reasons would you not be able to add chapter markers to a project?

    New to this...I will try to give you the detail you need to answer without giving you a long story. I am actually asking this question because I have a video production company working on my wedding video..they are using iDVD to burn but I am not sure if they are using iMovie to compose or some other software. Anyways, this is actually the second time around with my video. They produced it 18 months ago and it looked beautiful! The only problem was that we realized 10 months later that there was an audio problem with the wedding ceremony. In the meantime, the person who originally worked on the project left with the software and the equipment. So, they had to start over and have been working on the redo since February and I think I am the iDVD "test rat". They are telling me now that it is not possible to add chapter markers to the project in iDVD. And this is part of the e-mail they sent me with a supposed explanation:
    +I took your corrected DVD to the Apple Store and the training expert explained to me that this program only shows each chapter at a time and the program will automatically go back to the menu after each chapter+.
    From what I have been reading on the discussion boards, the only reason that adding chapter markers would not be possible is that they are using iDVD '08 (since they purchased the software in February, I don't think this is possible) or that they did not use the original wedding tape to create the new DVD project..they used the already broken down video segments from the 1st DVD and just put them in menu folders??? Any help or explanation would be GREATLY appreciated! If there is any additional information you might need, I will do my best to provide it.
    THANKS!!!

    Hi cooperjb,
    Welcome to apple discussions. iDvd is consumer authoring software. DVDSP on the other hand is part of FCS 2 / apple's top of the line / professional DVD authoring software. There are some significant (huge) differences between the two apps which I won't go into great details here since I could likely fill a text book on this very subject. Instead you can search this forum/s for a few prior posts as well as apple's knowledge base (KB) for further details on exactly why pros prefer to use Apple's FCS 2 as opposed to the i-Apps.
    As much as one may want iDvd to act and perform exactly like Professional Software, It is not. It's intended for consumers (and prosumers).
    On a less serious note, this one's always good for a laugh:
    http://www.youtube.com/watch?v=4-94JhLEiN0&feature=fvw#watch-main-area
    Message was edited by: SDMacuser

Maybe you are looking for

  • How can I copy JPG files to a Windows XE system?

    I have a folder of JPG files on my MBP running OS X 10.7.5. I copied the folder to a thumb drive formatted with the FAT(32) file system. The JPG files display fine from the thumb drive but when I insert it in a Windows XE system windows sees each JPG

  • Cleanly "Starting Over" with the Desktop Software (non-BES)

    Hi there, With the advances in the RIM Desktop Software, there have been many posts about the upgrade process resulting in less than functional situations. The process I recommend is to cleanly start completely over, cleaning all remnants of the Desk

  • Imlementing synchronized access to shared objects in LabVIEW OOP

    Many objects in object-oriented programming have an identity, such as a file, a front-panel object or a hardware device. These objects cannot be modelled using present LabVOOP (LabVIEW Object Oriented Programming) objects as LabVOOP objects gets copi

  • Using Terminal in Mac OSX to program and test java

    I bought a book on java and it says I should not use a JDK like Net Beans when first learning java. Right or wrong I would like to know how to use terminal to program and compile simple scripts. So my question is: How do you go about setting up the c

  • WebCenter Content | Batch Loader

    Hi All, We have to checkin 1 million (approx) scanned document in WebCenter Content 11g. We are planning to use WebCenter Content Batch Loader feature for this. Is there any limitation with Batch Loader in terms of volume, performance. Also is there