Question

With the aid of PHP online manual you will create a multidimensional array that contains the...

With the aid of PHP online manual you will create a multidimensional array that contains the measurements, in inches, for several boxes that a shipping company might use to determine the volume of a box and display the volume (length * width * depth) of each box. Save the document as BoxArray.php

Homework Answers

Answer #1

To create the array use this format-

$box = array
(
array(1,2,3),
array(4,5,6),
array(7,8,9)
);

you can also take user variables, but here i am taking array with pre-defined values.

TO find the volume u can use following concept-

for($i = 0; $i < count($box); $i++) {

    echo $box[$i][$0]*$box[$i][$1]*$box[$i][$2] . "\n";

FINAL PROGRAM-

<?php

$box = array
(
array(1,2,3),
array(4,5,6),
array(7,8,9)
);

for($i = 0; $i < count($box); $i++) {

    echo $box[$i][$0]*$box[$i][$1]*$box[$i][$2] . "\n";

?>

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Answer these questions for the case study: Purple Innovation, Inc.: The Online to Offline Marketing Challenge...
Answer these questions for the case study: Purple Innovation, Inc.: The Online to Offline Marketing Challenge (a) Delineate what marketing data analytics and metrics were used by Purple Innovation, Inc to assess the effectiveness of their marketing actions and marketing campaigns. (There are many.) Within your answer, provide the type of analytics and /or metrics and for each one, and, for each one, an example of specific dollars, numbers, percentages that were provided in the case. (Be sure to include...
After reading the following article, how would you summarize it? What conclusions can be made about...
After reading the following article, how would you summarize it? What conclusions can be made about Amazon? Case 12: Amazon.com Inc.: Retailing Giant to High-Tech Player? (Internet Companies) Overview Founded by Jeff Bezos, online giant Amazon.com, Inc. (Amazon), was incorporated in the state of Washington in July 1994, and sold its first book in July 1995. In May 1997, Amazon (AMZN) completed its initial public offering and its common stock was listed on the NASDAQ Global Select Market. Amazon quickly...
Analysis: This section should include the issue register as a bare minimum, but may include also...
Analysis: This section should include the issue register as a bare minimum, but may include also why-why diagrams, a Pareto chart, a waste table and/or value-added analysis table. Flow analysis or simulation of this case study might be possible but might require making a lot of assumptions given the provided data. The first part of the project: Introduction    Walmart has continued to retain the top position on the Fortune 500 list for a consecutive fifth year. The brand has...
1.Establishing the virtual Management: As known, managing virtual staff requires a different method or approach than...
1.Establishing the virtual Management: As known, managing virtual staff requires a different method or approach than managing local staff. Due to that reason, Golden Scent has developed a strategic plan to successfully manage its virtual staff in the USA. Identify the suitable manager. to make sure our work will proceed as we planned, Golden Scent willrecruit a virtual manager with the essential skills and knowledge required to manage virtual employees. Find the skilled people to work with. Since not everyone...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Read the attached articles about the proposed merger of Xerox and Fujifilm. Utilizing your knowledge of...
Read the attached articles about the proposed merger of Xerox and Fujifilm. Utilizing your knowledge of external and internal analysis, business and corporate strategy, and corporate governance, please discuss the following questions: 1. What is the corporate strategy behind the merger of Xerox and Fujifilm? 2. Why did Xerox agree to the merger? Is this a good deal for Xerox? Discuss the benefits and challenges they face with the merger. 3. Why did Fujifilm agree to the merger? Discuss the...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT