Computer Science Canada

converting miles to yards)

Author:  nin [ Fri Nov 24, 2006 6:07 pm ]
Post subject:  converting miles to yards)

what is the equation to convert miles to yards?.... i noe that
1 mile = 1760 yard...

Author:  nin [ Fri Nov 24, 2006 6:31 pm ]
Post subject:  Re: converting miles to yards)

nin wrote:
what is the equation to convert miles to yards?.... i noe that
1 mile = 1760 yard...




*************************************************************

is the equation:
[yards] = [miles] / 1760 .......... if your finding the yards and if your finding the miles do u put:
[miles]= yards* 1760 ?
is that right?
*************************************************************

the assignment is to write a program that will read and convert it to miles or yards. Your program should have a title an intro. You may need to errotrap the input.

My work looks like this write now:

title: Converter

Intro: This program allows you to change miles into yards.

input: Please enter the type of measurement (miles or yards):
Please enter the number : [number]

output:

Equation
[yards]=[miles]/1760
[miles]=[yards]*1760

Answer
[yards]= [number]
[miles]=[number]
*************************************************************

is this right so far? or seriously WRONG?

Author:  ericfourfour [ Fri Nov 24, 2006 8:01 pm ]
Post subject: 

You basically just answered your own question. Get the input and put it into the equation. That is all you need to do.

Author:  jrblast [ Sat Nov 25, 2006 8:38 pm ]
Post subject: 

if 1 mile = 1760 yards then shouldnt x yards = number of miles * 1760?
code:

[yards]=[miles]/1760
[miles]=[yards]*1760



You have your multiplication and division signs in the wrong place.

Author:  Expirant [ Sun Nov 26, 2006 1:04 pm ]
Post subject: 

jrblast wrote:
if 1 mile = 1760 yards then shouldnt x yards = number of miles * 1760?
code:

[yards]=[miles]/1760
[miles]=[yards]*1760



You have your multiplication and division signs in the wrong place.


Actually, I think it would be:
yards = miles * 1760yards/mile
miles = yards / 1760yards/mile

(in both cases the similar terms cancel out on the right side of the equation)

Author:  ericfourfour [ Sun Nov 26, 2006 3:29 pm ]
Post subject: 

Wow you guys are going overboard for some simple algebra. Simply solve for a proportion.

1 mile / 1760 yards = x miles / y yards. If you want the miles solve for x or if you want the yard solve for y. I think this is what Expirant was trying to say.

Author:  Expirant [ Sun Nov 26, 2006 9:11 pm ]
Post subject: 

ericfourfour wrote:
Wow you guys are going overboard for some simple algebra. Simply solve for a proportion.

1 mile / 1760 yards = x miles / y yards. If you want the miles solve for x or if you want the yard solve for y. I think this is what Expirant was trying to say.


I just explained it the way I was taught. That's what I meant though, yup.


: