Outs won't work

So I have most of the code working but I can't seem to get it to send out
to the text page. So if there's something I'm missing with my outs please help.
Very beginner, so if there are other errors I made that help would be great too.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
  /******************************************************************************
   File: Menu_Order.cpp            CISC 175           Author: William Cogswell
   
   This Program will run as a way to keep track of menu items purchased
   throughout a day. The Prgram will keep track of how many of each item was
   purchased as well as the total amount spent on each item as well as 
   the total income from all the items purchased. The user can only enter 
   numbers 1-5 with zero closing the program for the day and giving you totals.
   The prgram runs as a do while loop continuing to take orders so long that
   the user does not enter zero, which closes the program. 
*******************************************************************************/

#include<iostream>
#include<cstdlib>
# include <fstream>
# include <iomanip>
# include <ctime>


using namespace std;

int main()
{
            
      double Total_Price;
             
      int Item,
          count_bw = 0,
          count_sb = 0,
          count_is = 0,
          count_sn = 0,
          count_vs = 0;
                 

string name;

cout<<"This Program will run as a way to keep track of menu items purchased\n";
cout<<"throughout a day. The Prgram will keep track of how many of each item was\n";
cout<<"purchased as well as the total amount spent on each item as well as\n";
cout<<"the total income from all the items purchased. The user can only enter\n";
cout<<"numbers 1-5 with zero closing the program for the day and giving you totals.\n";

cout<<"Please Enter Customer's Name:\n";
cin>>name;

cout<<"\n\nPlease Enter Order Numbers for Customer "<<name<<" :\n\n";

do
{
  cin>>Item;
  
  if (Item == 1)
  {
     cout<<"\nAdding one ""Buffalo Chicken"" to order for "<<name<<"\n\n";
     (Total_Price = Total_Price + 6.95);
     (count_bw = count_bw + 1);
  }
  else if (Item == 2)
  {
     cout<<"\nAdding one ""Super Burger"" to order for "<<name<<"\n\n";
     (Total_Price = Total_Price + 5.75);
     (count_sb = count_sb + 1);
  }
  else if (Item == 3)
  {
     cout<<"\nAdding one ""Italian Sandwich"" to order for "<<name<<"\n\n";
     (Total_Price = Total_Price + 7.25);
     (count_is = count_is + 1);
  }
  else if (Item == 4)
  {
     cout<<"\nAdding one ""Shrimp Nuggets"" to order for "<<name<<"\n\n";
     (Total_Price = Total_Price + 8.95);
     (count_sn = count_sn + 1);
  }
  else if (Item == 5)
  {
     cout<<"\nAdding one ""Veggie Supreme"" to order for "<<name<<"\n\n";
     (Total_Price = Total_Price + 4.95);
     (count_vs = count_vs + 1);
  }
  else
  {
         cout<<"\nYou have a number that does not have a menu item\n";
         cout<<"assigned to it, please try again\n\n";
  }

}
while (Item != 0);

cout<<"Your total Order was $"<<Total_Price<<setprecision(2)<<" for customer "<<name<<"\n\n";
cout<<"There were "<<count_bw<<" Orders of Buffalow Wings\n";
cout<<"There were "<<count_sb<<" Orders of Super Burgers\n";
cout<<"There were "<<count_is<<" Orders of Italian Sandwiches\n";
cout<<"There were "<<count_sn<<" Orders of Shrimp Nuggets\n";
cout<<"There were "<<count_vs<<" Orders of Veggie Supremes\n\n";


  outs.open("Food.txt",ios::app);  
  outs<<fixed<<showpoint;
  
  outs<<" Daily Summary For Customer "<<name<<"\n";
  outs<<"==============="<<endl;
  outs<<"      Item                 Quantity      Unit Price      Amount of Sale"<<endl;
  outs<<"----------------          ----------    ------------    ----------------"<<endl;
  outs<<setw(16)<<left<<"Buffalo Wings"<<right<<setw(15)<<setprecision(0)<<count_bw<<
      right<<setw(15)<<"$6.95"<<right<<setw(18)<<"$"<<setprecision(2)
      <<(6.95*count_bw)<<endl;
      
  outs<<setw(16)<<left<<"Super Burger"<<right<<setw(15)<<setprecision(0)<<count_sb<<
      right<<setw(15)<<"$5.75"<<right<<setw(18)<<"$"<<setprecision(2)
      <<(5.75*count_sb)<<endl;
      
  outs<<setw(16)<<left<<"Italian Sandwich"<<right<<setw(15)<<setprecision(0)<<count_is<<
      right<<setw(15)<<"$7.25"<<right<<setw(18)<<"$"<<setprecision(2)
      <<(7.25*count_is)<<endl;
      
  outs<<setw(16)<<left<<"Shrimp Nuggets"<<right<<setw(15)<<setprecision(0)<<count_sn<<
      right<<setw(15)<<"$8.95"<<right<<setw(18)<<"$"<<setprecision(2)
      <<(8.95*count_sn)<<endl;
      
  outs<<setw(16)<<left<<"Veggie Supreme"<<right<<setw(15)<<setprecision(0)<<count_vs<<
      right<<setw(15)<<"$4.95"<<right<<setw(18)<<"$"<<setprecision(2)
      <<(4.95*count_vs)<<endl;
    
  outs.close();  

    system("PAUSE");

    return 0;
}
Does your loop work? You're not clearing the cin buffer after you get the file name: http://www.cplusplus.com/forum/articles/6046/
Topic archived. No new replies allowed.