Learning Objectives

  • Learn how and practice developing a simple Dynamic Web Application using the MVC pattern

Overall Objective of Part 1:

For this part of the assignment you will complete the design, write the code and test and debug a dynamic web application using the MVC design pattern. This application will calculate the amount of material and cost for a concrete slab project.

Program Background:

DIY vendors (like Home Depot or Lowes) like to provide easy tools so that their customers can determine the right amount of material that they need for their home improvement projects. For example, a homeowner who wishes to lay down a concrete slab will need to determine how many bags of concrete that they need to build a concrete slab.

For this assignment, you will create a simple calculator that will help customers calculate the number of concrete bags they need for a concrete slab project and an estimated cost.

1. Inputs: slab width in feet, slab length in feet, slab thickness in inches. One of three concrete bag sizes: 80 lb., 60 lb., and 50 lb.

2. Outputs: cubic yards of cement in the slab, the number of bags needed, the estimated cost of the bags of concrete mix.

3. Cubic yards = width in yards x length in yards x thickness in yards. Note: your formula should include the appropriate conversions for input units in order for the output to be in cubic yards.

4. The number of bags and estimated costs should be calculated using the following data on the following:

Bag Size Cu. Yds. per Bag Cost per Bag
80 lbs. 0.022 $3.75
60 lbs. 0.0167 $2.83
50 lbs. 0.0138 $2.45

Thinking Before Programming:

Before you start coding your application using Eclipse, do the following and include them as files in your assignment. You can place them in a folder called documentation within the webapp folder of your project.

  • Hand Calculations: Try working through the problem and make at least part of it on paper or an electronic document. You should thoroughly understand how to solve a problem yourself. Otherwise, you won't have any idea how to write the code correctly.
  • IPO Table: Make one or more IPO tables for your application. I = input, P = process, O = Output
  • Component Diagram: A component diagrams showing the main components (files) in your project and the order in which they will execute.
  • Wire Frames: Wire frame diagrams for the two views to get an idea of what you want them to look like.

Program Requirements:

Your solution must include the following requirements:

Two use cases:

  • A static use case to start the program by providing a form for user input
  • A dynamic use case to process the user input and deliver corresponding output

MVC for the dynamic use case:

  • Controller component - a servlet to receive the request and oversee the processing
  • View component - a jsp to receive create the items for sending back to the client on the response
  • Model components - one or more java classes to model the real-world objects from the scenario

Use a single, external CSS file to make your two views look nice.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.