Files
php-question/Question08-Function/Ex05.php
2026-10-06 12:10:09 +09:00

24 lines
672 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/* TODO:
* 以下の仕様で関数を作成してください
*
* 関数名 :quadrangle
* 引数 :width, height
*
* 引数で渡された横の長さ(width)と縦の長さ(height)から、四角形の面積を返す関数
*/
/* TODO:
* 以下の仕様で関数を作成してください
*
* 関数名 :triangle
* 引数 :width, height
*
* 引数で渡された横の長さ(width)と縦の長さ(height)から、三角形の面積を返す関数
*/
// TODO:
// 変数choiceの中が、1であれば四角形の面積を算出するメソッドを、2であれば三角形の面積を算出するメソッドを呼び出してください