Web application development JSP

posted by .

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>

  • Web application development JSP -

    Im not sure what wrong but i am not able to get it to run. I m getting errors in this part of the code:
    int num=Integer.parseInt(apple);
    int num2=Integer.parseInt(banana);
    int num3=Integer.parseInt(grape);
    int num4=Integer.parseInt(orange);

  • Web application development JSP -

    I would suggest that you go to a programming forum and ask for assistance there.
    I'm sure you will have more luck. Considering most helpers here are not proficient in programming.

    Good Luck!

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Social Studies

    I am doing a descriptive writting report on a famous place in Europe and I chose the Louvre Museum. I can't seem to find really any information can you help me?
  2. computer

    this isnt really a school question but i have a question about the sun java...it wouldnt load any of my games using it but whenever i deleted it and using the regular java...its working fine...it doesnt make any sense...please i hope …
  3. chemistry

    I have the chemical equation: CH4 + NH3 + O2 => HCN + H2O, I have to write a balanced equation using the lowest whole number coefficients, including the state of each compound -- HELP PLEASE http://www.daigger.com/equationsbalancer.jsp …
  4. anthropology

    I have a writing assignment due. It is anthropology class. I am writing about sport of cricket. Can you tell me what exactly does my professor want. Is it I have to observe people's/player's behavior. It is anthropology class. What, …
  5. jsp

    can you modify an attribute of the application object after it has been set?
  6. Computer Science

    Consider the following application files: /JavaCS1/src/guiprojectcity2/DisplayWindow.java import java.awt.*; import javax.swing.*; public class DisplayWindow extends JFrame{ private Container c; public DisplayWindow(){ super("Display"); …
  7. programming

    Write a program C++ that allow the shop staff to enter the customer's orders, record payments, view all the completed orders as listing of sales, print the highest and total sales made for the day from Main Menu below ################################# …
  8. Information Technology

    I am pressed for time and need this assignment done by Sunday please. The language used is Java. I have attatched both worksheets to be used in this assignment. Thank you so much. Please reread the description of the Metric Conversion …
  9. IT

    Can someone help me with this? Design an application or site that presents and explains your Implementation Plan. The site must include all sections of the plan and related content and consist of multiple web pages. Demonstrate the
  10. Computer Science/Pseudo Code Python

    Hi, I'm confused about an assignment. I'm not sure what to do and would like some help. An example: Write a program that obtains two integer numbers from the user. It will print out the sum of those numbers. Pseudo code: Prompt user …

More Similar Questions