HTML FILE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<form method="POST" action="http://localhost:8080/ZWebApp/calc">
Enter First Number : <input type="text" name="first">
<br><br><br>
Select Operator : <input type="radio" name="operator" value="add" selected=true>+ <input type="radio" name="operator" value="sub">- <input type="radio" name="operator" value="mul">* <input type="radio" name="operator" value="div">/ <input type="radio" name="operator" value="mod">%
<br><br><br>
Enter Second Number : <input type="text" name="second">
<br><br><br>
<input type="submit" value="Perform Operation">
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<form method="POST" action="http://localhost:8080/ZWebApp/calc">
Enter First Number : <input type="text" name="first">
<br><br><br>
Select Operator : <input type="radio" name="operator" value="add" selected=true>+ <input type="radio" name="operator" value="sub">- <input type="radio" name="operator" value="mul">* <input type="radio" name="operator" value="div">/ <input type="radio" name="operator" value="mod">%
<br><br><br>
Enter Second Number : <input type="text" name="second">
<br><br><br>
<input type="submit" value="Perform Operation">
</form>
</body>
</html>
SERVLET FILE
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Calculator extends HttpServlet
{
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
{
PrintWriter pw;
response.setContentType("text/html");
pw=response.getWriter();
int num1=Integer.parseInt(request.getParameter("first"));
int num2=Integer.parseInt(request.getParameter("second"));
String operator=request.getParameter("operator");
pw.println("<html><body>");
if (operator.equals("add"))
{
pw.println(""+num1+" + "+num2+" = "+(num1+num2));
}
else if (operator.equals("sub"))
{
pw.println(""+num1+" - "+num2+" = "+(num1-num2));
}
else if (operator.equals("mul"))
{
pw.println(""+num1+" * "+num2+" = "+(num1*num2));
}
else if (operator.equals("div"))
{
pw.println(""+num1+" / "+num2+" = "+(num1/num2));
}
else
{
pw.println(""+num1+" % "+num2+" = "+(num1%num2));
}
pw.println("</body></html>");
pw.close();
}
}
Great idea, It was valuable info and very impressed to me. I always appreciate your blog and a long time after I saw a wonderful post. Thank you...!
ReplyDeleteTOEFL Coaching in Chennai
TOEFL Training in Chennai
IELTS Coaching in Chennai
Jmeter Training in Chennai
Spoken English Classes in Chennai
Ethical Hacking Course in Chennai
TOEFL Coaching in OMR
TOEFL Coaching in Tambaram
I liked your blog.Thanks for your interest in sharing your ideas.keep doing more.
ReplyDeleteEnglish Speaking Classes in Mumbai
English Speaking Course in Mumbai
Best English Speaking Classes in Mumbai
Spoken English Classes in Mumbai
English Classes in Mumbai
Spoken English in Chennai
Spoken English Class in Chennai
Well written Blog, I really enjoy reading your blog. this info will be helpful for me. Thanks for sharing.
ReplyDeleteCloud Computing Courses in Chennai
Cloud Computing Training in Chennai
CCNA Training in Chennai
DevOps Training in Chennai
SEO Training in Chennai
Cloud Computing Courses in Porur
Cloud Computing Courses in Tambaram
Cloud Computing Courses in OMR
Such a wonderful post, Your explanation way is too good and this is very easy to understand with depth content. Kindly updating for me.
ReplyDeleteCorporate Training in Chennai
Corporate Training
Power BI Training in Chennai
Excel Training in Chennai
Linux Training in Chennai
Unix Training in Chennai
Tableau Training in Chennai
Oracle Training in Chennai
Pega Training in Chennai
Oracle DBA Training in Chennai
youtubers life apk
ReplyDeletenews whatsapp groups
ReplyDeleteReally nice post. Thank you for sharing amazing information.
ReplyDeleteJava Training in Credo Systemz/Java Training in Chennai Credo Systemz/Java Training in Chennai/Java Training in Chennai with Placements/Java Training in Velachery/Java Training in OMR/Java Training Institute in Chennai/Java Training Center in Chennai/Java Training in Chennai fees/Best Java Training in Chennai/Best Java Training in Chennai with Placements/Best Java Training Institute in Chennai/Best Java Training Institute near me/Best Java Training in Velachery/Best Java Training in OMR/Best Java Training in India/Best Online Java Training in India/Best Java Training with Placement in Chennai
Informative post indeed, I’ve being in and out reading posts regularly and I see alot of engaging people sharing things and majority of the shared information is very valuable and so, here’s my fine read.
ReplyDeleteclick here to login
click here 4th std
click here icon
click here to register
click here to apply
ReplyDeleteNice infromation
Selenium Training In Chennai
Selenium course in chennai
Selenium Training
Selenium Training institute In Chennai
Best Selenium Training in chennai
Selenium Training In Chennai
ReplyDeleteRpa Training in Chennai
Rpa Course in Chennai
Rpa training institute in Chennai
Best Rpa Course in Chennai
uipath Training in Chennai
Blue prism training in Chennai
Data Science Training In Chennai
Data Science Course In Chennai
Data Science Training institute In Chennai
Best Data Science Training In Chennai
ReplyDeletePython Training In Chennai
Python course In Chennai
Protractor Training in Chennai
jmeter training in chennai
Loadrunner training in chennai
Awesome News .
ReplyDeletemedical coding course in chennai
medical coding institute in chennai
Air Hostess Course in Chennai
cpc training in chennai
cpc certification training in chennai
medical coding institute in chennai
medical coding training center in chennai
Thanks for your interesting ideas.the information's in this blog is very much useful for me to improve my knowledge.
ReplyDeleteWeb Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery
Yes these codes are really helpful for newcomers as well as experts. They save alot of time as well.
ReplyDeleteHere is the site for recent report of the various codes and their compilations.
DeleteThanks for sharing this valuable piece of information. Keep sharing more such awesome articles in the future. Goodbye! Download FMWhatsApp APK
ReplyDelete
ReplyDeleteHave you ever tried GBWhatsapp Apk, which is the Mod version of its original server which is not available on play store but you can play it by clicking here.
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
instagram beğeni satın al
ReplyDeleteyurtdışı kargo
seo fiyatları
saç ekimi
dedektör
fantazi iç giyim
sosyal medya yönetimi
farmasi üyelik
mobil ödeme bozdurma
mmorpg
ReplyDeleteinstagram takipçi satın al
tiktok jeton hilesi
tiktok jeton hilesi
Saç ekimi antalya
referans kimliği nedir
İnstagram Takipçi Satın Al
Metin pvp
instagram takipçi satın al
PERDE MODELLERİ
ReplyDeleteMobil Onay
TÜRK TELEKOM MOBİL ÖDEME BOZDURMA
Nft nasıl alinir
Ankara Evden Eve Nakliyat
trafik sigortasi
dedektör
web sitesi kurma
aşk kitapları
Download Adobe FrameMaker 2022 Full Crack is a complete solution to create, enrich, manage and publish technical documentation.https://crackdj.com/adobe-framemaker-crack/
ReplyDelete“I love you more than anyone else in this world because you know me the best and you understand me the most…. Always stay the same.” I love you Day Wishes .
ReplyDeleteI Love You messages For Him