Rewrite the following program after removing the syntactical error(s) (if any). Underlie each correction.
#include<iostream.h>
Class Item
{
long IId,Qty;
public:
void Purchase
{
cin>>IId>>Qty;
}
} void Sale()
{
cout<<setw(5)<<IId<<'Old:'<<Qty<<endl;
cout<<'New:'<<--Qty<< endl;
}
void main()
{
Item I;
Purchase();
I.Sale();
I.Sale(0)
}
#include<iostream.h>
#include<iomanip.h>
class Item
{
long IId,Qty;
public:
void Purchase()
{
cin>>IId>>Qty;
}
} void Sale()
{
cout<<setw(5)<<IId<<'Old:'<<Qty<<endl;
cout<<'New:'<<--Qty<< endl;
};
void main()
{
Item I;
I.Purchase();
I.Sale();
I.Sale(0);
}