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
Write a program that:
skad [1K]

Answer:

sucks to suck

Explanation:

4 0
3 years ago
1- Which of the following is the java keyword used to declare a class?
Vlad1618 [11]
1) a, you write class Foo { ... }
2) c, a constructor does not have a return type
3) d, every instance gets its own copy
4) b, a reference variable. Ofcourse, an instance or class variable may or may not be a reference variable.
5) c, the new keyword instantiates objects.
3 0
3 years ago
Read 2 more answers
What is the main storage location of a computer
gogolik [260]
I'm pretty sure its the hard drive, that's the main storage
8 0
3 years ago
You are responsible for performing all routine maintenance on your company's laser printers. Which of the following maintenance
Luden [163]

Answer:

B. installing the maintenance kit

Explanation:

page count keeps track of how many number of pages that have been printed since the installation of the last maintenance kit. When a new maintenance kit is installed on most Laser printers, the page count is reset because it does not automatically clears most times, hence, there's the need to clear the count manually.

4 0
3 years ago
Select the correct answer. Which sign or symbol will you use to lock cells for absolute cell reference?
worty [1.4K]

Answer:

A. ampersand

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT a fixed expense?
    6·1 answer
  • Jenny is the project manager and her company. She needs to break her current project into parts that her employees can work on.
    10·1 answer
  • May someone type this down below just like how it is shown in the picture.
    7·1 answer
  • Which type of CPU instruction performs arithmetic calculations and stores the results in memory?
    14·2 answers
  • What is the second stage of information processing cycle​
    10·2 answers
  • If the algorithm does not have instructions for unanticipated results, the computer program will
    15·1 answer
  • Which cable standard is a standard for newer digital cable, satellite, and cable modem connections?
    11·1 answer
  • Match each item with a statement below. - A popular port scanners that has the ability to use a GUI front end - Allows you to pi
    8·1 answer
  • How has technology impacted our lives and the world we live in? In your own words.
    9·1 answer
  • Most scheduling algorithms maintain a run queue, which lists processes eligible to run on a processor. On multicore systems, the
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!