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
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?
Re: This is my first programming project, and I really need some help
Quote:
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.
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.
Re: This is my first programming project, and I really need some help
Quote:
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?
Re: This is my first programming project, and I really need some help
Quote:
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