Welcome to Dream.In.Code
Become a C++ Expert!

Join 136,896 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,720 people online right now. Registration is fast and FREE... Join Now!




I revised it and it still not working plz help

 
Reply to this topicStart new topic

I revised it and it still not working plz help

tinab
31 Mar, 2008 - 03:19 PM
Post #1

New D.I.C Head
*

Joined: 27 Mar, 2008
Posts: 5

# include <iostream>
# include <fstream>
// add additional header files you use
using namespace std ;

int main()
{
// Declare file stream variables

ifstream inData;
int ticketPrice, ticketsSold, ticketTotal;
double totalSale;
//Open the files

inData.open("data.text");//open the input file;


//code for data manipulation
//loop



ticketPrice = inData.open("data.text");
ticketsSold = inData.open;
ticketTotal = ticketsSold;
totalSale = ticketPrice * ticketsSold;

ticketPrice = inData.open;
ticketsSold = inData.open;
ticketTotal = ticketsSold;
totalSale += ticketPrice * ticketsSold;

ticketPrice = inData.open;
ticketsSold = inData.open;
ticketTotal += ticketsSold;
totalSale += ticketPrice * ticketsSold;

ticketPrice = inData.open;
ticketsSold = inData.open;
ticketTotal += ticketsSold;
totalSale += ticketPrice * ticketsSold;



cout<<"Total Sales " + totalSale;
cout<<"Total Tickets Sold " + ticketTotal;




//close files

inData.close();


// output the totals

//Pause the system so the user can see the output
system ("Pause");

return 0;
} // end of main


User is offlineProfile CardPM
+Quote Post

tinab
RE: I Revised It And It Still Not Working Plz Help
31 Mar, 2008 - 03:32 PM
Post #2

New D.I.C Head
*

Joined: 27 Mar, 2008
Posts: 5

I DiD a little more revising and still cant get it to work



# include <iostream>
# include <ifstream>
// add additional header files you use
using namespace std ;

int main()
{
// Declare file stream variables

ifstream inData;
int ticketPrice, ticketsSold, ticketTotal;
double totalSale;
//Open the files

inData.open("data.text");//open the input file;


//code for data manipulation
//loop



ticketPrice = inData.open("data.text");
ticketsSold = inData.open;
ticketTotal = ticketsSold;
totalSale = ticketPrice * ticketsSold;

ticketPrice = inData.open;
ticketsSold = inData.open;
ticketTotal = ticketsSold;
totalSale += ticketPrice * ticketsSold;

ticketPrice = inData.open;
ticketsSold = inData.open;
ticketTotal += ticketsSold;
totalSale += ticketPrice * ticketsSold;

ticketPrice = inData.open;
ticketsSold = inData.open;
ticketTotal += ticketsSold;
totalSale += ticketPrice * ticketsSold;



cout<<"Total Sales " + totalSale;
cout<<"Total Tickets Sold " + ticketTotal;




//close files

inData.close();


// output the totals

//Pause the system so the user can see the output
system ("Pause");

return 0;
} // end of main















User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/3/08 09:26PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month