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
shepuryov [24]
3 years ago
14

Write a statement that assigns treeHeight with the height of a tree given the distance from the tree (in feet) and angle of elev

ation (in degrees).
Use the following formula: tangent of angleElevation treeHeight/ treeDistance treeHeight
Computers and Technology
1 answer:
Nina [5.8K]3 years ago
6 0

Answer:

treeHeight = tangent of angleElevation * treeDistance

In java, we could write it as:

double treeHeight = (Math.tan(angleElevation) * treeDistance);

Math.tan(angleElevation) is an inbuilt java mathematical function used to calculate the tangent of a value and the return value is always double.

Explanation:

formula:

tangent of angleElevation = treeHeight/treeDistance

We want to assign treeHeight, so we cross-multiply and we get:

treeHeight = tangent of angleElevation * treeDistance

Off course, the treeHeight will be in feet also.

You might be interested in
Write a function decimalToBinaryRecursive that converts a decimal value to binary using recursion. This function takes a single
Delicious77 [7]

Answer:

Check the explanation

Explanation:

#include <iostream>

#include <string>

using namespace std;

string decimalToBinaryRecursive(int n) {

   if(n == 0) {

       return "0";

   } else if(n == 1) {

       return "1";

   } else {

       int d = n % 2;

       string s;

       if (d == 0) {

           s = "0";

       } else {

           s = "1";

       }

       return decimalToBinaryRecursive(n/2) + s;

   }

}

int main() {

   cout << decimalToBinaryRecursive(0) << endl;

   cout << decimalToBinaryRecursive(1) << endl;

   cout << decimalToBinaryRecursive(8) << endl;

   return 0;

}

See the output image below

5 0
3 years ago
Lucky Sevens. Given a whole number, compute and display how many digits in the number are 7s. For example, the number of 7s in 3
Sveta_85 [38]

Answer:

Code is in both c++ and java

Explanation:

C++ Code

#include<iostream>  

#include <sstream>  // for string streams  

#include <string>  // for string  

using namespace std;  

int main()  

{  

   int num;  

   cout<<"Enter Non-Negative number :";

  cin>> num;

   // declaring output string stream  

   ostringstream str1;  

   // Sending a number as a stream into output  

   // string  

   str1 << num;  

   // the str() coverts number into string  

   string geek = str1.str();  

   int count =0;

  for (int i = 0; i < geek.size(); i++){

    if(geek[i]=='7'){

     count++;  

 }

}

   // Displaying the string  

   cout << "the number of 7s in "<<num<< "is"<<count;

 

   return 0;  

}

Java Code

import java.util.Scanner;

public class LuckySeven{

   public static void main(String[] args){

       Scanner scanner = new Scanner(System.in);

       System.out.print("Enter Number :");

       int number = scanner.nextInt();

       String numberString = number+"";

       int count =numberString.length()- numberString.replaceAll("7","").length();

       System.out.println("Number of 7's in "+numberString+" are "+count);

   }

}

Code Explanation

First we need to take integer number as input from user.

As we need to iterate through all of the digits in number, that's why we need to convert integer to string as string is an array of character so we will iterate through number array and match the total count of 7 on every index.

At the end we will display the total count of 7 in number.

Sample Output

Case 1

Enter Non-Negative number :3482

the number of 7s in 3482 is 0

Case 2

Enter Non-Negative number :372771

the number of 7s in 372771 is 3

6 0
3 years ago
Write the sum of products, the canonical product of sums, theminterm shorthand and the maxterm shorthand for the following:
dem82 [27]

Answer:

SOP=AB'+B'C

POS=B'(A'+C)

Shorthand Minterms=m₀+m₁+m₅

Shorthand Maxterms=M₃+M₂+M₄+M₆+M₇

Explanation:

For the full explanation of this question refer to the image attached which is of the k-Map of F.As we can see in the k-map that there are only 3 ones.by making 2 pairs of 1 we get the SOP expression.

Rest of them are zero from there we will get the POS expression.

The one's in the k-map represent the Minterms and 0's represent Maxterms and the number written in the box is their respective minterm and maxterm number.Minterms are represented by m and maxterms are represented by M.

7 0
3 years ago
3.
Viktor [21]
3. <span>for the mother to stay home to tend to the household and care for the children while the father worked to support the family

4. true (not 100% sure)</span>
5 0
3 years ago
What is the slowest shutter speed?
crimeas [40]

Answer: I think the answer would be 1/30 or 1/60

Explanation: Anything below 1/90 is considered a soft image so i would go with 1/30 Brainliest ans plz.

7 0
3 years ago
Other questions:
  • Jannette has been experiencing slow performance on her computer. Today she received an error message saying that an update to he
    12·2 answers
  • Which data type or collection of data types can SOQL statements populate or evaluate to?
    9·1 answer
  • Given the variable ip, already declared as a pointer to an integer, write the code to dynamically allocate memory for a single i
    15·1 answer
  • How should you set the OHMS ADJust control on a multitester of analog VOM, for resistance measurements?
    12·1 answer
  • Assume we are testing a variable is_sunny in a while loop. is_sunny = “n”.
    13·1 answer
  • The MAC address is a _____ bit number.
    10·2 answers
  • Compute their Cartesian product, AxB of two lists. Each list has no more than 10 numbers.
    5·1 answer
  • The profile picture that you plan to use to market your professional brand on social media networks should feature you only.
    12·1 answer
  • A photographer stores digital photographs on her computer. In this case the photographs are considered the data. Each photograph
    6·1 answer
  • I am making a project i have to advertise a product i picked a futureistic car
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!