Answer:
import java.util.Scanner;
public class num1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
//Prompt and receive user input
System.out.println("Enter number of Steps");
int numSteps = in.nextInt();
double numMiles = numSteps/2000;
//Print the formated number of miles
System.out.printf("The equivalent miles is %.2f ",numMiles);
}
}
Explanation:
- This is solved using Java programming language
- Scanner class is imported and used to receive user input (number of steps walked)
- To convert number of steps to number of miles, we divide by 2000, Since the question says the pedometer treats walking 2,000 steps as walking 1 mile.
- Output the number of miles to 2 decimal places using java's printf() method
You should state the language you're using in these types of questions; here's an example in C++.
bool isQuad;
int sides;
std::cout << "How many sides does the shape have?";
std::cin >> sides;
if (sides == 4)
isQuad = true;
else
isQuad = false;
Answer:
hospital yestrday after noon ggpupg ki tyutrdcbhsjdvshsjjshsgsgdhsusfsuwwiiwhszia