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]
3 years ago
7

Description:

Computers and Technology
1 answer:
Nastasia [14]3 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
Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
Montano1993 [528]

Answer:

1/2000

Explanation:

import java.util.Scanner;

public class InputExample {

public static void main(String [] args) {

Scanner scnr = new Scanner(System.in);

System.out.print("Enter birth month and date:");//comment this line if not needed

int birthMonth=scnr.nextInt();

int birthYear=scnr.nextInt();

String output= birthMonth+"/"+birthYear+"\n";

System.out.println(output);

}

}

if using this code the out put should be 1/2000

5 0
3 years ago
Thiết kế biểu đồ thực thể liên kết và tập lược đồ cơ sở dữ liệu quan hệ cho các bài toán quản lý sau:
Paladinen [302]

Answer:

sorry please write in English than i help.you i don't understand your language

3 0
2 years ago
Which generation is called the new silent generation? A. Generation X B. the homelander generation C. the millennial generation
____ [38]

Which generation is called the new silent generation?

A. Generation X

<u>B. the homelander generation </u>

C. the millennial generation

D. the boom generation

6 0
3 years ago
The region of the sky which reflects radio waves around the world is the .
aivan3 [116]

The ionosphere reflects those waves

6 0
3 years ago
A customer calls complaining their laptop wont start what should I say
topjm [15]

Answer:

tell them to bring there laptop to you so you can explain how to get them out of situations like those. Or maybe do a video call so the person can show you whats going on and you can take it on from there guiding her on how to fix it...

Explanation:

4 0
2 years ago
Other questions:
  • How to reset your password if you changed your email and dont remember password?
    6·1 answer
  • Create a program that reads words.txt (link near top of our home page) in order to: determine the length of the longest word(s)
    14·1 answer
  • ? Question
    6·2 answers
  • Which best describes obliteration in a forged document?
    11·1 answer
  • A set of well-defined steps for performing a task or solving a problem is known as a(n):A) HierarchyB) AlgorithmC) Central Proce
    15·1 answer
  • What can you do to help create a safe online environment?
    8·2 answers
  • Why is it important to put the most specific case first? What types of errors does it help avoid?
    11·1 answer
  • Help help help help help!!!
    7·1 answer
  • What is a document?read.Miércoles, 19 de agosto ¡Saludos Mario! ¿Cómo estás amigo? ¿Cómo está tu familia en Caracas? Mi familia
    12·1 answer
  • An information system can enhance core competencies by
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!