1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DIA [1.3K]
4 years ago
15

Write a C++ program that prompt the user to enter three points (x1, y1), (x2, y2), (x3,y3) of a triangle and displays its area.

Computers and Technology
1 answer:
maxonik [38]4 years ago
5 0

Answer:

Here is the code in c++.

//include headers

#include <bits/stdc++.h>

using namespace std;

//main function

int main() {

//variables to store coordinates

float x1,x2,y1,y2,x3,y3;

cout<<"Please Enter the coordinate of first point (x1,y1): ";

// reading coordinate of first point

cin>>x1>>y1;

cout<<"Please Enter the coordinate of second point (x2,y2): ";

// reading coordinate of second point

cin>>x2>>y2;

cout<<"Please Enter the coordinate of third point (x3,y3): ";

// reading coordinate of third point

cin>>x3>>y3;

//calculating area of the triangle

float area=abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2);

cout<<"area of the triangle:"<<area<<endl;

return 0;

}

Explanation:

Declare four variables x1,x2,x3,y1,y2,y3 to store the coordinate of all three

points of circle.Read the coordinate of all the point from user.Calculate area of triangle with the help of mentioned formula area=abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2). Then print the area of the triangle.

Output:

Please Enter the coordinate of first point (x1,y1): 11 17                                                                                                      

Please Enter the coordinate of second point (x2,y2): 23 30                                                                                                    

Please Enter the coordinate of third point (x3,y3): 43 18                                                                                                      

area of the triangle:202  

You might be interested in
The first generation of computers used vaccum tubes .Why were they replaced by the transistors​
suter [353]

Answer:

hiiiiiiiiiiiiiiiiiiiiiiiiiii

7 0
3 years ago
Read 2 more answers
Which details apply to a financing contract? Check all that apply
Nina [5.8K]
Correct answer choices are:

Requires a credit check
Includes interest rate information
Requires a signature for rent-to-own agreements

Contract finance is that the name was given to a debt that's provided after signing a legal contract document that your business has won and also the cash should be accustomed to complete the contract work.
3 0
3 years ago
Read 2 more answers
NEED HELP NOW 25 POINTS WILL MARK BRAINLIEST!!!!!!!
Rudiy27
#1, Option D)filters let you filter out certain things or search for them. For example if i'm looking through a database with all the students grades. I could filter out everything that doesnt math a students name. This would only show results for what I searched for.
#2 Option C), filters make it easier to find specific information,
#3 Option A),the unwanted parts of the web are removed from sight!
#4 Option A) you must ad the sort feature first!
Have a splendid day!
6 0
3 years ago
Which statement best describes the role of folders in your operating system?
Naya [18.7K]
The statement that best describes the role of folders in your operating system is that Foldoers allow you to organize and maintain files (letter B).
Folders are useful for separating file types and folders are also useful for organizing programs or files on your personal computer. 
8 0
4 years ago
. If you had a job that Drill holes in the earth in search of water, what Career
julia-pushkina [17]

Answer:

Architecture and construction

Explanation:

4 0
4 years ago
Read 2 more answers
Other questions:
  • Give a command that will create a file named listing.dat, in your current (commandsAsst) directory, containing a list of all the
    9·1 answer
  • A(n) ____ is a system designed to handle only very basic applications with an absolute minimum amount of hardware required by th
    9·1 answer
  • How can volunteering to help plan a fundraiser for your team or club be a way to develop your strengths?
    10·2 answers
  • What are the five resources paid for by local taxes
    15·1 answer
  • ....................................................
    9·1 answer
  • Of the listed principles, which one states that multiple changes made to computer systems shouldn’t be made simultaneously?
    9·1 answer
  • modified true or false analyze each statement then write technical the statement is true the statement is false underline the wo
    6·1 answer
  • is a measurement that quantifies how much information can be transmitted over the network. A. Memory B. DMZ C. Bandwidth D. Clou
    10·1 answer
  • A camera on a tripod shows the ground floor of a skyscraper and then moves upward to show its entire length. what camera movemen
    12·1 answer
  • Select each of the steps involved in creating a table in a presentation.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!