I DON'T GET THIS
project:
Many treadmills output the speed in miles per hour. However, most runners think of their pace in minutes and seconds per mile. Write a program that inputs a decimal value for miles per hour and converts the value to minutes and seconds per mile.
Sample input, output:
For input 5.5 mph, the output should be 10 minutes and 55 seconds per mile.
For input 4 mph, the output should be 15 minutes and 0 seconds per mile.
For input 3.1mph, the output should be 19 minutes and 21 seconds per mile.
Prompt the user for his or her name and use the name to personalize the output
9 12171
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.
Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.
Then when you are ready post a new question in this thread.
Please read the posting guidelines.
I can provide help only with specific problems. This one looks like oyu hare having trouble converting from miles per hour to 1 mile per ???.
Can you do this on paper?
If so, write a samll C/C++ program that does that calculation.
Then, if you are still stuck, repost and we'll go from there.
sorry >___<;;
this is the code so far...but now, i have a problem. how would you use both minutes and seconds instead of being the seconds being a decimal? 
import java.util.Scanner;

public class treadmills

{ public static void main(String[] args) {



double x;

double y;

String z;


Scanner iScanner = new Scanner (System.in);


System.out.println("your name?");

z = iScanner.next();





System.out.println("mph?");

x = iScanner.nextDouble();



System.out.println(z+ " you are running "+(3600/x)/60+" minutes per mile");





}

}
Seeing as how this is Java code, I'm going to move it from the C/C++ Forum and over into the Java Forum.
i understand that you have to do % for division w/ remainder but i still cant get it to work
i understand that you have to do % for division w/ remainder but i still cant get it to work
Please calm down for a minute == 60 seconds == 1/60 of an hour. You're dealing
with 'unit conversion'. Isn't that just calculus 101? there are 3600 seconds in an
hour and there are 60 minutes in an hour and there are 60 seconds in a minute.
What more do you need? A few simple methods can do the job where you
yourself have to keep track of the units: 
double convertMpHtoMpS(double mph) { return mph/3600.0; }

double convertMpHtoMpM(double mph) { return mph/60.0; }

double convertMpStoMpH(double mps) { return mps*3600.0; }

double convertMpMtoMpH(double mpm) { return mpm*60; }

// etc. etc.

kind regards,
Jos
...Isn't that just calculus 101?...
I should hope not  I was doing unit conversion in basic science classes. But maybe that's because I'm is the US, using the silly nonSI units (inches? I'll take cm, thanks), and had to convert US units to metric units for science, and back. Then again, this doesn't even involve conversion between systems, but conversions within a system, which involved just basic knowledge of what an hour is (60 minutes) and what a minute is (60 seconds)  none of which are calculus topics.
Heya, bakxchaixDD.
Look at it this way:
60/1 Miles/Hour = 1/60 Hours/Mile
3 Miles per hour = 1/3 Hour per Mile
12.5 Miles per hour = 1/12.5 Hours per Mile
and so on.
So to get the number of hours per mile, get the int value of the inverse (1/x) of the number of miles per hour.
3 Miles per hour = 1/3 > 0 Hours per mile (0.3333...).
To find the number of minutes, take the decimal part and multiply by 60.
0.3333... * 60 = 20 minutes.
3 Miles per hour => 0 Hours, 20 Minutes per mile.
I should hope not  I was doing unit conversion in basic science classes. But maybe that's because I'm is the US, using the silly nonSI units (inches? I'll take cm, thanks), and had to convert US units to metric units for science, and back. Then again, this doesn't even involve conversion between systems, but conversions within a system, which involved just basic knowledge of what an hour is (60 minutes) and what a minute is (60 seconds)  none of which are calculus topics.
I suspect it's my bad: at least the Dutch schools consider everything that has to
do with calculating stuff, calculus. Algebra comes in when you actually have to
prove that, say, a+b+c == b+a+c for a commutative operator +.
There's definitely a definition shift between Russian, Western Europe and USA
comprehension of what calculus and algebra is supposed to be.
btw, full support of abstract unit support is not trivial, e.g. if fnort == 4*fnork^2,
what is fronobulax^2/fnort? If that's solved only then you can bring in the conversion
numbers.
kind regards,
Jos ;)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Richard Hollenbeck 
last post by:
I'm trying to write some code that will convert any of the most popular
standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan
1908) and compare the first with the second and...

by: Eric Lilja 
last post by:
Hello, I've made a templated class Option (a child of the abstract base
class OptionBase) that stores an option name (in the form someoption=) and
the value belonging to that option. The value is...

by: Galsaba 
last post by:
How can I convert the following script to be used in access?
<Html>
<head>
<title>Dealers</title>
</head>
<h5>List of Dealers Nearest to your Zip Code</h5><br><br>
<?
$errflag = false;

by: Daisy 
last post by:
Having a weird problem... Just moving some code into new classes & methods.
Originally, I created a new instance of "Game" (my form), and it created a
new DX Device using:
_device = new...

by: Convert TextBox.Text to Int32 Problem 
last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...

by: David Lozzi 
last post by:
Howdy,
ISSUE 1: See issue 2 below. I have a distance calculator on my site which works great. However, the users need to sort by distance, which make sense. I'm not sure how to do it other than...

by: kirke 
last post by:
Hi,
I have a datetime column named dtDateTime.
its format is "Oct 27 2006 12:00:00 "
I want to group by only date part of it and count
my code is
$sql1="SELECT ...

by: Joseph Geretz 
last post by:
I need to calculate miles per degree longitude, which obviously depends on
latitude since lines of longitude converge at the poles. Via Google, I've
come up with the following calculation:
...

by: CloudSolutions 
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...

by: Faith0G 
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

by: isladogs 
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...

by: ryjfgjl 
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...

by: ryjfgjl 
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and timeconsuming...

by: emmanuelkatto 
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel

by: BarryA 
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

by: Sonnysonu 
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by columnwise with in the specific length.
suppose the i have to...

by: Hystou 
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
 