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
Sholpan [36]
4 years ago
7

Description:

Computers and Technology
1 answer:
Nastasia [14]4 years ago
8 0

Answer:

The programming language is not stated (I'll answer using C++)

#include <iostream>

using namespace std;

int convert(float miles)

{

   return miles * 5280;

}

int main() {

   cout<<"Console:"<<endl;

   cout<<"Hike Calculator"<<endl;

   float miles;

   char response;

   cout<<"How many miles did you walk?. ";

   cin>>miles;

   cout<<"You walked "<<convert(miles)<<" feet"<<endl;

   cout<<"Continue? (y/n): ";

   cin>>response;

   while(response == 'y')

   {

   cout<<"How many miles did you walk?. ";

   cin>>miles;

   cout<<"You walked "<<convert(miles)<<" feet"<<endl;

   cout<<"Continue? (y/n): ";

   cin>>response;

   }

   cout<<"Bye!";

   return 0;

}

Explanation:

Here, I'll explain some difficult lines (one after the other)

The italicized represents the function that returns the number of feet

<em>int convert(float miles) </em>

<em>{ </em>

<em>    return miles * 5280; </em>

<em>} </em>

The main method starts here

int main() {

The next two lines gives an info about the program

   cout<<"Console:"<<endl;

   cout<<"Hike Calculator"<<endl;

   float miles;

   char response;

This line prompts user for number of miles

   cout<<"How many miles did you walk?. ";

   cin>>miles;

This line calls the function that converts miles to feet and prints the feet equivalent of miles

   cout<<"You walked "<<convert(miles)<<" feet"<<endl;

This line prompts user for another conversion

   cout<<"Continue? (y/n): ";

   cin>>response;

This is an iteration that repeats its execution as long as user continue input y as response

<em>    while(response == 'y') </em>

<em>    { </em>

<em>    cout<<"How many miles did you walk?. "; </em>

<em>    cin>>miles; </em>

<em>    cout<<"You walked "<<convert(miles)<<" feet"<<endl; </em>

<em>    cout<<"Continue? (y/n): "; </em>

<em>    cin>>response; </em>

<em>    } </em>

   cout<<"Bye!";

You might be interested in
Should-the-government-allow-illegal-immigrants-to-become-citizens
Hunter-Best [27]

Answer:

No.

Explanation:

if they come into our country/state illegally then No but if they go threw and do what they are supposed to do to become a citizen then Yes

7 0
3 years ago
3 thing I learned in ICT
frutty [35]
I’ve learned makes me understand how it is important in our life to have an internet, and also important to know as a things I’ve known. First of all, I have learned about Camtasia, it is a program that are used to make a video about. And to show the others that how to do this or that on the computer.
6 0
3 years ago
Please help
Goryan [66]
The answer is B data digging
3 0
3 years ago
Which of the following defines a computer program?
andreev551 [17]

Answer:

A set of instruction given to computer

Explanation:

4 0
3 years ago
Where in the windows registry would you store a key that starts an executable when the operating system starts?
Evgesh-ka [11]
Answer: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
4 0
3 years ago
Other questions:
  • From the Start screen, you can A. access recently opened Excel workbooks. B. create a document from a template. C. create new bl
    12·2 answers
  • Enter the value of 5⋅(13.5−4.5). <br> ​
    5·1 answer
  • The PATH environment variable.
    5·1 answer
  • What ip address cidrs are not allowed to be communicated with by our malware?
    15·1 answer
  • Which is a type of display monitor? HDD CPU SSD LCD
    6·1 answer
  • Host Y sends the first TCP ACK message for the transaction?<br><br> a. true<br><br> b. false
    9·1 answer
  • Fear and superstition were swept away as scientists began to understand natural phenomena, leading to a shift in content for gra
    5·1 answer
  • What do “phone-copying” systems allow investigators to do?
    9·1 answer
  • How do operating system work?
    5·1 answer
  • NO LINKS Please
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!