ONLY NEED HELP ON 7 i think it might need to be in a c progr

*ONLY NEED HELP ON 7*

i think it might need to be in a c++ program but my teacher is stupid and very vague. i know how to solve this by hand without a program(i think) but could you guys solve it for me and i can compare answers. also, how can i make this into a c++ program or do you even think that would be possible?

thanks!
5.) write a CVC+ program that uses if and else if statements to calculate and display the value of the function F1-F4 where the user inputs the values of integers x and y from the keyboard for the following cases: Else if xp0 && ysmo Else if xkw0 && y

Solution

Ques 5

#include <iostream>

using namespace std;

int main()
{
int x=0, y=0;
float F1=0,F2=0, F3=0,F4=0;
cout << \"Enter the Value of X\" << endl;
cin >> x;
cout<< \"Enter the value of Y\" << endl;
cin >> y;


if(x>0 && y>0){
F1 = x*2+y*y;
}
else if (x>0 && y<0){
F2 = 3^(x-y/(x+y));
}
else if(x<=0 && y>=0)
{
F3 = (x+y)^(x*x+y*y*y)/(x+y)*(x-y);
}
else if(x<=0 && y<=0){
F4 = (x*y)/(x-y)^(x*y/3);
}
else
{

}
cout << \"F1 = \" << F1 << endl;
cout << \" F2 = \" << F2 << endl ;
cout << \"F3 = \" << F3 << endl;
cout << \"F4 = \" << F4<< endl;;
return 0;
}

Ques 6

#include <iostream>

using namespace std;

int main()
{
int a=0, b=0,c=0;
  
float F1=0,F2=0;
cout << \"Enter the value of a\" << endl;
cin >> a;
cout<< \"Enter the value of b\" << endl;
cin >> b;
cout<< \"Enter the value of c\" << endl;
cin >> c;

int d = b*b-4*a*c;

if(d>0)
cout << \"Both roots are real and unequal\" << endl;
else if (d<0)
cout << \"Both roots are complex\" << endl;
else
cout << \"Both roots are real and equal\" << endl;
return 0;
}

*ONLY NEED HELP ON 7* i think it might need to be in a c++ program but my teacher is stupid and very vague. i know how to solve this by hand without a program(i
*ONLY NEED HELP ON 7* i think it might need to be in a c++ program but my teacher is stupid and very vague. i know how to solve this by hand without a program(i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site