Tanong ko lang po sana kasi kapag tinatype ko ang 1 sa choice dito sa output ko hindi niya tinatawag yung addition()
ps: hidepost ko na po muna, may nakikita kasi akong student dito na ka same school ko na leechers, for safety nadin po and para hindi mareport sa instructor ehe
eto code ng menu ko
yung pinapatawag ko naman na addition()
sana po mapansin kung ano remediyong pwede kong gawin para matawag niya yung addition()
ps: hidepost ko na po muna, may nakikita kasi akong student dito na ka same school ko na leechers, for safety nadin po and para hindi mareport sa instructor ehe
eto code ng menu ko
menu.h
C++:
#include <iostream>
using namespace std;
int MENU()
{
cout << "====================== MAIN MENU ======================\n";
cout << "What function do you want to perform? \n";
cout << "1 - ADDITION\n";
cout << "2 - SUBTRACTION\n";
cout << "3 - MULTIPLICATION\n";
cout << "4 - DIVISION\n";
cout << "5 - GET AVERAGE\n";
cout << "6 - 100 MULTIPLES OF A NUMBER\n";
cout << "7 - POWER OF A NUMBER\n";
cout << "8 - EXIT\n";
cout << "========================================================\n";
int choice=0;
while (choice <8)
{
cout << "Press 1 to 8 only: ";
cin >> choice;
if (choice >= 1 && choice < 8)
{
break;
}
else
{
cout << "Invalid Input. ";
}
}
return 0;
}
yung pinapatawag ko naman na addition()
arithmetic.h
C++:
int addition()
{
cout << "======================= ADDITION =======================\n";
int n, num, sum=0;
cout<<"How many numbers you want to input? ";
cin>>n;
for(int i=0; i<n; i++)
{
cout << i+1 << ". ";
cin>>num;
sum = sum+num;
}
cout<<"\nSum of the "<<n<<" numbers you entered is "<<sum;
cout<<endl;
return 0;
}
sana po mapansin kung ano remediyong pwede kong gawin para matawag niya yung addition()