|
-
June 10th, 2009, 01:02 PM
#1
This is my first programming project, and I really need some help
Okay. I'm new to programming and I'm currently taking online C++ programming classes.
I'm doing this project involving hurricanes. I compiled this program into the C++ Compiler
This is the program I placed in there.
-----
---
//Project 1
#include <stdhx>
#include <iostream>
using namespace std;
int main()
{
double lat1; lat2; long1; long2; leg1; leg2;
cout <<"Enter value for Latitude"<<;
cin >> lat1;
cout <<"Enter second value for latitude<<;
cin >> lat2;
cout << "Enter Value for Longitude";
cin >> long1;
cout << "Enter 2nd value for longitude";
cin >> long2;
leg1 = = lat2-lat1;
leg2 = = long2 - long1;
cout << "First leg =" <<leg1<<endl;
cout << Second leg =" <<leg2 <<endl;
return 0;
}
-------------
Here I found 20 errors I couldn't really read. If you want to see them , please let me know.
Thank you so much for your help.
~Rukiya
-
June 10th, 2009, 01:10 PM
#2
Re: This is my first programming project, and I really need some help
Is this in Microsoft Visual Studio? If so, what type of project did you select to start with?
-
June 10th, 2009, 01:11 PM
#3
Re: This is my first programming project, and I really need some help
 Originally Posted by KingTermite
Is this in Microsoft Visual Studio? If so, what type of project did you select to start with?
This is in Microsoft studio.
And I think I used WIN32 Console project.
-
June 10th, 2009, 01:31 PM
#4
Re: This is my first programming project, and I really need some help
Try changing this,
Code:
double lat1; lat2; long1; long2; leg1; leg2;
to this
Code:
double lat1, lat2, long1, long2, leg1, leg2;
and also this
Code:
leg1 = = lat2-lat1;
probably doesn't do what you think it does.
Last edited by jeron; June 10th, 2009 at 02:04 PM.
-
June 10th, 2009, 02:58 PM
#5
Re: This is my first programming project, and I really need some help
 Originally Posted by jeron
Try changing this,
Code:
leg1 = = lat2-lat1;
probably doesn't do what you think it does.
That leg1 is supposed to be a variable.
So I can't write x == a +b?
-
June 10th, 2009, 03:01 PM
#6
Re: This is my first programming project, and I really need some help
 Originally Posted by Rukiya
That leg1 is supposed to be a variable.
So I can't write x == a +b?
== means evaluation like if (a == b)
= means assign like a = c+2
So using double equal there means you are testing logic, not assigning a value. It appears to be that you mean to assign a value because testing logic without any type of conditional statement (if, while, for, etc...) would not make sense.c
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|