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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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