For a project we are doing in class it involves fractions and since im begging im a little confused on the if/else statements. What im basicly trying to make it do is say if the wholenumber = 0 then just display the fraction but if the numerator = 0 then display just the whole number. It is doing it right but its displaying the fraction first and then the whole number. I know the reason its doing that is because im making two if statements and its telling it to check if the wholenumber is 0 and display the fraction and then checking to see if numerator is 0 and display the fraction. What i want it to do is to check to see if wholenumber = 0 to just show fraction but if the numerator is to just display the wholenumber. Anyways any help would be appreciated and i don't know if its confusing or not to you but im just not getting it.
Also another thing is when I display the calculations i want it to display the fractions like say 2/3 + 2/3= 4/3 not just 1.3333-
Any help will be appreciate and im not looking for an answer or code just need some help on the way im thinking or maybe im missing something.
cout<<"Enter a whole number and then enter a fraction separating the numerator from the denominator by a space"<<endl;
cin>>wholenumber2>>bFraction.numerator>>bFraction.denominator;
cout<<"Your two numbers added together: " <<calculation<<endl;
cout<<"Enter a fraction separating the numerator from the denominator by a space"<<endl;
cin>>wholenumber3>>cFraction.numerator>>cFraction.denominator;