I very new to C++ and am almost done with a project I am working on but I just have two bugs that need to be corrected there is some kind of error in the break and sum, and I cant figure out how to correct them. Please Help!
I am working on a program to compute the percent of the batches rejected due to pressure, due to temperature and the percent rejected due to dwell time.
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include<cmath>
using namespace std;
Please edit your post to use code tags (the <> formatting button). It makes it easier to read your code and also makes it easier to respond to your post.
Well I'm unable to compile and command prompt is telling me the sum was not declared in this scope, also that the break statement is not within loop, and its says my "dwellfail" inst declared. However I am not sure how to correct these problems. Thanks!!
if you still have them after fixing the for loops, then post them in full.
Have you fixed the for loops?
When you have compile errors - you should be able to copy them to the clipboard - then you can paste them here in full.
Have you thought about using an IDE (Integrated Development Environment)? Compiling from the cmd line is good to know, but it can be a very hard road for beginners. There are lots of free IDE's for various operating systems.
Thanks for the help with the loops! I was able to get the program to compile, however when I'm in the program (the .exe) and type in the .dat file i want, I don't receive any output from the program
Line 22: Shouldn't you be opening filename ?
Line 28: Why is it there? The ; after the if causes it not to do anything.
You only read a single line of input at line 34. That's going to fail if you input file has the blank lines and columns headers shown in the Dat file you posted.