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
Tatiana [17]
3 years ago
11

Write a program that calls a function to change a variable value from miles to kilometers.

Computers and Technology
1 answer:
Aneli [31]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

void miles_to_km(float &miles)//function to convert miles to kilo meters.

{

   miles=miles*1.6;

}

int main() {

   float miles;

   cout<<"Enter the miles"<<endl;

   cin>>miles;//taking input of the miles..

  miles_to_km(miles);//calling function that converts miles to km..

   cout<<"The number of km is "<<miles<<endl;//printing the km.

return 0;

}

Output:-

Enter the miles

54

The number of km is 86.4

Explanation:

I have created  a function miles_to_km of type void which has the argument miles passed by reference.In the function the variable miles is converted to kilo meters.Then in the main function the function is called with the value prompted from the user.Then printing the changed value.

You might be interested in
Which of the following is the best name for a history report about world war 1
kolezko [41]

Answer: "World War-1: The War that Changed the Nation"

8 0
3 years ago
What network setting do i need for a workgroup?
juin [17]
Joining a workgroup requires setting up the PC with a workgroup name.
5 0
3 years ago
The Go To feature can be accessed from which of the following dialog boxes?
Aliun [14]

Answer:

hoose the answer.

•Font

•Open

•Insert Hyperlink

Explanation:

4 0
3 years ago
Place the optical discs in the increasing order of storage capacity.<br><br> UDO<br> CD<br> DVD
romanna [79]
<h2>Hello!</h2>

The answer is:

  1. CD
  2. DVD
  3. UDO
<h2>Why?</h2>

Optical disks are circular disks used as storage for binary data usually made of polycarbonate. The data is stored in the disc using a laser machine and accessed using a laser diode illuminating the data path in an optical disc drive.

CD: Compact Discs are the most basic optical disk used today, with only a capacity that goes from 0.7 GB (700 MB) to 0.84 GB (840 MB).

DVD: Digital Versatile Discs increase the storage up to 6 times compared with a CD, the capacity of DVDs optical disks goes from 4.7 GB (4700 MB) to about 17 GB(17000 MB).

UDO: Ultra Density Optical have high capacity storage that goes from 30 GB (30000 MB) to about 60 GB (6000 MB).

Have a nice day!

4 0
3 years ago
JAVA- If you have an int as the actual parameters, will it change to fit the parameters if it requires a double, or will the cod
ivann1987 [24]

If you have only 1 method that is not overloaded, then you will not be able to call it with inappropriate parameter types, that is, if the initial type of the parameter is int, then it will not be able to get the double, float, and other values, because of this an error will occur.

For this, method overloading is created.

Method overloading is when you create methods with the same name, but only the content and parameters of the methods are/can-be completely different.

6 0
3 years ago
Other questions:
  • Which ipv6 router message is sent via multicast with a scope of link-local with the expectation that all local routers will iden
    5·1 answer
  • Does YouTube have the potential to change academia as we know it, or is that a bit of a stretch? Explain.
    9·2 answers
  • In presentation software, what is the way that text and pictures are arranged on a page called?
    10·1 answer
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • A port is the point at which a peripheral device attaches to or communicates with a computer or mobile device. True False
    15·1 answer
  • Apps are designed by___.
    11·2 answers
  • What is the next line?
    7·1 answer
  • 4.7 Code Practice: Question 2
    7·1 answer
  • What is connected to the base unit in Desktop PC?
    14·1 answer
  • How would you use keywords and Boolean operators to help you with a web search?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!