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
julia-pushkina [17]
3 years ago
15

Write a program totake a depth (in kilometers) inside the earth as input data;compute

Computers and Technology
1 answer:
lions [1.4K]3 years ago
5 0

Answer:

#include<iostream>

using namespace std;

//define function to calculate the temperature in Celsius

float celsius_at_depth(float depth){

   float celsius = 10 * (depth) + 20;  //formula for calculation

   return celsius;

}

//define function to calculate the temperature in Fahrenheit

float fahrenheit(float celsius){

   float fahrenheit = 1.8 * (celsius)+ 32;//formula for calculation

   return fahrenheit;

}

//main function program start from here

int main(){

   //initialization

   float depth;

   print message

   cout<<"Please enter the depth (in kilometers): ";

   cin>>depth;

   float cel = celsius_at_depth(depth);  //Calling the function

   float feh = fahrenheit(cel);      //Calling the function

   //print the outputs

   cout<<"The Celsius temperature at depth in km: "<<cel<<endl;

   cout<<"The temperature in Fahrenheit is: "<<feh<<endl;

}

Explanation:

Create function celsius_at_depth with return type float and a parameter. This function takes the value depth from the calling function and calculate the temperature in Celsius and then returns the result to the calling function.

create the second function Fahrenheit with return type float and with one parameter. This function takes the temperature input in Celsius and convert into Fahrenheit and then return to the calling function.

Create the main function and declare the variable.

print the message for the user and store the value enter by the user by using the instruction cin.

then, calling the function and store the return outputs.

Finally, print the output.  

You might be interested in
How to print wireless from laptop to samsung printer?
Ray Of Light [21]
Connect the laptop via cable or wireless to the printer. Sometimes printers will need for you to install software (comes in a CD) before you can use it.

Hope this helps.
4 0
3 years ago
Read 2 more answers
According to which virtue do you need to secure information by limiting computer access to authorized personnel only?
stealth61 [152]

The answer is A : 256 or 2 to the 8th power different combinations.  In EBCDIC (Extended Binary Coded Decimal Interchange Code).  It is an 8-bit code allowing 256 possible combinations of textual symbols.  (2 to the 8th power = 256)

7 0
3 years ago
It is unlawful in the State of Florida for any person, ______________________, to be a passenger in the front seat of a motor ve
Komok [63]
In florida, if you're sitting in the front seat, you always need to wear a seatbelt regardless of age. So D
5 0
2 years ago
What are the planes used to allow SDN to virtualize parts of the physical network so that it can be more quickly and easily reco
deff fn [24]

Answer:

Data Plan and Control Plan is the correct answer to the following question.

Explanation:

The following answer is correct because The SDN(Software Defined Networking) are allow to use the data plan and the control plan to virtualize the parts of the physical networks that's why it configured more quickly and easily. It also helps the users to give access of the network programmability. Two is done by this network firstly, this network deliver the data and secondly, it also manages the data.

3 0
3 years ago
What is your personal definition of life? How do you appreciate life?​
kompoz [17]
The definition of life is to fulfill your purpose.To accomplish your goals and enjoy life.Appreciate the little things that happen in your life and look out for others and love unconditionally.Have a positive attitude in life.Love Yourself!
3 0
2 years ago
Other questions:
  • The front surface of the CCD is called the _________
    11·1 answer
  • The Internet shopping cart is an example of which version of the web?
    15·1 answer
  • Given: The following if statement uses an overloaded &gt; operator to determine whether the price of a Car object is more than $
    5·1 answer
  • The entirety of a packet at one layer becoming the payload section at another layer is known as
    8·2 answers
  • Literally no one helps answer my questions so this website is pointless.... : /
    11·1 answer
  • What is TSM Hamlinz’s discord
    6·2 answers
  • Examples of email use that could be considered unethical include _____.
    14·2 answers
  • Project introduction​
    14·1 answer
  • Rosa is building a website for a multimedia company. She wants to add a drop-down menu functionality to the website's main page.
    12·1 answer
  • What is the output?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!