Friday
November 28, 2014

Homework Help: Web application development JSP

Posted by Clac7724 on Thursday, April 1, 2010 at 12:54pm.

Below is the following jsp code for a homework assignment im working on. Im allow four input text fields in which a customer can enter the amount of each fruit they want to buy, a submit button, and a reset button. After a customer placed an order, a page should be generated displaying the order information, including the fruit type, amount to buy, subtotal charge for each type of fruit, and total charge.



<HTML>
<HEAD><TITLE>Fruit Business</TITLE></HEAD>
<BODY>
<H1> Welcome to FarmersMarket</H1>
<BR>

<% String app=request.getParameter("apple");

String bana=request.getParameter("banana");

String gra=request.getParameter("grape");

String orang=request.getParameter("orange");



int num=Integer.parseInt(apple);
int num2=Integer.parseInt(banana);
int num3=Integer.parseInt(grape);
int num4=Integer.parseInt(orange);


%>

Here is your order:<br>

Apple: <%= num%> LB and Subtotal: $<%= num*1%><br>
Banana: <%= num2%> LB and Subtotal: $<%= num2*2%><br>
Grape: <%= num3%> LB and Subtotal: $<%= num3*3%><br>
Orange: <%= num4%> LB and Subtotal: $<%= num4*4%><br>

Total Due: $<%= 1*num+ 2*num2+ num3*3+ num4*4%>


<form action=order.jsp method=post>

Apple <input type=text name=apple>[$1]<br>

Banana <input type=text name=banana>[$2]<br>

Grape <input type=text name=grape>[$3]<br>

Orange <input type=text name=orange>[$4]<br>



<input type=submit>
<input type=reset>

</form>

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

jsp - can you modify an attribute of the application object after it has been ...
Information Technology - I am pressed for time and need this assignment done by ...
chemistry - I have the chemical equation: CH4 + NH3 + O2 => HCN + H2O, I have...
Social Studies - I am doing a descriptive writting report on a famous place in ...
computer - this isnt really a school question but i have a question about the ...
anthropology - I have a writing assignment due. It is anthropology class. I am ...
science - A less nutritious fish that has taken over the population of other ...
math problem - Brianna is working on her homework. Her assignment is to come up...
IT - Can someone help me with this? Design an application or site that presents ...
Computer Science - Consider the following application files: /JavaCS1/src/...

Search
Members