Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 4 The string variable named $department contains one of the following letters: A, B, C, or D. Employees in departments A and B are

QUESTION 4

The string variable named $department contains one of the following letters: A, B, C, or D. Employees in departments A and B are receiving a 2% raise. Employees in department C are receiving a 1.5% raise and employees in department D are receiving a 3% raise. Write the switch (case) statement to assign the correct raise value to the variable $raise based upon the value of the variable $department.

QUESTION 5

Write a while loop to display all the even integer numbers between 10 and 20 separated with a space (e.g. 10 12 14 16 18 20)

QUESTION 6

A company is selling widgets at $49.23 each. There is delivery charge of 10% per widget and $10.00 per entire order. There is also 6% state sales tax. The 'no_widgets' entry of the PHP superglobal array $_POST stores the number of widgets ordered. Write the PHP statements that assigns the no of widgets from the $_POST array to a PHP variable and then calculates and displays the number of widgets ordered, the cost of the purchase, the cost of the delivery charge, the cost of the state sales tax, and the total cost of the order. For example, if the number of widgets is 2, then you code should display:

cost of 2 widget(s) is $98.46 delivery charge is $19.85 and state sales tax is $5.91 total cost is $124.21

The sales tax should apply only to the widgets themselves, and not to the delivery charge. All displayed amounts should be rounded to the nearest cent.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions