Write a web-based application that allows a customer to


LAB : algorithm creation exercises

Objectives

In this lab assignment, students will learn:

- How to design algorithms for computer programs

- How to design steps for getting user input

- How to design steps for processing

- How to design steps for displaying output

Goals

In this lab assignment, students will demonstrate the abilities to:

- Design algorithms for computer programs

- Design steps for getting user input

- Design steps for processing

- Design steps for displaying output

Instruction and Exercises

Note: Read and understand the following. Then, you will be able to do the Exercises 1 and 2 by writing out the similar programming algorithms.

Here is an instructional example.

Develop the algorithms for paintEstimate.html and paintEstimate.php based on the following requirement:

Write a Web-based application for the King Painting company. The page provided by paintEstimate.html should ask the user for the length, width and height of a room. These inputs will be submitted to paintEstimate.php for processing.

This program will use these inputs to perform a series of calculations:

the area of each of the two long walls,

the area of each of the two wide walls,

the area of the ceiling,

the total area of the ceiling and the four walls combined.

The program should then calculate the cost of paint, cost of labor, and the total cost, based on the following charges:

a gallon of paint costs $17.00 and covers 400 square feet;

labor costs 25.00 an hour and it takes 1 hour to paint every 200 square feet.

The program should output the length, width, height, and total area of the room, followed by the paint cost, labor cost, and the total cost.

For example if the user inputs 20, 15, and 8 for the length, width, and height, the area of each of the two long walls will be 20*8 = 160, the area of each of the two wide walls will be 15* 8 = 120. The area of the ceiling will be 20* 15 = 200. The area of the four walls and ceiling combined will be 160 + 160 + 120 + 120 + 200 = 860.

The coverage will be 860/400 = 2.15, and the paint cost will be 2.15 * 17.00 = 36.55. the labor will be 860/200 = 4.3 hours, and the labor cost will be 4.3 * 25.00 = 107.50. The total cost will be 36.55 + 107.50 = 144.05.

Here is the answer to submit algorithm programming logic. It should be like this:

paintEstimate.html algorithm:

Prompt for length

Get length

Prompt for width

Get width

Prompt for height

Get height

Submit length, width,height to paintEstimate.php

END

paintEstimate.php algorithm:

Receive length, width, height from paintEstimate.html

areaLongWall = length * height

areaWideWall = width * height

ceilingArea = length * width

totalArea = (2 * areaLongWall) + (2 * areaWideWall) + ceilingArea

paintCost = totalArea / 400 * 17.00

laborCost = totalArea / 200 * 25.00

totalCost = paintCost + laborCost

Display length, width, height, totalArea, paintCost, laborCost, totalCost

END

Student should follow the algorithm coding format as above. And do the following two exercises. Save the coding work into Lab03.txt and submit the file via BlackBoard.

Exercise 1

Write a Web-based application that allows a customer to order any number of copies of your amazing SaveTheWorld software. The page provided by softwareOrder.html should ask the user for the number of copies and the required operating system. These inputs will be submitted to software - Order.php for processing.

The program should calculate

the subtotal for the order (each copy sells for 35.00);

a 7% tax (which is 0.07 times the subtotal);

the shipping the handling charge, which is 1.25 for each copy;

the total cost (the subtotal pus the shipping/handling charge plus the tax).

The program should display

the operating system,

the number of copies ordered,

the sub-total,

the tax,

the shipping/handling and the total cost.

For example if the user inputs 5 copies, the subtotal will be 5*35.00 = 175.00, the tax will be 12.25, the shipping/handling will be 6.25, and the total cost will be 193.50.

Exercise 2

Write a Web-based application that processes a ticket request for a performance. The page provided by event.html should ask the user for a name, phone number, and number of tickets. These inputs will be submitted to event.php for processing.

This program should calculate the cost off the tickets ($35.00 each). For example if the user requires 10 tickets the cost will be 10* 35, which is 350.

The program should display the name, phone number, number of tickets, and cost of the tickets.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a web-based application that allows a customer to
Reference No:- TGS02889251

Expected delivery within 24 Hours