Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <?php
- require "Models/quadrado.php";
- require "Helpers/req.php";
- $quadrado = new Quadrado();
- $quadrado->altura = req::pegar("altura");
- $quadrado->largura = req::pegar("largura");
- $area = $quadrado->calcular_area();
- echo $area;
- ?>
- <html lang="pt-br">
- <head>
- <meta charset="UTF-8">
- <title>Classes e Objetos</title>
- </head>
- <body>
- <h1>Área do Quadrado</h1>
- <form method="post">
- <label>Altura: </label>
- <input type="text" placeholder="Altura" name="altura"/></br>
- <label>Largura: </label>
- <input type="text" placeholder="Largura" name="largura"/></br>
- <input type="submit" value="Calcular Área"/>
- </form>
- <h2>A Área do quadrado é <?php echo $area; ?> cm</h2>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement