473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

i cant find where to put/move the bracket, and getting a error because of it.

here is my code. i am only getting one error:

Expand|Select|Wrap|Line Numbers
  1. // Final Project
  2.  
  3. #include <iostream.h>
  4. #include <iomanip.h>        
  5.  
  6. void checkout();
  7. void start_or_startover();
  8. void receipt();
  9.  
  10. int choice;
  11.  
  12. float subtotal, tax, total;
  13.  
  14. // Prices
  15. double laptopprice = 799.99;
  16. double mouseprice = 12.99;
  17. double keyboardprice = 29.99;
  18. double moniterprice = 399.99;
  19. double usbprice = 16.99;
  20. double hdmiprice = 24.99;
  21. double lazerprice = 6.99;
  22. double powerprice = 9.99;
  23.  
  24. // Quantity
  25. int laptopnumber;
  26. int mousenumber;
  27. int keyboardnumber;
  28. int moniternumber;
  29. int usbnumber;
  30. int hdminumber;
  31. int lazernumber;
  32. int powernumber;
  33.  
  34. // Main Function
  35. int main()
  36. {
  37.  
  38.     do
  39.     { start_or_startover(); }
  40.     while (choice == 10);
  41.  
  42.     receipt();
  43.  
  44.     return 0;
  45.     }
  46.  
  47. {
  48.     cout << "Ferger's Technology Store" << endl << endl;
  49.  
  50.  
  51.     do
  52.     {
  53.     cout << "(1) HP Pavilion Intel Core 2 Duo Laptop        $799.99" << endl;
  54.     cout << "(2) Razer Black Wired Lazer Mouse                $12.99" << endl;
  55.     cout << "(3) Razer Keyboard Wired                        $29.99" << endl;
  56.     cout << "(4) HP LCD Flatscreen Moniter                    $399.99" << endl;
  57.     cout << "(5) SATA USB 8GB Flash Drive                    $16.99" << endl;
  58.     cout << "(6) HDMI Full 1080p 6ft Cable                    $24.99" << endl;
  59.     cout << "(7) Lazer Pointer                                $6.99" << endl;
  60.     cout << "(8) Power Cord                                    $9.99" << endl;
  61.     cout << endl;
  62.     cout << "(9) Total" << endl;
  63.     cout << "(10) Cancel Order" << endl;
  64.     cout << " Please enter the choice number of the electronics that you would like to buy." << endl << endl;
  65.     cin >> choice;
  66.     cout << endl;
  67.  
  68.     if (choice == 9)
  69.     {
  70.         chechout();
  71.     }
  72.     if (choice == 1 || choice == 2 || choice == 3 || choice == 4 || choice == 5 || choice == 6 || choice == 7 || choice == 8);
  73.     {
  74.     cout << " How many would you like? ";
  75.     cin >> choice_amount;
  76.     cout << endl;
  77.  
  78.     if (choice == 1)
  79.     {
  80.         laptopnumber = choice_amount;
  81.     }
  82.  
  83.     if (choice == 2)
  84.     {
  85.         mousenumber = choice_amount;
  86.     }
  87.  
  88.     if (choice == 3)
  89.     {
  90.         keyboardnumber = choice_amount;
  91.     }
  92.  
  93.     if (choice == 4)
  94.     {
  95.         moniternumber = choice_amount;
  96.     }
  97.  
  98.     if (choice == 5)
  99.     {
  100.         usbnumber = choice_amount;
  101.     }
  102.  
  103.     if (choice == 6)
  104.     {
  105.         hdminumber = choice_amount;
  106.     }
  107.     if (choice == 7)
  108.     {
  109.         lazernumber = choice_amount;
  110.     }
  111.     if (choice == 8)
  112.     {
  113.         powernumber = choice_amount;
  114.     }
  115.     }
  116.  
  117.     if (choice == 10)
  118.     {
  119.         laptopnumber = 0;
  120.         mousenumber = 0;
  121.         keyboardnumber = 0;
  122.         moniternumber = 0;
  123.         usbnumber = 0;
  124.         hdminumber = 0;
  125.         lazernumber = 0;
  126.         powernumber = 0;
  127.     }
  128.  
  129.     while (choice != 9);
  130.     }
  131.  
  132. {
  133.     subtotal = (laptopnumber * laptopprice) + (mousenumber * mouseprice) + (keyboardnumber * keyboardprice) + (    subtotal = (laptopnumber * laptopprice) + (mousenumber * mouseprice) + (keyboardnumber * keyboardprice) + (    subtotal = (laptopnumber * laptopprice) + (mousenumber * mouseprice) + (keyboardnumber * keyboardprice) + (moniternumber * moniterprice) + (usbnumber * usbprice) + (hdminumber * hdmiprice) + (lazernumber * lazerprice) + (powernumber * powerprice);
  134.  
  135.     tax = subtotal * .0875;
  136.  
  137.     total = subtotal + tax;
  138.     }
  139. void receipt()
  140.     {
  141.     cout << "Thank you for your buisness. Here is your recipt." << endl << endl;
  142.     cout.setf(ios::fixed);
  143.     cout << "Items\t\t  " << "Number of items purchased \t Price of each item \t Total price" << endl;
  144.     cout << "HP Pavilion Intel Core 2 Duo Laptop \t "<< laptopnumber << "\t\t\t" << "$" << setprecision(2) << laptopprice << "\t\t   " << "$" << (laptopnumber * laptopprice) << endl;
  145.     cout << "Razer Black Wired Lazer Mouse \t "<< mousenumber << "\t\t\t" << "$" <<  setprecision(2) << mouseprice << "\t\t   " << "$" << (mousenumber * mouseprice) << endl;
  146.     cout << "Razer Keyboard Wired \t "<< keyboardnumber << "\t\t\t" << "$" << setprecision(2) << keyboardprice << "\t\t   " << "$" << (keyboardnumber * keyboardprice) << endl;
  147.     cout << "SATA USB 8GB Flash Drive \t "<< usbnumber << "\t\t\t" << "$" << setprecision(2) << usbprice << "\t\t   " << "$" << (usbnumber * usbprice) << endl;
  148.     cout << "HDMI Full 1080p 6ft Cable \t "<< hdminumber << "\t\t\t" << "$" << setprecision(2) << hdmiprice << "\t\t   " << "$" << (hdminumber * hdmiprice) << endl;
  149.     cout << "Lazer Pointer \t "<< lazernumber << "\t\t\t" << "$" << setprecision(2) << lazerprice << "\t\t   " << "$" << (lazernumber * lazerprice) << endl;
  150.     cout << "Power Cord \t "<< powernumber << "\t\t\t" << "$" << setprecision(2) << powerprice << "\t\t   " << "$" << (powernumber * powerprice) << endl;
  151.  
  152.     cout << "\t\t Subtotal \t $" << subtotal << endl;
  153.     cout << "\t\t Tax \t\t $" << tax << endl;
  154.     cout << "\t\t Total \t\t $" << total << endl << endl << endl;
  155. }
  156.  
  157. }
  158.  
and here is the error, i cant figure out what to do.:

H:\finalproject.cpp(47) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.

finalproject.obj - 1 error(s), 0 warning(s)
Jan 14 '10 #1
1 1424
donbock
2,426 Expert 2GB
Line 39 opens and closes the braces for do-while.
Line 45 closes the braces for function main().
Line 47 opens a spurious brace. Is this supposed to be part of main() or the beginning of a new function?
Jan 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
0
by: IanT | last post by:
Hi I'm using Visual C++ .net I'm getting the linker error that one of my object files cant be found It seems that my compiler isnt producing .obj files (or at least not putting them in the debug...
3
by: teo | last post by:
Hallo I need to move the first char of a new line to the last position of the previous line. The char to move is always the squared bracket: ] --- Example, I have: ---
1
by: niraj | last post by:
I am getting the following error /usr/bin/ld: cant find -lutl Please advice which module i need to install .I am unable to find it . TIA Niraj
8
by: =?Utf-8?B?UmljaA==?= | last post by:
Is it possible to find the end of an If block in VB2005 -- similar to C# where in C# if you place your cursor next to a bracket and press ctrl something it highlights the ending bracket? I have...
1
by: durjoy | last post by:
dunno is the right forum to ask for help , but i cant see any category for html help . dont know any other site as well . this site is my last hope dear experts . i was hosting my site with...
2
by: emre esirik(hacettepe computer science and enginee | last post by:
struct guitar active; char *buffer_char3; while(!feof(ptdata)) { fgets(buffer,26, ptdata); fgets(buffer,26, ptdata); fgets(buffer,26, ptdata); fgets(buffer,26, ptdata); fgets(buffer,26,...
8
by: inFocus | last post by:
Hello, I am new to python and wanted to write something for myself where after inputing two words it would search entire drive and when finding both names in files name would either copy or move...
6
by: WolfgangS | last post by:
Ok first off, i am a total beginner at this groups stuff and i have no clue how this works. This is probabaly the wrong group for my problem but i will post it anyways. Learning by doing right? ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.