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
Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
solong [7]

Answer:

Windows Server operating systems are a popular choice for a network because they use wizards and setup devices as the user operating system, making it easier to set up network features work on networks that include using Windows operating systems as well as Mac OS, NetWare, or UNIX

Explanation:

Windows operating system is popular than any other operating system for certain reasons:

1. It provides GUI feature which any layman can access and learn easily

2. The compatibility that it provides makes it more popular

3. It supports most of the software program available in the market

4. The design of Windows is more comfortable when compared to other open source operating system.

Only thing is that it is not a free-ware. Licence needs to be purchased to use it.

6 0
4 years ago
Using a while loop, create an algorithm extractDigits that prints the individual digits of a positive integer.
sergiy2304 [10]

Answer:

The algorithm is as follows

1. Start

2. Declare Integer N

3. Input N

4. While N > 0:

4.1    Print(N%10)

4.2   N = N/10

5. Stop

Explanation:

This line starts the algorithm

1. Start

This declares an integer variable

2. Declare Integer N

Here, the program gets user input N

3. Input N

The while iteration begins here and it is repeated as long as N is greater than 0

4. While N > 0:

This calculates and prints N modulus 10; Modulus of 10 gets the individual digit of the input number

4.1    Print(N%10)

This remove the printed digit

4.2   N = N/10

The algorithm ends here

5. Stop

<u>Bonus:</u>

The algorithm in Python is as follows:

<em>n = 102</em>

<em>while n>0:</em>

<em>     print(int(n%10))</em>

<em>     n= int(n/10)</em>

<em>    </em>

8 0
3 years ago
What permanent magnets of a motor are replaced with more powerful ones, what effect do you think this would have on motor rotati
Marat540 [252]
When permanent magnets of a motor are replaced with more powerful ones, the motor rotation will increase. This is because there is more electricity being generated.
7 0
3 years ago
Read 2 more answers
Use the table on the right to convert from decimal to octal.
steposvetlana [31]

Answer:

the answer is

The octal value of decimal 13 is 15

Explanation:

3 0
3 years ago
Can someone help me on drawing ER and Use case diagram on following scenarios. ASAP!!! Please :(
GalinKa [24]

Answer:

The ER Diagram is in the attachment. And I an including the membership details in the use case:

Applicants: Coach will ask for iD.

if the application is not registered, coach sends to registration department.

Applicants registers-->> shows registration ID-->> goes to account section

Submits the fee->> goes to coach again-->>coach asks for fee sjip-->> On yes-->> entrance allowed else-->> sent to account section

Applicants apply for course-->>if prerequisite is met, registration allowed

else-->>registration denied

Note: If registration is allowed the applicant is sent to account section and

Also note:

First check, then registration, then course prerequisite check,then account->entrance

If registered->direct entry.

Explanation:

The answer is self explanatory.

4 0
4 years ago
Other questions:
  • Which argument forces a writer to return to and change the input before resolving a “UnicodeError”?
    10·1 answer
  • Which step of the machine cycle examines the op-code of the next instruction to be executed?
    12·2 answers
  • How to jail break iphone 7 with <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7617023602">[email&#160
    11·2 answers
  • Double[][] vals = {{1.1, 1.3, 1.5},
    14·1 answer
  • Why do i get message notifications but when i click on it it says i have no new messages?
    7·1 answer
  • In Marvel Comics, what imaginary rare metal is an important natural resource of Wakanda, the home country of Black Panther?
    15·1 answer
  • In your own words, what is pair-programming? What is the role of the driver? What is the role of the navigator? What are some be
    15·1 answer
  • Who prime minister of india​
    9·2 answers
  • music sites through schools wifi 2020 What is one thing a person should do to stay safe when exercising? 100 pts.!
    10·2 answers
  • True or false you can create a. network with 2 computers?<br>​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!