using namespace std; struct weightType{ int pounds; int ounces; }; weightType ge
ID: 3618142 • Letter: U
Question
using namespace std;
struct weightType{
int pounds;
int ounces;
};
weightType getWeight();
weightType addWt (weightType, weightType);
int main()
{
weightType one,
two;
getWeight();
addWt(one,two);
system("pause");
return 0;
}
weightType getWeight()
{
weightType one,
two;
cout << endl << endl<<"Weight 1 is: " <<one.pounds << " pounds "<< one.ounces << "ounces." << endl;
cout <<"Weight 2 is: " << two.pounds << " pounds "<< two.ounces << "ounces." << endl;
weightType addWt (weightType one, weightTypetwo)
{
weightType three;
three.pounds = one.pounds + two.pounds;
three.ounces = one.ounces + two.ounces;
cout <<"Weight 3 (sum) is: " << three.pounds << " pounds "<< three.ounces << "ounces." << endl <<endl;
return three;
}