Question
write a user interface (UI) for the program # an HTML page that takes three inputs: 1) the number of kids in your party, 2)
write a user interface (UI) for the program
# an HTML page that takes three inputs: 1) the number of kids in your party, 2) your budget for buying balloons, and 3) the price of each balloon, and shows one of these two possible messages: 1) you can buy at least one balloon per kid, or 2) you can not buy at least one balloon per kid. Basically, your program will decide based on your budget and balloon price, whether or not you can buy at least one balloon per kid.
I am writing the html coding here, I only need the user interface.
The number of kids in your party
Your budget for buying balloons
The price of each balloon
//function to check possibilities
function budgetPrice()
{
//taking number of kids
var numberOfKids=document.getElementById("txtKids").value;
//taking number of balloons
var numberOfBallons=document.getElementById("txtBallons").value;
//taking price of the ballons
var balloonsPrice=document.getElementById("txtPrice").value;
//calculating count of balloons by price
var countB=numberOfBallons/balloonsPrice;
//checking number of kids with countB
if(numberOfKids<=countB)
{
//when number of kids and bolloon count match then
document.getElementById("txtDiv").innerHTML="you can buy at least one balloon per kid";
}
else{
//when number of kids and bolloon count match then
document.getElementById("txtDiv").innerHTML="you can not buy at least one balloon per kid";
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started