Chapter 4 Handling the Client Request: Form Data.

Slides:



Advertisements
Similar presentations
Excel Vocabulary.
Advertisements

B - body M - mass I - index. The body mass index (BMI), or Quetelet index, is a measure for human body shape based on an individual's weight and height.
Microsoft Office XP Microsoft Excel
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a Spreadsheet?
Chapter 2 Formulas, Functions, and Formatting
Video, audio, embed, iframe, HTML Form
Mark Dixon Page 1 04 – Database Design: Forms. Mark Dixon Page 2 Session Aims & Objectives Aims –To allow easier data entry using forms Objectives, by.
Web Content Management System Website Maintenance Demonstration Introduction to Macromedia Contribute Jamie Uprichard.
Flowchart Start Input weight and height
Computing Concepts Advanced HTML: Tables and Forms.
Dreamweaver Basics In this section you will learn how to:
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Java Programming Practice.
1 Class 8. 2 Chapter Objectives Use Swing components to build the GUI for a Swing program Implement an ActionListener to handle events Add interface components.
XHTML Forms for Data Collection and Submission Chapter 5.
Daily Trivia This little girl is sick. And sad .
Chapter 9 Working with Forms. Principles of Web Design 2nd Ed. Chapter 9 2 Principles of Web Design Chapter 9 Objectives Understand how forms work Understand.
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 DESKTOP TIPS Presented by: Doug Bonebrake Senior Project Manager Global Project Office FrontRange Solutions Inc.
CO1552 Web Application Development HTML Forms. Websites can be made more interactive by providing facilities for users to provide data To get user entered.
Lesson 13: Building Web Forms Introduction to Adobe Dreamweaver CS6 Adobe Certified Associate: Web Communication using Adobe Dreamweaver CS6.
Exploring Excel 2003 Revised - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
WHAT IS BMI? BMI BODY MASS INDEX- BASED ON HEIGHT AND WEIGHT TO DETERMINE AMOUNT OF FAT AN INDIVIDUAL HAS OBESE BMI > 30.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 62 – Manipulating Data Using Methods – Day 1.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Creating a Web Site to Gather Data and Conduct Research.
Microsoft Excel Chapter 4.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
Chapter 2 An Overview of Servlet and JSP Technology.
11 Project 2 Temperature Conversion (Not graded).
How to Calculate Your Body Mass Index (BMI)
Microsoft Excel 2010 Chapter 2 Formulas, Functions, and Formatting.
UNIT 1 VOCABULARY. INSTRUCTIONS Go to Computer Icon on desktop Click PUBLIC drive Double-Click Homework Folder Double-Click MS folder Find JWARNER folder,
FAWeb Setup.
Using Microsoft® Excel This presentation is designed for Chapter 1, Section 1.2.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
2 3 4 In MCM database In Scheduler database 5.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 3 Servlet Basics. Contents A.Installing Eclipse WTP and configuring Tomcat B.Prime Number Problem C.Multiplication Table Problem.
Mark Dixon 1 07 – In-class test. Mark Dixon 2 In-class Test Date: Monday 5 th November 2012 Time: 11:05-120:55 Location: SMB109 Type: Individual 40% of.
Prepared by the Academic Faculty Members of IT. Tables Creating Tables. Merging Cells. Splitting Cells. Sorting Tables. Performing Calculations.
How fit are you? Learning Objectives: * To consider different ways of measuring fitness. * To collect measurements and calculate your own BMI. * To use.
1 An Introduction to Dreamweaver and PHP Part C: Setting Dreamweaver up to handle file transferring FTP.
Chapter 28. Copyright 2003, Paradigm Publishing Inc. CHAPTER 28 BACKNEXTEND 28-2 LINKS TO OBJECTIVES Table Calculations Table Properties Fields in a Table.
objective By the end of this lesson, you will be able to :  Identify the accurate ways to measure and record height and weight.
Using Custom Submission Questions and Questionnaires in Editorial Manager™ Created by J. Strusz (9/21/2010)
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
This screen may be skipped altogether if the user chooses a report from the server and clicks Ad Hoc or Edit or whatever. Also, the next screen would ordinarily.
JavaScript – If/Else contd
The Basics of Frequency Distribution: (Categorical Data)
How to Calculate Your Body Mass Index (BMI)
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Weightproblems by teenagers
CALCULATING A GRADE POINT AVERAGE
Chapter 4 TCP 서버/클라이언트 u-Network Design Lab 3.
Forms, cont’d.
Since 1985, obesity among U.S. adults has risen dramatically
Pivot Tables= impromptu data reports for student grade data
Chapter 7 Searching Your Products
Spreadsheets and Data Management
MIS 3200 – Unit 6.1 Moving between pages by redirecting
Obesity Trends Among U.S. Adults Between 1985 and 2010
Presentation transcript:

Chapter 4 Handling the Client Request: Form Data

