Need Help with this.

Hey Guys,
im new to programming and was working on a very simple program.

I started from scratch and managed to work my way thru the end
but now i can't seem to get the program to run.

Wanted help in fixing the errors, thanks

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
// Budget Calculating Program
// By GB
// This program will determine if the user has gone over his budget
// by taking the values provided and doing simple arithmetic calculations
// and if/else statements.

#include <iostream> // Required for cout and endl
#include <cmath> // Required for sqrt()
using namespace std;
int main()
{
// Declare variables.
double sausagepc(5), beerpc(17), total,
	sausage, beer, budget;

cout<<"The following program will help you stay within your party budget."
	<< "Enter the number of sausages: /n";
cin	>> sausage;
cout << "Enter the number of beer buckets: /n";
cin >> beer; 
cout << "Enter budget: /n";
cin >> budget;

// Computation
total = sausagepc*sausage + beerpc*beer;

// If/Else statement
If (total>budget)
{
cout << "You have gone over your budget!";
}
Else
{
cout << "You are within your budget."; 
	endl;}


return 0;
}
1) C++ is case sensitive. "if" and "else" should be lowercase.
2) Line 34 should be cout << "You are within your budget." << endl;}
3) it's "\n", not "/n"

Thank you,

I still have to get used to this case sensitive thing


It finally runs, and does what it was desgined to.

Now, quick thing,
how to i format the text so it kind of word wraps instead of having the text
go all the way accross the screen.

Im refering to Line 16,
Do i need to import another library??


Thanks again.
Never mind,
got it.

\n


Thanks
How so I add a loop at the end asking them to enter new set of numbers
Topic archived. No new replies allowed.