The third annual Blue Bridge Cup Javac Group _ Land Surveying

Source: Internet
Author: User

/* (Start of program header comment)

* Copyright and version Declaration section of the program

* Copyright (c) 2016, Guangzhou Science and Technology Trade Vocational College, Department of Information Engineering students

* All rights reserved.

* File name: Blue Bridge Cup title

* Author: Pengjunhau

* Completion Date: April 01, 2016

* Version number: 001

* Description part of task and solution method

* Input Description: None

* Description of the problem:

There are many reasons for high prices, such as land transfer prices. Given the high land price, the area of the land must be calculated carefully. Unfortunately, some plots are irregularly shaped, such as the Pentagon shown in "1.jpg".

It is generally necessary to divide it into multiple triangles to calculate.

It is known that triangular areas need to be made with Helen's theorem, see "2.jpg"

The data for each edge length is as follows:
AB = 52.1
BC = 57.2
CD = 43.5
DE = 51.9
EA = 33.4
EB = 68.2
EC = 71.9

* Program output: Based on these data, the area of Pentagon plots is calculated. Rounded to a decimal after two bits. Write only the results, do not source code!

* End of comment on the program head

*/

On the code:

public class Main {

public static void Main (string[] args) {
Double K1 = (33.4+68.2+52.1)/2;
Double NUM1 = math.sqrt (k1* (k1-33.4) * (k1-68.2) * (k1-52.1));

Double K2 = (71.9+68.2+57.2)/2;
Double num2 = math.sqrt (k2* (k2-71.9) * (k2-68.2) * (k2-57.2));

Double K3 = (71.9+51.9+43.5)/2;
Double num3 = math.sqrt (k3* (k3-71.9) * (k3-51.9) * (k3-43.5));

Double num = num1+num2+num3;

System.out.printf ("%.2f", num);

}

}

The third annual Blue Bridge Cup Javac Group _ Land Surveying

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.