Contents A.Body Mass Index Problem B.Currency Exchange Problem C.Tuition Calculation Problem D.Mark Converter Problem

A. Body Mass Index (BMI) Write a servlet page that allow users enter the weight and the height of a person and then displays his/her Body Mass Index using the following formula:

Where weight (in kilogram) and height (in meter) are real numbers representing the weight and the height of a person. The result should be rounded with one decimal place.

Solution 1. Developing the view 2. Developing the Model: BMI 3. Developing the Controller: BMI Servlet 3. Running The Application

1. Developing the view User Microsoft Front Page or Macromedia Dreamweaver to design this interface: Name: weightTextBox Name: heightTextBox Name: calculateBMIButton

Page name: bmi.html Page title: Body Mass Index Table: Row 1: Label: weight Textbox named: weightTextBox Row 2: Label: height Textbox named: heightTextBox Row 3: button named calculateBMIButton

2. Developing the Model: BMI

3. Developing the Controller: BMI Servlet Specify the action for the bmi_interface.html view:

3. Running The Application Make sure the bmi_interface.html file is in WebContent folder. Right click this file -> Run as -> Run on server.

Exercise  Upgrade the above problem to display Weight status  The following table are the definitions of BMI categories for adults used by the WHO: BMIWeight Status Below 18.5Underweight Normal Overweight 30.0 and AboveObese

B. Currency Exchange Problem Develop a web program allows users to input VND and choose either USD or EUR as well as JPY to exchange. Following table is the exchange rates from VND: CurrencyExchange Rates USD16,452 EUR25, JPY151.23

Solution 1.Developing the view 2.Developing the Model: Currency Exchange 3.Developing the Controller: Currency Exchange Servlet

1. Designing the view User Microsoft Front Page or Macromedia Dreamweaver to design this interface: Name: exchangeButton Name: vndTextBox Name: desCurrencyRadio

Page name: currency_exchange.html Page title: Currency Exchange Table: Row 1: Label: VND Textbox named vndTextBox Row 2: three radio buttons named desCurrencyRadio, values: USD, EUR, JPY Row 3: button named exchangeButton

2. Developing the Model: CurrencyExchange

3. Developing the Controller: CurrencyExchangeServlet Specify the action for the view: currency_exchange.html

C. Tuition Fee Calculation Problem Given the cost of AAS course is $120, ESL course is $75. Developing a web program calculate the tuition of a student when knows number of AAS, ESL courses and type of student. Type of student can be Normal (0% discount), 10$ discount, 20% discount or 50% discount.

Solution 1.Developing the view 2.Developing the Model: Tuition Calculation 3.Developing the Controller: Tuition Calculation Servlet

1. Developing the view Name: calculateButton Name: discountRateSelectBox Name: eslTextBox Name: aasTextBox

Page name: tuition_calculation.html Page title: Tuition Calculation Table Row 1: Label: Number of AAS course(s) Textbox named: aasTextBox Label: ($120) Row 2: Label: Number of AAS course(s) Textbox named: aasTextBox Label: ($120)

Row 2: Label: Number of ESL course(s) Textbox named: eslTextBox Label: ($75) Row 3: Label: Type of Student Select box named discountRateSelectBox Value: 0: Normal 10: 10% Discount 20: 20% Discount 50: 50% Discount Row 4: button named calculateButton

2. Developing the Model: Tuition Calculation

3. Developing the Controller: Tuition Calculation Servlet Specify the action for the tuition_calculation.html file

D. Mark Converter Problem Develop a web program to convert Mark to Grade and Point, with: Mark: from 0 to 100 Grade: mark : A 80 – 89 mark: B 70 – 79 mark: C 60 – 69 mark: D 0 – 59 mark: F

Point: mark : 4 80 – 89 mark: 3 70 – 79 mark: 2 60 – 69 mark: 1 0 – 59 mark: 0

Solution 1.Developing the view 2.Developing the Model: Mark Converter 3.Developing the Controller: Mark Converter Servlet

1. Developing the view Name: markTextBox Name: gradeCheckBox Name: pointCheckBox Name: convertButton

Page name: mark_converter.html Page Title: Mark Converter Table: Row 1 Label: Mark in percent Textbox named markTextBox Row 2: Checkbox named: gradeCheckBox, value: Grade Checkbox named: pointCheckBox, value: Point Row 3: button named convertButton

2. Developing the Model: Mark Converter

3. Developing the Controller: Mark Converter Servlet

Specify the action for the view mark_converter.html

Exercise Develop a program receive midterm (30%), final (30%) and project (40%) marks then calculate and displays the results. Which result can be: Average mark Grade: A, B, C, D, F Point: 4, 3, 2, 1, 0 Result: Average >= 60: pass Average < 60 : fail

References 1.Core Servlets And Java Server Pages, Volume 1, 2 nd Edition, Chapter 4