Question: Fix this code, C + + . # include using namespace std; / / pre - processing int main ( ) { / / Briayan

Fix this code, C++.# include
using namespace std;
//pre - processing
int main()
{
// Briayan Student, Programmer
// Program that computes the area of a triangle
// declare and initialize the variables
double area =0, base =0, height =0;
//[Input] request and receive variable values
cout <<"
please enter the base ";
cin >> base;
cout <<"
please enter the height ";
cin >> height;
object height = null;
//[Process] perform any required variable assignment
area =0.5* base * height;
//[Output] display values to the program user
cout <<"
A triangle with base "<< base;
cout <<" and height "<< height;
cout <<"
";
cout <<"
has an area of "<< area;
cout <<" square units." << endl << endl;
cout << "press [Enter] to close this window
";
system("pause"); // Windows command
return 0;
}
#include
using namespace std;
// pre processing directive(s)
int main()
{
// Program that computes the area of a trapezoiddouble area =0, base1=0, base2=0, height =0;
Also, modify your input statements to include both bases.
cout <<"
please enter the base 1";
cin >> base1;
cout <<"
please enter the base 2";
cin >> base2;
cout <<"
please enter the height ";
cin >> height;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!