{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-08-30T05:36:19-04:00", "answer_date": "2024-08-30 05:36:19", "is_docs_available": null, "is_excel_available": null, "is_pdf_available": null, "count_file_available": 0, "main_page": "student_question_view", "question_id": "8714686", "url": "\/study-help\/questions\/this-php-exercise-required-that-you-declare-two-functions-rarea-8714686", "question_creation_date_js": "2024-08-30T05:36:19-04:00", "question_creation_date": "Aug 30, 2024 05:36 AM", "meta_title": "[Solved] This PHP exercise required that you decla | SolutionInn", "meta_description": "Answer of - This PHP exercise required that you declare two functions rArea() and totalCost(). You are required to create two func | SolutionInn", "meta_keywords": "php,exercise,required,declare,two,functions,rarea,totalcost,create,function,will,accept", "question_title_h1": "This PHP exercise required that you declare two functions rArea() and totalCost(). You are required to create two functions. The rArea() function will accept two", "question_title": "This PHP exercise required that you declare two functions rArea() and totalCost().", "question_title_for_js_snippet": "This PHP exercise required that you declare two functions rArea() and totalCost() You are required to create two functions The rArea() function will accept two arguments and the totalCost() function will accept three arguments Each functionwill perform a calculation using the arguments and then return an integervalue That returned value will then be used a sentence that is displayed using an echo() statement The first function will calculate the area of a property based on the height and width of the property Using these two arguments being width and height (Reminder area width height ) echo out a sentencestating A room of length $length ftand width $width ft has an area of rArea($length,$width) , where area is the function return value The second part will require that you calculate the total cost of the property if the square foot of the property is defined by the variable $ftCost The calculation of the property total per square foot is total area multiplied by the cost per square foot defined by the variable $ftCost Then echo this sentence The total cost of a room of length $length ftand width $width ft area at $ $ftCost per square foot is totalCost($length,$width,$cost) where the total cost is the function returned value Cost Per Square Foot Area Function Total Property Cost Calculator", "question_description": "

This PHP exercise required that you declare two functions rArea() and totalCost(). <\/p> <\/div>

<\/p>

You are required to create two functions. The rArea() function will accept two arguments and the totalCost() function will accept three arguments. Each functionwill perform a calculation using the arguments and then return an integervalue. That returned value will then be used a sentence that is displayed using an echo() statement. <\/p> <\/div>

<\/p>

The first function will calculate the area of a property based on the height and width of the property. Using these two arguments being width and height (Reminder: area = width * height.) echo out a sentencestatingA room of length<\/b>\" .$length. \"ftand width<\/b>\" .$width. \"<\/b>fthas an area of<\/b>\" .rArea($length,$width)<\/b>, where area is the function return value. <\/p> <\/div>

<\/p>

The second part will require that you calculate the total cost of the property if the square foot of the property is defined by the variable $ftCost. The calculation of the property total per square foot is total area multiplied by the cost per square foot defined by the variable $ftCost. Then echo this sentenceThe total cost of a room<\/b>oflength .\" $length. \"ftand width<\/b>\" .$width. \"ft area at $\" . $ftCost . \"per square foot is \" . totalCost($length,$width,$cost) .<\/b>where the total cost is the function returned value. <\/p> <\/div>

<\/p>

Cost Per Square Foot Area Function<\/title> <\/head> <body> <h2>Total Property Cost Calculator<\/h2><\/p> <p dir=\"ltr\"><?php <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">$length= 20; <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">$width= 4; <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">$ftCost = 75; <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">\/\/define rArea() function \/\/ADDrArea()FUNCTION HERE <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\"> \/\/call functionrArea() echo \"A room of length \" . $length. \"ftand width \" . $width. \"fthas an area of \" . rArea($length,$width) .\".\"; <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\"> <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">\/\/define totalCost() function <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">\/\/ADD totalCost() FUNCTION HERE <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\"> <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">\/\/call function totalCost() echo \"The total cost of a room of length .\" $length. \"ftand width \" . $width. \"ft area at $\" . $ftCost . \"per square foot is \" . totalCost($length,$width,$cost) .\".\"; <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\"> <\/p> <\/div> <p dir=\"ltr\"> <\/p> <div align=\"left\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial; color:#333333;\" id=\"mobile-question-style\"> <p dir=\"ltr\">?> <\/body> <\/html> <\/p> <\/div> <p dir=\"ltr\"> <\/p>", "transcribed_text": "", "related_book": { "title": null, "isbn": null, "edition": null, "authors": null, "cover_image": null, "uri": null, "see_more_uri": "" }, "free_related_book": { "isbn": "", "uri": "", "name": "", "edition": "" }, "question_posted": "2024-08-30 05:36:19", "see_more_questions_link": "\/study-help\/questions\/computer-science-computer-network-2023-February-20", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/study-help\/psychology-2e\/selective-mutism-tends-to-emerge-in-early-childhood-and-affects-1988883", "description": "Selective mutism tends to emerge in early childhood and affects less than 1% of preschoolers and young school-age children.", "stars": 0 }, { "url": "\/wayne-casting-inc-produces-a-product-made-from-a-metal", "description": "Wayne Casting, Inc., produces a product made from a metal alloy. Wayne buys the alloy from two different suppliers, Chillicothe Metals and Ames Supply, in approximately equal amounts because of...", "stars": 3 }, { "url": "\/study-help\/questions\/create-the-following-c-code-a-1-point-declare-and-10049991", "description": "Create the following C++ Code: a. (1 point) Declare and assign values to variables i. Declare an integer variable called myInt and assign the value 15 to it. ii. Declare a pointer variable called...", "stars": 3 }, { "url": "\/study-help\/questions\/return-ivmichiit-consider-the-following-simplified-financial-statements-for-the-2614008", "description": "Return IVMICHIIT Consider the following simplified financial statements for the Wesney Corporation (assuming no income taxes): Income Statement Balance Sheet oints Sales $ Assets $ 46,900 22,700 Debt...", "stars": 3 }, { "url": "\/study-help\/questions\/define-singlesubject-design-and-identify-two-strengths-and-two-limitations-1418321", "description": "Define single-subject design and identify two strengths and two limitations. Describe and assess the study design in the provided research article. Suppose you would like to evaluate the outcomes of...", "stars": 3 }, { "url": "\/study-help\/questions\/maria-gomez-owns-and-manages-a-consulting-firm-called-accel-2032823", "description": "Maria Gomez owns and manages a consulting firm called Accel, which began operations on December 1. She asks us to assist her with some financial reporting questions. On December 31, we are provided...", "stars": 3 }, { "url": "\/study-help\/questions\/question-stimulus-in-the-text-special-note-is-made-of-1418336", "description": "Question Stimulus: In the text, special note is made of Weiss, Prifitera, and Roids study of test bias, which had an extensive sample (N = 700) representative of the U.S. population. What is The...", "stars": 3 }, { "url": "\/study-help\/questions\/name-three-things-that-you-would-do-differently-or-consider-1419898", "description": "Name three things that you would do differently or consider if you were using Individual Psychology with an 8 year old, a 12 year old, and a 15 year old. Explain why you would make these adjustments...", "stars": 3 }, { "url": "\/study-help\/questions\/what-kinds-of-physical-abilities-permit-kristy-to-play-baseball-1421206", "description": "What kinds of physical abilities permit Kristy to play baseball? How did these abilities change as she moved from preschool into middle childhood? What abilities does she probably still lack, given...", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/your-friend-vinny-would-like-to-expand-his-successful-sanibel-8714685", "next": "\/study-help\/questions\/i-need-help-in-this-problem-iguana-inc-manufactures-bamboo-8714687" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "This PHP exercise required that you declare two functions rArea() and totalCost().", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/this-php-exercise-required-that-you-declare-two-functions-rarea-8714686" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } }