Help on fatal error :S!!

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2009
Posts: 63
Reputation: fadia is an unknown quantity at this point 
Solved Threads: 0
fadia fadia is offline Offline
Junior Poster in Training

Help on fatal error :S!!

 
0
  #1
May 31st, 2009
Hello..
i'm working on my project.. it's the first time i do a C++ project..
but i'm getting this fatal error..
if any one knows how to solve it plz tell me..
also if anyone have any idea or advice to improve the program plz go ahead.

  1.  
  2. #include <iostream>
  3. using namespace std;
  4. int main ()
  5. {
  6.  
  7. int faq_choice,faq_YN;
  8.  
  9. cout << "\t\t\t ================= "<<endl;
  10. cout << "\t\t\t || || || || "<<endl;
  11. cout << "\t\t\t || || || || "<<endl;
  12. cout << "\t\t\t || || || "<<endl;
  13. cout << "\t\t\t \\ || || "<<endl;
  14. cout << "\t\t\t \\ || "<<endl;
  15. cout << "\t\t\t \\ || "<<endl;
  16. cout << "\t\t\t \\|| J-Otaku-Air "<<endl;
  17. cout <<endl;
  18. cout <<endl;
  19.  
  20. do
  21. {
  22.  
  23. cout << "Welcome to the Frequently Asked Questions (FAQ) area."<<endl;
  24. cout << "Bellow is a list of frequently asked questions."<<endl;
  25. cout << "Choose the number of the required quest then press Enter to show the answer."<<endl;
  26. cout <<endl;
  27. cout <<endl;
  28.  
  29. cout << "Q1. Should I reconfirm my flights, hotel or car reservations?"<<endl;
  30. cout << "Q2.What happens if the airline has changed my flights?"<<endl;
  31. cout << "Q3.Do you deliver tickets to other countries?"<<endl;
  32. cout << "Q4.Do you deliver tickets to a hotel/business or alternate place"<<endl;
  33. cout << "other than my home?"<<endl;
  34. cout << "Q5.What if my tickets are lost or stolen?"<<endl;
  35.  
  36.  
  37. cout <<endl;
  38. cin >> faq_choice;
  39. cout <<endl;
  40. cout << "Are you sure you want question number "<<faq_choice << " ?(Y/N)"<<endl;
  41. cin >> faq_YN;
  42. cout <<endl;
  43. cout <<endl;
  44.  
  45.  
  46. if ((faq_YN=='N') && (faq_YN=='n'))
  47. {
  48. cout << "If you are not happy with your choice, then please choose another question"<<endl;
  49. }
  50.  
  51. if ((faq_YN=='Y') && (faq_YN=='y'))
  52.  
  53. {
  54.  
  55. cout<<"Here is the answer."<<endl;
  56. }
  57.  
  58.  
  59. switch (faq_YN)
  60. {
  61. case (1):
  62. cout << "Travelers are advised to contact the airline, hotel or car rental company"<<endl;
  63. cout << "at least 72 hours prior to departure."<<endl;
  64. break;
  65.  
  66.  
  67. case (2):
  68. cout << "If the airline changed or cancelled your flights, the airline must assist you."<<endl;
  69. cout << "J-Otaku Air did not change the flights. The airline did,"<<endl;
  70. cout << "thus the airline must fix your itinerary and/or ongoing travel."<<endl;
  71. break;
  72.  
  73. case (3):
  74. cout << "Yes, we deliver tickets to other countries."<<endl;
  75. cout << "Delivery is via electronic ticketing for claiming at the airport ticket counter,"<<endl;
  76. cout << "or paper ticket via courier. Our booking engine will advise you as to the form "<<endl;
  77. cout << "of delivery for the flights that you have chosen."<<endl;
  78. break;
  79.  
  80.  
  81. case (4):
  82. cout << "Yes, we deliver tickets to your hotel/business or office or any alternate address"<<endl;
  83. cout << "where a courier may get signature for delivery of the package. "<<endl;
  84. cout << "Postal office boxes (PO Boxes) are not allowed. "<<endl;
  85. break;
  86.  
  87. case (5):
  88. cout << "If your paper airline tickets are lost or stolen, please contact us or call us immediately."<<endl;
  89. cout << "If your original tickets are not used after a designated period of time-generally 3 to 4 months,"<<endl;
  90. cout << "you will receive credit for the purchase price of the original lost ticket."<<endl;
  91. break;
  92.  
  93. default :
  94. cout << "Error! That was an invalid entry."<<endl;
  95.  
  96.  
  97. }
  98. while(faq_choice!=0);
  99. return 0;
  100. }

and this is the compiler's message:
1>------ Build started: Project: leish, Configuration: Debug Win32 ------
1>Compiling...
1>WHYYme.cpp
1>c:\users\fofa\documents\visual studio 2005\projects\leish\whyyme.cpp(103) : fatal error C1075: end of file found before the left brace '{' at 'c:\users\fofa\documents\visual studio 2005\projects\leish\whyyme.cpp(6)' was matched
1>Build log was saved at "file://c:\Users\fofa\Documents\Visual Studio 2005\Projects\leish\Debug\BuildLog.htm"
1>leish - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


plz help!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 32
Reputation: Ahmed_I is an unknown quantity at this point 
Solved Threads: 1
Ahmed_I Ahmed_I is offline Offline
Light Poster

Re: Help on fatal error :S!!

 
0
  #2
May 31st, 2009
Its a braces problem check for unclosed braces in all of your program.

There is a missing brace in line of
while(faq_choice !=0)
just add '}' before this line.

it is for do while loop.
Last edited by Ahmed_I; May 31st, 2009 at 3:26 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 63
Reputation: fadia is an unknown quantity at this point 
Solved Threads: 0
fadia fadia is offline Offline
Junior Poster in Training

Re: Help on fatal error :S!!

 
0
  #3
May 31st, 2009
ok i did that.. the error was gone.. but i got an infinite loop !!
even though i'm getting 1 succeeded!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 32
Reputation: Ahmed_I is an unknown quantity at this point 
Solved Threads: 1
Ahmed_I Ahmed_I is offline Offline
Light Poster

Re: Help on fatal error :S!!

 
1
  #4
May 31st, 2009
you got several errors in your code .

1- in int faq_choice,faq_YN;
y did u make faq_YN integer it have to be char that is why the infinite loop occurs.

2- in your if statements u made && it should be || cuz when making && the resulting of the if statement will always be false and wont enter body of the if statement.

3-in the switch statement y did u put faq_YN as its condition
it should be faq_choice .

4-there are other errors but sorry i have no time to state it but it wont make A difference in the program ,hope u find them by yourself.

hope that my corrections are right.
Last edited by Ahmed_I; May 31st, 2009 at 4:10 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Help on fatal error :S!!

 
0
  #5
May 31st, 2009
Take a look at the corrected code and at Ahmed_I's post
#include <iostream> 
using namespace std;
int main ()
{

	int faq_choice;
	char faq_YN;
		
	cout << "\t\t\t =================    "<<endl;
	cout << "\t\t\t     ||   || || ||    "<<endl;
	cout << "\t\t\t     ||   || || ||    "<<endl;
	cout << "\t\t\t     ||      || ||    "<<endl;
	cout << "\t\t\t \\   ||         ||   "<<endl;
	cout << "\t\t\t  \\  ||              "<<endl;
	cout << "\t\t\t   \\ ||              "<<endl;
	cout << "\t\t\t    \\||  J-Otaku-Air "<<endl;
	cout <<endl;
	cout <<endl;

       do
       {

	    cout << "Welcome to the Frequently Asked Questions (FAQ) area."<<endl;
	    cout << "Bellow is a list of frequently asked questions."<<endl;
	    cout << "Choose the number of the required quest then press Enter to show the answer."<<endl;
	    cout <<endl;
            cout <<endl;

	    cout << "Q1. Should I reconfirm my flights, hotel or car reservations?"<<endl;
	    cout << "Q2.What happens if the airline has changed my flights?"<<endl;
	    cout << "Q3.Do you deliver tickets to other countries?"<<endl;
	    cout << "Q4.Do you deliver tickets to a hotel/business or alternate place"<<endl;
	    cout << "other than my home?"<<endl;
	    cout << "Q5.What if my tickets are lost or stolen?"<<endl;

	
            cout <<endl;
	    cin  >> faq_choice;
	    cout <<endl;
	    cout << "Are you sure you want question number "<<faq_choice << " ?(Y/N)"<<endl;
	    cin  >> faq_YN;
	    cout <<endl;
	    cout <<endl;
	

            if ((faq_YN=='N') || (faq_YN=='n'))
	    {
               cout << "If you are not happy with your choice, then please choose another question"<<endl;
	    }

	    if ((faq_YN=='Y') || (faq_YN=='y'))
	    {
	
		cout<<"Here is the answer."<<endl;
	    }
	
	
	    switch (faq_choice)
	    {
	    case (1):
		cout << "Travelers are advised to contact the airline, hotel or car rental company"<<endl;
		cout << "at least 72 hours prior to departure."<<endl; 
	        break;

	    case (2):
		cout << "If the airline changed or cancelled your flights, the airline must assist you."<<endl;
		cout << "J-Otaku Air did not change the flights. The airline did,"<<endl; 
		cout << "thus the airline must fix your itinerary and/or ongoing travel."<<endl;
	        break;

	    case (3):
		cout << "Yes, we deliver tickets to other countries."<<endl;
		cout << "Delivery is via electronic ticketing for claiming at the airport ticket counter,"<<endl;
		cout << "or paper ticket via courier. Our booking engine will advise you as to the form "<<endl;
		cout << "of delivery for the flights that you have chosen."<<endl;
                break;

	    case (4):
		cout << "Yes, we deliver tickets to your hotel/business or office or any alternate address"<<endl;
		cout << "where a courier may get signature for delivery of the package. "<<endl;
		cout << "Postal office boxes (PO Boxes) are not allowed. "<<endl;
                break;

 	     case (5):
		cout << "If your paper airline tickets are lost or stolen, please contact us or call us immediately."<<endl;
		cout << "If your original tickets are not used after a designated period of time-generally 3 to 4 months,"<<endl;
		cout << "you will receive credit for the purchase price of the original lost ticket."<<endl;
	        break;

	      default :
		cout << "Error! That was an invalid entry."<<endl;

	      }
    } while(faq_choice!=0);
    return 0;
}
Last edited by tux4life; May 31st, 2009 at 5:26 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC