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

A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output i

s the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: printf("%0.2lf", yourValue);
Computers and Technology
2 answers:
kenny6666 [7]3 years ago
7 0

Answer:

steps = int(input("Enter the number of steps: "))

miles = steps / 2000

print('{:.2f}'.format(miles))Explanation:

Explanation:

Amanda [17]3 years ago
6 0

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 might be interested in
Write a C program that creates two threads to run the Fibonacci and the Runner processes. Threads will indicate the start and th
OleMash [197]

Answer:

see explaination

Explanation:

#include <pthread.h>

#include <stdio.h>

int sumOfN = 0;

int arr[1000];

int n;

void * findSumOfN(void *a){

printf("Thread 1 Starting\n");

sumOfN = (n * (n+1)) / 2; //finds sum of first n natural numbers

printf("Thread 1 Finished\n");

pthread_exit(0);

}

void * fibonacci(void *a){

printf("Thread 2 Starting\n");

arr[0]=0;

arr[1]=1;

for(int i=2;i<n;i++) //find fibonacci numbers iteratively

arr[i]=arr[i-1]+arr[i-2];

printf("Thread 2 Finished\n");

pthread_exit(0);

}

int main(void){

printf("Please enter the value of n \n");

scanf("%d", &n);

if (n <= 0)

{

printf("Wrong input ! \n"); //input validation

return 0;

}

pthread_t thread1, thread2;

pthread_create(&thread1,NULL, findSumOfN, NULL); //Create threads

pthread_create(&thread2,NULL, fibonacci, NULL);

pthread_join(thread1,NULL); //Start threads

pthread_join(thread2, NULL);

printf("The sum of first %d numbers is : %d \n",n, sumOfN);

printf("The first %d fibonacci numbers are : \n",n);

for (int i = 0; i < n; ++i)

{

printf("%d ", arr[i]);

}

printf("\n");

return(0);

}

3 0
3 years ago
A software computer error, is a error produced by the malfunctioning of a computer part. E.g. RAMImmersive Reader
Andru [333]

Answer:

? is this you question true or false because i dont know the answer yet

Explanation:

4 0
3 years ago
This describes what is charted. It can be placed above or below the chart.
Tems11 [23]

Answer:

a . chart area

This describes what is charted. It can be placed above or below the chart.

Explanation:

3 0
2 years ago
You work for the Contoso Corporation. You have a server that acts as a file server for clients. You must make sure that the serv
Anika [276]
Get a dedicated server with 6-10gb RAM, which might be able to run a lot, while staying up with no lag.
6 0
3 years ago
Use the drop-down menus to complete the statements about using column breaks in word 2016
Ugo [173]

Answer: layout, section, number, more options

Explanation:

Just did it on edge 2020

4 0
3 years ago
Read 2 more answers
Other questions:
  • A document repository is down when you attempt to access it. which isa principle is being violated?
    13·1 answer
  • The sum of all the minterms of a boolean function of n variables is equal to 1.
    7·1 answer
  • PLEASE HELP ASAP i will mark brilliant
    12·2 answers
  • I need urgent help...my laptop has been like this... can anyone help me plzzz​
    6·1 answer
  • PLEASE HELP ASAP!!! 99 POINTS FOR 3 MULTIPLE CHOICE QUESTIONS!!! PLEASE ANSWER ALL!!!
    8·1 answer
  • The Department Manager researches new data platforms for the company and requests a list of essential features. Which essential
    6·1 answer
  • Why is graphics important in multimedia application <br>​
    11·1 answer
  • The physical parts of Computer are kwon as<br>​
    15·1 answer
  • Area Triangolo Rettangolo in c++
    6·1 answer
  • 9 dmz, vpn, vlan where in the network do you place a dmx, why, what attacks are prevented? what does a vpn do, provide an exampl
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!