Software companies often offer their customers the option to lease the software
ID: 3747705 • Letter: S
Question
Software companies often offer their customers the option to lease the software yearly or purchase it for a one-time fee. Also, they offer numerous add-on options such as technical support, training, and cloud back up services. Lastly, if the customers purchase 25 or more licenses, they are provided a 20% discount off the total.
Your task is to create an application that offers the user these types of options (using radio buttons and check boxes). There are set prices for each of the options:
Yearly Lease $5,000 One-Time Purchase $20,000 Technical Support $3,500 On-Site Training $2,000 Cloud Backup $300Explanation / Answer
<!--
This is html page for user interface.Save it as filename.html
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Software Licences</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<marquee><h2>Welcome to XYZ Company</h2></marquee>
<hr>
<h2>OFFER!!!</h2>
<h3>You will be given 20% off on your total price if you buy 25 or more licences</h3>
<form action="price.php" method="POST">
<h3>Enter you subscription type:</h3>
<input type="radio" name="subscription-type" value="yearly" checked> Yearly Lease<br>
<input type="radio" name="subscription-type" value="onTime"> On Time purchase<br>
<h3>Please select other services:</h3>
<input type="checkbox" name="Adons" value="technical"> Technical support<br>
<input type="checkbox" name="Adons" value="onsite" checked> On-site Training<br>
<input type="checkbox" name="Adons" value="cloud"> Cloud Backup<br>
<h3>Please enter number of services needed:</h3>
Technical support
<input type="number" name="tsnumber"><br>
On-site Training
<input type="number" name="onsitenumber"><br>
Cloud Backup
<input type="number" name="cbnumber"><br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
<!--
This is php page.Save it as price.php
NOTE: Please keep both the file in the same directory
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Price calculation</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<?php
$subscription_type =$TS=$OS=$CB="";
$x = $_POST['tsnumber'];
$y = $_POST['onsitenumber'];
$z = $_POST['cbnumber'];
$Subscription_price=0;
$Adon_price= 0 ;
$techonsite_price= 0 ;
$total_price = 0;
if($_POST['subscription-type']==yearly)
{
$Subscription_price= 5000;
}
else
{
$Subscription_price= 20000;
}
if($_POST['Adons']==technical)
{
$Adon_price= 3500 ;
}
else if($_POST['Adons']==onsite)
{
$Adon_price= 2000 ;
}
else if($_POST['Adons']==cloud)
{
$Adon_price= 300 ;
}
if($_POST['Adons']==technical && $_POST['Adons']==onsite )
{
$techonsite_price= 5500 ;
}
else if($_POST['Adons']==technical && $_POST['Adons']==cloud )
{
$techonsite_price= 3800 ;
}
else if($_POST['Adons']==onsite && $_POST['Adons']==cloud )
{
$techonsite_price= 2300 ;
}
if($_POST['tsnumber']==technical && $_POST['Adons']==onsite )
{
$techonsite_price= 5500 ;
}
if(($x +$y +$z)>=25 )
{
$total_price= ($Subscription_price + $Adon_price + $techonsite_price)*0.8 ;
}
else
{
$total_price = $Subscription_price + $Adon_price + $techonsite_price;
}
echo "Your total price is :"+$total_price;
?>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.