GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 16-Sep-2008, 17:44
Bennettboy35 Bennettboy35 is offline
New Member
 
Join Date: Sep 2008
Posts: 1
Bennettboy35 is on a distinguished road
Unhappy

Calculate the distance between two points in the 2D Cartesian plane


What up my names Ryan, I'm very new to c++ so bare with me.

This is the lab I am supposed to complete:



Write a program that helps the user calculate the distance between two points in the 2D Cartesian plane. Try to make your results as readable as possible.

As an example, you might have the program interaction look something like (the parts in this color are typed by the user):

$ ./distance.out

Welcome to the 2D Distance Program!!!

Where is your first point? 3.4 12.2
Where is your second point? 13.4 12.2

Thank you!! Calculating... Done.

(3.4, 12.2) is 10 units away from (13.4, 12.2).

Thank you for using the TDP!!

Endeavor to have a wondrous day!

$



I'm asking someone for help because I can't even get my compiler past the 10th line of me code.



Any help and it would be greatly appreciated, I know this is very basic.
  #2  
Old 16-Sep-2008, 17:59
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 586
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: Hey guys I need help implementing the distance formula


Quote:
Originally Posted by Bennettboy35
I'm asking someone for help because I can't even get my compiler past the 10th line of me code.
Perhaps it would be more beneficial to post your code. Be sure to place a [cpp] tag before your code & [/cpp] afterwards.
  #3  
Old 17-Sep-2008, 06:42
dlp dlp is offline
Member
 
Join Date: May 2006
Posts: 157
dlp has a spectacular aura about

Re: Calculate the distance between two points in the 2D Cartesian plane


And errors you are seeing when you compile.
  #4  
Old 17-Sep-2008, 07:46
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 761
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Calculate the distance between two points in the 2D Cartesian plane


Try starting with something like this and see if it compiles:
CPP / C++ / C Code:
int main()
{ 
  return 0;
}
After getting this to compile successfully, add a couple of lines of code and try to recompile successfully. Continue recompiling as you go so that you can detect errors easier.
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me write this formula in c++ nekavnick C++ Forum 5 23-Aug-2008 16:05
Help! Need Formula For Perfect Number New_Girl991 C++ Forum 4 04-Apr-2008 04:48
start variable pointer in struct cpit C Programming Language 9 10-Jan-2006 08:39
shorthest path-another way Pandiani C++ Forum 6 09-May-2004 19:51
Math Formula: FORECAST JdS Open Discussion Forum 4 16-Oct-2003 08:58

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:32.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.