Write a web-based application that allows a customer

Assignment Help Computer Engineering
Reference no: EM132095794

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.

Reference no: EM132095794

Questions Cloud

How many interfaces can a subinterface extend : Under what condition is it permissible for a subclass to not implement a method from an abstract superclass?
What values the true population length of stay falls between : A sampling of 20 inpatients in Hospital X's Intensive Care Unit revealed an average length of stay of 3.5 days with a standard deviation of 0.5 days.
What is the depletion cost per ton of coal : The first year of operations in the area yielded 110,000 tons of coal. What is the depletion cost per ton of coal
Explain a weakness or vulnerability : what are the challenges and possible countermeasures, and report on it in an easy-to-understand manner. You must write a short report on ransomware
Write a web-based application that allows a customer : Write a Web-based application that allows a customer to order any number of copies of your amazing SaveTheWorld software.
Find the maximum distance the block travels up : A 0.500-kg block rests on a horizontal, frictionless surface as in Figure 5.23. The block is pressed back against a spring having a constant of k= 625 N/m.
Who should be liable for lapses in security : The FDA has recently issued guidelines for medical device security, but they are not mandatory and have no enforcement mechanism.
Calculate the horizontal and vertical forces : Two uniform sticks of length 2r each with mass m are hinged together at the end one stands on top of the other. The bottom of the lower stick is hinged.
Prepare the journal entry to record the redemption of bonds : A company retired $62 million of its 6% bonds at 105 ($65.1 million) before their scheduled maturity. Prepare journal entry to record the redemption of bonds

Reviews

Write a Review

Computer Engineering Questions & Answers

  Record the single process that is using the most memory

Record the total number of processes that are actively running. Record the single process that is using the most memory. Exploring the Activity Monitor (Screenshot and written response required).

  How css is used to create the layout for a web page

Describe in detail how JavaScript can be used for input validation on the client side. Explain in detail how CSS is used to create the layout for a web page.

  What are the purposes of the feasibility analysis

What are the purposes of the system request and the feasibility analysis? How are they used in the project selection process?

  How is the height of a red-black tree related to its size

How is the height of a red-black tree related to its size? What is the relationship between red-black trees and B-trees?

  Implement a slice method for the unordered list class

Implement a slice method for the Unordered List class. It should take two parameters, start and stop, and return a copy of the list starting at start position.

  What kind of mitigations would you recommend for protection

Why was it so much more effective than previous BotNet designs? What kind of mitigations would you recommend for protection?

  Derive the circuit diagram using delay lines

A fundamental-mode circuit with two inputs (x, and x2) and one output, z, is required. Whenever x, is 0, z is 0. The output z goes to 1 on the first 0-to-1.

  Display the global growth of smart phones

A national Digital service provider would like you to prepare a Windows application that will display the global growth of smart phones.

  Questiongenerate a complete erd in crows foot notation that

questiongenerate a complete erd in crows foot notation that be able to be implemented in relational model using the

  Scope of work for penetration test

Scope of Work for Penetration Test

  Customers of an on-line electronics

Customers of an on-line electronics store spend an average of $120 with a standard deviation of $80 and are also charged a shipping & handling fee of $5 per purchase. What is the chance that the next 100 customers will pay an average of more than ..

  Describe an algorithm that computes the product xy

Describe an algorithm that computes the product XY using Strassen's algorithm as a subroutine, i.e., use it as a black-box without modifying it.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd