C++ HELP, I can get the program running, but I can figure out how to add things together from a inFi

 Dont Buy Textbooks. Rent 'EM Save 60-80%



#include <iostream>

#include <fstream>

using namespace std;

int main ()

{ double sum;

int count ;

int val;

ifstream infile;

char a,b,c;

infile.open ("p3_data.txt");

if (infile.is_open())

{

while (infile.good())

cout << (char) infile.get();

infile.close();

}

else

{

cout << "Error opening file\n";

}

cout << "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...

cout << "\nPlease enter either A, B, or C to be calculated!\n";

cin >> a>>b>>c;

cout << "\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-...

cout << "The bills add up to "<<endl;

system("pause");

return 1;

}

/*My program is only adding up 3 different things A B C. I can do everything else I just cant figure this one out. */

Thanks for the help

C++ HELP, I can get the program running, but I can figure out how to add things together from a inFile.?c++ class



I'm not exactly sure about what you are trying to do, but if you are trying to add up three numbers, each separated by spaces, one per line, then this might get you started:

#include <iostream>

#include <fstream>


FirstPrevious12NextEnd

More Related Questions and Answers ...
  • My c++ program is a basic one but i get this ..
  • Need some C++ help?
  • C++, finding mode. It works - but is there an..
  • What is wrong with this c++ code?
  • This prog is suppsed to read an input file co..
  • Can any one here to tell .how i can add star ..
  • Compilation error in DEV C++?
  • Write a c++ program to print "hello"..
  • I live out in the country & have dial up ..
  • C++ Programming?
  • Given the variable initializations " C++..
  • Please people help me with this c++ codes?
  • Choose the C++ statement which is equivalent ..
  • Intro c++ question?
  • How can I make letters instead of numbers app..
  • If(condition)cout<<"hello";el..
  • Another question about c++?
  • C++ Help Please.?
  • Output of a C++ program?

  • The information post by website user , we not guarantee correctness.

    

    Dental Treatment Skin Whitening Skin Problems Skin Rashes Shoes