Need help with this program

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
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include <iomanip>
using namespace std;

int calcBalance(int invStart, int copRecieved, int copSold);

void displayOutput(int idNum, int invStart, int copReceived, int copSold, int newBalance);

int main(void)
{
	int idNum, invStart, copReceived, copSold, newBalance;

	cout << "Please enter an ID number: ";
	cin >> idNum;
	cout << "What is the inventory balance at the beginning of the month? ";
	cin >> invStart;
	cout << "What is the number of copies recieved? ";
	cin >> copReceived;
	cout << "Number of copies sold? ";
	cin >> copSold;

	newBalance = calcBalance(invStart, copReceived, copSold);

	displayOutput(idNum, invStart, copReceived, copSold, newBalance);

	return 0;
}

int calcBalance(int invStart, int copRecieved, int copSold)

{
	int newBalance;

	newBalance = invStart + copRecieved - copSold;

	return newBalance;

}

void displayOutput(int idNum, int invStart, int copReceived, int copSold, int newBalance)
{

	cout << "\n********************" << endl;
	cout << "*Book Ends: January*" << endl;
	cout << "********************" << endl;
	cout << "\nID# " << setw(20) << "Inventory Start" << setw(15) << "# recieved" << setw(10) << "# Sold" << setw(20) << "New Inventory" << endl;
	cout << "\n" << idNum << setw(5) << " " << invStart << setw(17) << " " << copReceived << setw(12) << " " << copSold << setw(10) << " " << newBalance << endl;

	return;
}


This is how it looks

Please enter an ID number: 1111
What is the inventory balance at the beginning of the month? 100
What is the number of copies recieved? 25
Number of copies sold? 110

********************
*Book Ends: January*
********************

ID#      Inventory Start     # recieved    # Sold       New Inventory

1111     100                 25            110          15
Press any key to continue . . .


I need to add a new column named message and under it, it needs to display whether the new inventory is "positive" or "negative". It has to do with the if Statement but i just don't know where to place it. THANKS
Topic archived. No new replies allowed.