hey, i finally figured out my Code, but i need to export the answerto an externa
ID: 3617105 • Letter: H
Question
hey, i finally figured out my Code, but i need to export the answerto an external File. the teacher posted an older code aboutexporting files, but when i run it in the C++, the program failsbecause of old headers (and the program itself does not really seemto do anything)if this is my code, how would i export the very last line to afile? thanks alot.
also, what is the difference if i float all my Int and doubles, orif i use the code as below?
*/
#include <iostream>
using namespace std;
int main()
{
int D, DX, DY, A1, A2, B1, B2, C1, C2;
double DX_Dem, DY_Dem;
cout<<"Please Enter a1:"; //Prints prompt to user
cin>>A1; // reads input from user
cout<<"Please Enter b1: ";
cin>>B1;
cout<<"Please Enter c1: ";
cin>>C1;
cout<<"Please enter a2: ";
cin>>A2;
cout<<"Please enter b2: ";
cin>>B2;
cout<<"Please Enter c2: ";
cin>>C2;
D=(A1*B2)-(A2*B1); // performs calculations and stores results
DX=(C1*B2)-(C2*B1);
DY=(A1*C2)-(A2*C1);
cout<<"D = "<< D<< endl; // prints output
cout<<"D(x) = "<< DX <<endl;
cout<<"D(y) = "<< DY <<endl;
DX_Dem=DX/(double)D;
DY_Dem=DY/(double)D;
cout<<"X = "<< DX<<"/"<<D <<" = "<< DX_Dem << endl; // printsoutput
cout<<"Y = "<< DY<<"/"<<D <<" = "<< DY_Dem << endl;
cout<<"Solution Set is {("<< DX_Dem<<","<< DY_Dem <<")}"<< endl;
system("pause");
return 0;
}
Explanation / Answer
please rate - thanks what is the difference if i float all my Int and doubles, or if iuse the code as below? it would make no difference. for this code. I would leave it as itis #include #include using namespace std; int main() { int D, DX, DY, A1, A2, B1, B2, C1, C2; double DX_Dem, DY_Dem; ofstream out; coutA1; coutB1; coutC1; coutA2; coutB2; coutC2; D=(A1*B2)-(A2*B1); DX=(C1*B2)-(C2*B1); DY=(A1*C2)-(A2*C1); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.