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]
3 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]3 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
A simple system is to be designed to allow for the selling of old books. There are two different types of users: buyers and sell
VMariaS [17]
Yes yes yes yes yeah yes
7 0
3 years ago
Robert's computer is not starting due to an error in the BIOS. Which of these chips could have malfunctioned? Select the correct
timofeeve [1]

Hi;

In the question, Robert gives the explanation that there is an error in the BIOS. A BIOS (Standing for Basic Input & Output System) is a ROM chip, and is vital for the computer to initialize devices such as RAM, the CPU, etc. If there is ever an error there, a computer simply cannot boot.

From the options given, your answer given would be C. ROM.

I hope this helps!

8 0
3 years ago
Which windows utility should you use to organize the files on your disk to improve efficiency?
olga55 [171]

<span>Disk Defragmenter, is a windows utility that rearranges the records and unused space on the PC's hard disk so that the operating system accesses data more rapidly and projects run quicker. Disk Defragmenter keeps running on a timetable, yet you can likewise break down and defragment your disk and drives manually.</span>

7 0
3 years ago
If you are writing an algorithm and you aren’t confident that you understand the problem, what can you do?
Zigmanuir [339]

Answer:

divide it into smaller pieces

Explanation:

Usually, the main reason a programmer does not understand a problem fully is that there is too much information. The best way to try and fully understand a problem is to divide it into smaller pieces. Start off by answering the question what is the expected output for an input. Then divide each individual issue within the problem. This will allow you as a programmer/developer to create an individual solution for each individual issue within the problem and then test to make sure that the input gives the correct output.

8 0
2 years ago
Scanner can be used to read tokens from a String literal Scanner can be used to read tokens from the console window (user input)
Paladinen [302]

Answer:

Scanner can be used to read tokens from the console window (user input)

Explanation:

Scanner is a class used in some programming languages to obtain inputs from users.

It is mostly well developed in Java programming language and used exclusively for taking and obtaining inputs.

Scanner takes input in primitive types such as doubles, floats and integers. IT also takes string inputs.

Here is a code snippet where the class scanner is used:

         Scanner input = new Scanner (System.in)

The code above creates an object of the scanner class

7 0
3 years ago
Other questions:
  • Which organizational pattern would probably be most effective for arranging the main points of a speech with the specific purpos
    15·1 answer
  • If an ARQ algorithm is running over a 40-km point-to-point fiber optic link then:
    12·1 answer
  • A technician is using a network-attached desktop computer with a Type 2 hypervisor to run two VMs. One of the VMs is infected wi
    14·1 answer
  • . double x = 5; declares that x is a...............variable.
    14·1 answer
  • An application with which you can perform calculations on numbers and work with other data
    8·1 answer
  • The language C was originally developed by​
    11·2 answers
  • George works for a print newspaper in which of these areas would you be interested to hire new recruits for the newspaper WHICH
    11·1 answer
  • A computer is performing a binary search on the sorted list of 7 numbers below. What is the maximum number of iterations needed
    15·1 answer
  • Which layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for delivering data between two
    12·1 answer
  • What is a distinguishing feature of 5G mmWave
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!