GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC 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 05-May-2008, 13:36
Liquidxt Liquidxt is offline
New Member
 
Join Date: May 2008
Posts: 1
Liquidxt is on a distinguished road

Noob, immediate help needed


I have a program due in a very short period of time for class, but can't seem to get it to work right. here is the code so far

CPP / C++ / C Code:
#include <iostream>
using namespace std;

int main()
{
	int SSN, q;
		
	{
		cout << "Input Last Four Digits Of Your SSN: " << endl;
			cin >> SSN;
	if (SSN < 2500)
	{
		q = first;
	}
	else if(5000 > SSN > 250-00-0000)
	{
		q = second;
	}
	else if(7500 > SSN > 500-00-0000)
	{
		q = third;
	}
	else if(7500 < SSN)
	{
		q = fourth;
	}
	{
		cout << "Your check will be delivered in the " << q << "quarter." << endl;
	}
	
	cout << endl;
	}	
}


Any help would be greatly appreciated
Last edited by LuciWiz : 09-May-2008 at 07:14. Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
  #2  
Old 05-May-2008, 13:59
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 452
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Noob, immediate help needed


You should really tell us what does not work. Did you attempt to compile and get error messages or did it compile and then crashed when you ran it?

Judging from the code, I doubt it compiled see this:

CPP / C++ / C Code:
else if(5000 > SSN > 250-00-0000)
SSN is an integer. 250-00-0000 is what? Also, if you were going to do it this way, you would need 2 separate comparisons like:
CPP / C++ / C Code:
else if( 5000 > SSN && SSN > 250000000)
  #3  
Old 05-May-2008, 20:17
dlp dlp is offline
Junior Member
 
Join Date: May 2006
Posts: 89
dlp will become famous soon enough

Re: Noob, immediate help needed


Quote:
Originally Posted by fakepoo
Judging from the code, I doubt it compiled see this:

CPP / C++ / C Code:
else if(5000 > SSN > 250-00-0000)
SSN is an integer. 250-00-0000 is what?
250? (250 minus 00 minus 0000)
 
 

Recent GIDBlogFlickr uploads of IA pictures 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
C++ games programmer needed (London, freelance contract) Nickdammit Computer Programming Advertisements & Offers 0 19-Mar-2008 08:02
Total Noob needing help not a banana C++ Forum 4 04-Jun-2007 18:12
Noob C++ question Capnpooh C++ Forum 2 30-Mar-2006 19:25
Free 1st month / Free setup / No credit card needed...Plans start at 4.95 LarryIsaac Web Hosting Advertisements & Offers 0 11-Oct-2003 14:03

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

All times are GMT -6. The time now is 00:49.


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