ICT2613 assignment two guidelines’ answers
Disclaimer: This document serves as an assignment guide and is intended to provide general
information and assistance. However, I, as the author of this document, hereby state that I am not
responsible for the marks or grades obtained by individuals who utilize this guide. The usage of this
guide does not guarantee any specific outcome or academic performance. It is advised to consult
with your instructor or follow the guidelines provided by your educational institution to ensure
accurate and satisfactory results.
Question 1
<?php
$stdin = fopen("php://stdin", "r"); //DO NOT CHANGE THIS LINE
$netPrice = fgets($stdin); //DO NOT CHANGE THIS LINE - $netPrice will store the price
//Include your lines of code to calculate VAT for the price in $netPrice
$vatRate = 15; // VAT rate in percentage
// Calculate the VAT-inclusive price
$vatAmount = ($netPrice * $vatRate) / 100;
$vatInclusive = $netPrice + $vatAmount;
echo "$vatInclusive"; //DO NOT CHANGE THIS LINE - $vatInclusive must contain VAT inclusive price
?>
Question 2
<?php
$stdin = fopen("php://stdin", "r"); //DO NOT CHANGE THIS LINE
$bmi = fgets($stdin); //DO NOT CHANGE THIS LINE, $bmi will contain the input (BMI)
//Include your code here, to convert BMI value to interpretation
if ($bmi < 18.5) {
$result = "underweight";
Disclaimer: This document serves as an assignment guide and is intended to provide general
information and assistance. However, I, as the author of this document, hereby state that I am not
responsible for the marks or grades obtained by individuals who utilize this guide. The usage of this
guide does not guarantee any specific outcome or academic performance. It is advised to consult
with your instructor or follow the guidelines provided by your educational institution to ensure
accurate and satisfactory results.
Question 1
<?php
$stdin = fopen("php://stdin", "r"); //DO NOT CHANGE THIS LINE
$netPrice = fgets($stdin); //DO NOT CHANGE THIS LINE - $netPrice will store the price
//Include your lines of code to calculate VAT for the price in $netPrice
$vatRate = 15; // VAT rate in percentage
// Calculate the VAT-inclusive price
$vatAmount = ($netPrice * $vatRate) / 100;
$vatInclusive = $netPrice + $vatAmount;
echo "$vatInclusive"; //DO NOT CHANGE THIS LINE - $vatInclusive must contain VAT inclusive price
?>
Question 2
<?php
$stdin = fopen("php://stdin", "r"); //DO NOT CHANGE THIS LINE
$bmi = fgets($stdin); //DO NOT CHANGE THIS LINE, $bmi will contain the input (BMI)
//Include your code here, to convert BMI value to interpretation
if ($bmi < 18.5) {
$result = "underweight";