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
Social media first became popular due to which development?
kvv77 [185]
I think it's A because it sounds more reasonable
5 0
2 years ago
Explain different users of computer in briefly?​
goldfiish [28.3K]

Answer:

The question is invalid; there are many types of computer user. Why on earth do you think there are five?

From the top of my head.

Casual- someone at home browsing the web, reading email.

IT Consultant. Advising people.

Software developer- writing software

Secretary - manages email for a company

Academic. Writing research papers.

Monitors. Monitor a computer system.

That’s six off the top of my head. There are probably a dozen more. So why do you think there are five?

3 0
2 years ago
What software development model focuses on improving the product in small steps each time through the cycle?
VashaNatasha [74]

The software development model that focuses on improving the product in small steps each time through the cycle is the Waterfall Process model

•

The Waterfall Process model mainly focuses on going step by step to make sure the product improves sufficiently and significantly.

•

•

- Marlon Nunez

6 0
3 years ago
Read 2 more answers
Select the correct answer.
WINSTONCH [101]

i think its B) Theme

7 0
3 years ago
What are the values of the following expressions? In each line assume that,
MissTica

Answer:

double x = 2.5;

double y = -1.5;

int m = 18;

int n = 4;

string s = "Storm";

string t = "Watch";

The output of the expression "x + n*y - (x+n)*y" is "6.25".

and the output of expression "m/n + m%n" is "6".

Explanation:

for the first expression,

x + n*y - (x+n)*y ,put value of every variables in it.

=2.5+4*(-1.5)-(2.5+4)*(-1.5)

=2.5-6.0-(6.5*(-1.5)

=-3.5+9.75

=6.25

for the second expression,

m/n + m%n,  put value of every variables in it.

=18/4 +18%4

=4+2      ("/ will give quotient and % will give remainder")

=6

4 0
3 years ago
Other questions:
  • Steve is proofreading his memo and he notices that he has typed a phrase twice. Steve should _____.
    5·2 answers
  • Cleaning the keyboard is the most important part of keeping your computer running at peak performance.
    5·2 answers
  • Which of the following is an example of subjunctive verb mood?
    5·1 answer
  • Varun wants to start his own business. Suggest him at least four functions of an entrepreneur.
    8·2 answers
  • 1. What are copyright laws? (6 points)
    15·1 answer
  • What is motivation and state the two forms​
    14·1 answer
  • 10010 - 1011 binary subtraction​
    5·1 answer
  • Name any four areas where computers are used​
    15·1 answer
  • Define the terms network, LAN, WAN, and Internet.
    11·1 answer
  • What is syllabus of diploma in computer after class 10​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!