Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 converting miles to yards)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nin




PostPosted: 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...
Sponsor
Sponsor
Sponsor
sponsor
nin




PostPosted: 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?
ericfourfour




PostPosted: Fri Nov 24, 2006 8:01 pm   Post subject: (No subject)

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




PostPosted: Sat Nov 25, 2006 8:38 pm   Post subject: (No 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.
Expirant




PostPosted: Sun Nov 26, 2006 1:04 pm   Post subject: (No 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)
ericfourfour




PostPosted: Sun Nov 26, 2006 3:29 pm   Post subject: (No 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.
Expirant




PostPosted: Sun Nov 26, 2006 9:11 pm   Post subject: (No 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: