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
What is the purpose of a web server? What is the purpose of a web browser?
Sauron [17]

Answer: the purpose of a web browser is to help answer and needed questions, and to get to sites.

Explanation:

4 0
2 years ago
You are most likely to use<br> images for photos or digital paintings.
Lubov Fominskaja [6]

Answer: Digital Paintings

7 0
3 years ago
Discuss some designs using columns, gutters, text alignment, graphics, etc.
Naily [24]

Answer:

.......

Explanation:

8 0
3 years ago
Tyesha is trying to create a resume using a template on Word, but she can not figure it out. What wrong step does she make in th
abruzzese [7]
Heading selection on Word Document
8 0
3 years ago
An instructor has given a student an assignment to assemble a pc. in which situation should the student be aware that esd is an
Zina [86]

When installing RAM situation is one where the student should be aware that esd is an issue.

<h3>What is the RAM in a computer?</h3>

RAM is a term that connote random-access memory and a computer RAM is known to be a kind of a short term memory and it is a place where data is said to be saved as at the time that the processor needs it.

Hence, When installing RAM scenario is one where the student should be aware that esd is an issue and then one can resolve it.

See full question below

An instructor has given a student an assignment to assemble a PC. In which situation should the student be aware that ESD is an issue?

  • when installing RAM
  • when working in a corporate environment that has carpet installed under tower PCs
  • when using a grounded mat and working on a computer on an ungrounded workbench
  • when installing a dual-voltage power supply

Learn more about RAM from

brainly.com/question/13196228

#SPJ1

3 0
2 years ago
Other questions:
  • Explain the first to four generations of a computer​?
    7·1 answer
  • Which of the following statements is correct? A. The columns will be listed in the results in the same order they are stored in
    7·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    10·1 answer
  • Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any n
    8·1 answer
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • Use______ to format cells when they meet a certain criteria.
    13·1 answer
  • If you forget your privacy password what will you do if the ask this question what is the name of one of your teacher?​
    12·1 answer
  • Can someone help me in my IT (information technology) homework
    10·2 answers
  • I used the Pearson correlation coefficient for my study to test the correlation and how strong is the relationship between two v
    10·2 answers
  • Explain two ways that you can create a header.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!