Delete the group of variables that you put before main (that's not where to put them). Leave the ones that you still have inside main, but look closely at the punctuation. Maybe delete those comments to see it better.
Later on in your code (before all the couts at the end) you are missing semicolons at the end of your lines.
And if you post code again, make sure you put it in [code][/code] tags.
Learning how to deal interpret compiler errors is an important tool to have.
Compiler errors will often point to a line where it thinks something went wrong. It's usually helpful to start looking at that line. Also, if you have multiple errors, always start with the first one in the list.
14:1: error: 'prnt_cost' does not name a type
1 2 3 4 5 6 7 8 9
int prnt_num;
double reprnt_num;
prnt_cost, // reprnt_num * prnt_num
bal_due, // prnt_total * PRINT_RATE
tax_amt, //prnt_total*TAX_RATE tot_cost, //rental_costtax_amt
prnt_num // number of prints
reprnt_num // number of reprints
char name[30], // customer name (first and last)
date[12], // format mm/dd/yyyy
I think you're confusing yourself by trying to make all these variable declarations part of the same statement.
Just declare each variable you need on its own line.
1 2 3 4 5 6 7
int prnt_num;
double prnt_cost; // reprnt_num * prnt_num
double bal_due; // prnt_total * PRINT_RATE
double tax_amt; //prnt_total*TAX_RATE tot_cost, //rental_costtax_amt
int reprnt_num; // number of reprints
char name[30]; // customer name (first and last)
char date[12]; // format mm/dd/yyyy
It also looks like you're declaring variables more than once. A variable should only be declared once in the same scope.
reprnt_num
Your keyboard isn't dying, you don't need to unnecessarily leave out vowels. reprint_num is much easier to reach, and search for (search for all instances of "print" for example).
base_cost =reprnt_num * prnt_num
In function 'int main()':
38:1: error: 'base_cost' was not declared in this scope
23:14: warning: unused variable 'TAX_RATE' [-Wunused-variable]
I changed everything you suggested, but it is still coming up with errors I don't know how to fix lol. Like "an unqualified-id before 'int' and "reprint_num isn't declared" in my input section
Show your current code along with the exact error messages. Then maybe someone might be able to help you understand what the compiler/linker is saying about your code.
At line 29, the error is "expected unqualified-id before 'char" and at line 49 the error is "reprint_num was not declared in this scope." I checked the punctuation and I can't find anything, but besides that I don't know what else to do. And I updated the code so it's exactly what I have currently.
Put your code in code tags so we can see it and check it more easily. Like this: [code]
your code here [/code]
You still have a comma where it should be a semicolon in your declarations.
And you didn't fix the missing semicolons I mentioned on the lines in your "process section".
It's saying it expects a ; before bal_due. If you were to put a ; before bal_due, that particular error would go away.
But what it's actually saying is that you forgot to end the previous line with a ;.
You need to end the line before the line where you have bal_due (line 40) with a ;
Apply this to the other statements where you forgot a ; on as well (lines 40-43).
So all of the errors are gone, but I'm not able to input the print number and reprint numbers that I need. I'm not sure if the ';' are stopping this but as soon as I enter the "customer name", it skips directly to the end.
Your comment for name states "// customer name (first and last)". You (a) never fill in a value for name, and even if you were to, (b) the use of std::cin >> name; doesn't allow for spaces.
What I would rather do is use getline to handle user string input safely. This also prevents the user from overflowing your buffer (30 characters for name, 12 for date) (although more logic would be necessary to properly prevent bad data).
Another caveat... not an issue with your code, but in the future, note that if you use getline after using cin >>, you need to add a cin.ignore(); call before the getline call to erase the remaining previous newline in cin's buffer. A bit annoying.
Now the issue I'm having is that the "tax.amt" isn't doing the calculation. I had to remove the double because it made the program work incorrectly. The equation to me and the program as a whole looks okay, but I don't know what's stopping the "tax.amt" function when everything else is working fine.
There's no such thing as a "tax.amt function" in your program. It's important to know the correct terminology so that we can communicate efficiently.
tax_amt is a variable, and a value (perhaps from a calculation) is assigned to it.
What do you mean by "it isn't doing the calculation"? When I run your program, it is definitely showing me a value for tax_amt.
Enter Today's Date: 1/2/3
Enter Customer Name: Buddy H
Enter The Print Number: 3
Enter the Reprint Number: 5
MOREPRINTS Photo Store
~~~~~~~~~~~~~~~~~~~~~~~~~
Date 1/2/3
Customer Buddy H
Photos In 3
Reprints Ordered 5
Total Reprints 15
Price/Reprints 0.50
Reprint Cost 7
Tax Amount 1
Total Cost 8
If you're wondering why it's cutting off the digits after the decimal place, that's because you have bal_due, tot_cost, and tax_amt as int types. An int can't store non-integer numbers.
Change it back to a double and then explain what's actually wrong.