count=0
def num_males(bio_data):
for i in bio_data['Sex']:
if i=='M':
count+=1
print("Number of Males=",count)
count=0
def num_females(bio_data):
for i in bio_data['Sex']:
if i=='F':
count+=1
print("Number of Females=",count)
count=0
def average_age(bio_data):
avg=round(sum(bio_data['Age'])/len(bio_data['Age']),2)
print("Average of the age given =",avg)
def average_weight(bio_data):
avg=round(sum(bio_data['Weight'])/len(bio_data['Weight']),2)
print("Average of the Weight given =",avg)
def average_height(bio_data):
avg=round(sum(bio_data['Height'])/len(bio_data['Height']),2)
print("Average of the Height given =",avg)
def bmi(bio_data):
h=[]
w=[]
bm=[]
h=bio_data['Height']
w=bio_data['Weight']
for i in range(0,len(h)):
bm.append(round( ((w[i]/h[i])*703),1))
print(bm)
+ Run C Code IMPORTANT: • Run the following code cell to create the input file,...
Please solve the following, please type out the code, and do not
hand write because its hard to read. I would greatly appreciate it.
(JAVA)
Problem 1 In a class called H1P1, write a method called bmiOne that takes as arguments a mass in kilograms (a double) and a height in meters (also a double), and returns the body mass index (or BMI) for the given data. If we have mass -m kg and height-h meters, then BMI = Write...
IT Java code In Lab 8, we are going to re-write Lab 3 and add code to validate user input. The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy level for a given height. The formula is as follows: bmi = kilograms / (meters2) where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less...
Python solutions please. correct code for Thumbs Up.
Calculate the BMI of a person using the formula: BMI = ( Weight in Pounds ((Height in inches ) x (Height in inches ))) x 703 Assign the value to the variable bmi. Assume the value of the weight in pounds has already been assigned to the variable w and the value of the height in inches has been assigned to the variable h. Assume that print_error_description is a function that expects...
1. Write a personalized BMI calculator in the form of a function called bmi_calculator(). This function prompts the user for their appelation, their first name, their last name, their height in inches, their weight in pounds, and prints a message of the form: BMI Record for _APPELATION _FIRSTNAME _LASTNAME: Subject is _X feet _Y inches tall and weighs _Z pounds. The subject's BMI is _B. (The words preceded by _ are replaced with the input provided by the user.) Your solution...
A. Write a Python script so that the user can enter any number of grades. Create a calcavg() function so that it takes the number of grades as a parameter and returns the regular average (not a weighted average). You must loop through the grades for full credit. Add a try/except block so that if a non-numeric value is entered, you get the error message shown below. You cannot use lists. Input: c. python …\IT2430\FirstLastname\assign5-2.py 96.7 95.6 87.0 d. python...
Jupyter code (PYTHON)
True error Write a function called trueError that takes the following inputs: • X, the new value • Xtrue, the previous value And returns the following output: • error, the calculated relative error The formula for the relative error is shown below: errue = 11100% In (): def trueError(x,xtrue): # YOUR CODE HERE raise Not ImplementedError() In (): # You can call and test your function here # YOUR CODE HERE raise Not ImplementedError()
Lab 1: InheritanceTest Write a program called InheritanceTest1.java to support an inheritance hierarchy for class Point–Square–Cube. Use Point as the superclass of the hierarchy. Specify the instance variables and methods for each class. The private data of Point should be the x-y coordinates, the private data of Square should be the sideLength, and the private data of Cube should be depth. Provide applicable accessor methods, mutator methods, toString() methods, area() method, and volume() method to all classes. Write a program...
According to Wikipedia , a comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. A CSV file stores tabular data (numbers and text) in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separator is the source of the name for this file format. A company has text data that is not...
I have this C program that calculates an input and converts it to a BMI calculation. Any idea how this would look as an LC3 program? I'm taking an LC3 programming class next semester and want an idea of what this code would even translate to, just trying to get a head start. I'm more so curious on how to get user input in a LC3 program, then I can try myself and figure it out from there. int main()...
FOR C++ PLEASE Create a class called "box" that has the following attributes (variables): length, width, height (in inches), weight (in pounds), address (1 line), city, state, zip code. These variables must be private. Create setter and getter functions for each of these variables. Also create two constructors for the box class, one default constructor that takes no parameters and sets everything to default values, and one which takes parameters for all of the above. Create a calcShippingPrice function that...