1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Fed [463]
3 years ago
15

In Python please:

Computers and Technology
1 answer:
Sauron [17]3 years ago
4 0

Answer:

import math

angle = float(input('Enter Angle: '))

shadowLength = float5(input('Enter Shadow Length: '))

tree_height = math.tan(angle)*shadowLength

print('Tree Height = {}'.format(tree_height))

Explanation:

From the equation given, the first step is to derive the equation for calculating the Tree Height.

tan(angleElevation) = tree height / shadow length\\\\tree height = tan(angleElevation) * shadow length

In order to calculate the tangent of an angle, the math module has to be imported. math module allows the program to perform advanced math operations.

The program then prompts the user to input values for angle and shadow length.

The inputted values are converted to floats and used in the equation that was derived for Tree height.

Three height is evaluated and the result is printed to the screen

You might be interested in
We will use linear interpolation in a C program to estimate the population of NJ between the years of the census, which takes pl
nikklg [1K]

Answer:

See explaination for program code

Explanation:

program code below:

#include<stdio.h>

int main()

{

//file pointer to read from the file

FILE *fptr;

//array to store the years

int years[50];

//array to store the population

float population[50];

int n = 0, j;

//variables for the linear interpolation formula

float x0,y0,x1,y1,xp,yp;

//opening the file

fptr = fopen("njpopulation.dat", "r");

if (fptr != NULL)

{

//reading data for the file

while(fscanf(fptr, "%d %f", &years[n], &population[n]) == 2)

n++;

//prompting the user

int year = -1;

printf("Enter the years for which the population is to be estimated. Enter 0 to stop.\n\n");

while(year != 0)

{

printf("Enter the year (1790 - 2010) : ");

scanf("%d", &year);

if (year >= 1790 && year <= 2010)

{

//calculating the estimation

xp = year;

for (j = 0; j < n; j++)

{

if (year == years[j])

{

//if the year is already in the table no nedd for calculation

yp = population[j];

}

else if (j != n - 1)

{

//finding the surrounding census years

if (year > years[j] && year < years[j + 1])

{

//point one

x0 = years[j];

y0 = population[j];

//point two

x1 = years[j + 1];

y1 = population[j + 1];

//interpolation formula

yp = y0 + ((y1-y0)/(x1-x0)) * (xp - x0);

}

}

}

printf("\nEstimated population for year %d : %.2f\n\n", year, yp);

}

else if (year != 0)

{

printf("\nInvalid chioce!!\n\n");

}

}

printf("\nAborting!!");

}

else

{

printf("File cannot be opened!!");

}

close(fptr);

return 0;

}

OUTPUT :

Enter the years for which the population is to be estimated. Enter 0 to stop.

Enter the year (1790 - 2010) : 1790

Estimated population for year 1790 : 184139.00

Enter the year (1790 - 2010) : 1855

Estimated population for year 1855 : 580795.00

Enter the year (1790 - 2010) : 2010

Estimated population for year 2010 : 8791894.00

Enter the year (1790 - 2010) : 4545

Invalid chioce!!

Enter the year (1790 - 2010) : 1992

Estimated population for year 1992 : 7867020.50

Enter the year (1790 - 2010) : 0

Aborting!!

5 0
4 years ago
You tried to access an external html page, which can not be opened on the device for preview. open the page in dreamweaver to pr
Snowcat [4.5K]
<span>You tried to access an external html page, which can not be opened on the device for preview. open the page in dreamweaver to preview the page on the device. </span><span>Real-Time Preview is a new feature in this version.  The developers didn't offer an option to turn it off in Preferences.  So, the best thing to do is to Right-Click on your document tab (or a file in your Files Panel) and select Open in Browser.  Then, choose your preferred browser. As a reminder, don't use F12.</span>
4 0
4 years ago
Ou have an application running on Oracle Cloud Infrastructure. You identified that the read and write operations are slowing you
Otrada [13]

Answer:

Options A and C.

Explanation:

In Oracle Cloud Infrastructure the two options which allows you to increase disk performance are;

1. Terminate the compute instance preserving the boot volume. Create a new compute instance using a VM Dense IO shape using the boot volume preserved.

2. Create a backup of the boot volume. Create a new compute instance a VM Dense IO shape and restore the backup.

3 0
3 years ago
LAN security policies center on issues concerning connectivity; this includes determining how devices adhere to the network. Amo
ANTONII [103]

Answer:

<h2> Controlled maintenance and  configuration change control.</h2>

Explanation:

Among the types of LAN control standards are <em><u>controlled maintenance,  </u></em>which creates the schedules on LAN- attached devices for scheduled preventtative and consisten maintenance, and  <em><u>configuration change control.</u></em>

4 0
4 years ago
How do you select from the insertion point to the beginning of the current line?
Neko [114]

Answer:

Press the Shift key, then press the Home key.

Explanation:

This is because Home key take you to a beginning of a line and shift selects.

Have a nice day!

Please mark as brainiest if this helped you! :)

4 0
3 years ago
Other questions:
  • What’s a sign you should talk to an adult about your online time
    14·2 answers
  • A(n _______________ is a pre-written formula that is built into excel
    12·1 answer
  • Write a C function (NOT A COMPLETE PROGRAM)which takes three parameters which are the cost for an item in a grocery store, the q
    12·1 answer
  • Joining strings together is known as?
    7·1 answer
  • Who designed analatic engine in the 1930's?​
    10·1 answer
  • Why do filmmakers release trailers?
    5·2 answers
  • What is the purpose of the green flag in the Scratch interface?
    8·2 answers
  • Create another method: getFactorial(int num) that calculates a Product of same numbers, that Sum does for summing them up. (1,2,
    7·1 answer
  • Which one of these is NOT an indicator that an email is spam?
    5·1 answer
  • Please help
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!