Answer:
height = float(input("Enter your height in m: "))
weight = float(input("Enter your weight in kg: "))
BMI = weight / (height/100)**2
print(f"You BMI is {BMI}")
Explanation:
The python code for calculating BMI is as follows -
height = float(input("Enter your height in m: "))
weight = float(input("Enter your weight in kg: "))
BMI = weight / (height/100)**2
print(f"You BMI is {BMI}")
Some conditions can also be added such as
if BMI <= 15:
print("You are underweight.")
elif BMI <= 30:
print("You are healthy.")
elif BMI <= 40:
print("You are over weight.")
Answer:
False
Explanation:
An abstract class is a class declared abstract — it may or may not include abstract techniques. It is not possible to instantiate abstract classes, but they can be sub-classed.
<u></u>
<u>Abstract method declaration</u>
abstract void moveTo(double X, double Y);
Usually the subclass offers solutions for all of the abstract techniques in its parent class when an abstract class is sub-classed. If not, however, the subclass must be declared abstract as well.
<u>Example</u>
public abstract class GraphicObject {
// declaring fields
// declaring non-abstract methods
abstract void draw();
}
Answer:
#include <iostream>
#include<cmath>
using namespace std;
int main()
{
double total = 0;
double check=1;
double ct=0;
double old=1;
while( fabs(total - old) > 0.00005 )
{
old=total;
total=total+check*4.0/(2.0*ct+1);
ct=ct+1;
check=0.0-check;
}
cout<<"Approximate value of pi is "<<total<<endl;
return 0;
}
Explanation:
- Initialize all the necessary variables.
- Run a while loop until the following condition is met.
fabs(total - old) > 0.00005
- Inside the while loop calculate the total value.
- Lastly, display the approximate value of pi.
She has the Android operating system if she’s frequently downloading mobile apps from the Amazon App Store as opposed to IOS which is the Apple operating system.