In this project, you will perform calculations with triangles. A triangle is defined by the x- and y-coordinates of its three corner points.
Your job is to compute the following properties of a given triangle:
- the lengths of all sides
- the angles at all corners
- the perimeter
- the area
Supply a
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Java How To Program (Early Objects)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (6th Edition)
C++ How to Program (10th Edition)
Starting Out with Java: Early Objects (6th Edition)
- Write a program that gets 2 string variables and 2 integer variables from the user, concatenates (joins them together with no space) and displays the strings, then multiplied the two numbers on a new line and displays them with two decimal points.arrow_forwardWrite a program in Java to make such a pattern like right angle triangle with number increased by 1. The size of the triangle is measured by the number of rows that will be decided by the user. For example, if the user decides to print out a 3-row right triangle, your program should print out 1 2 3 4 5 6 If the user decides to print out a 4-row right triangle, your program should print out 1 2 3 4 5 6 7 8 9 10arrow_forwardWrite a program that simulates picking a card from a deckof 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10,Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card.Here is a sample run of the program: The card you picked is Jack of Heartsarrow_forward
- When the mouse is on the first letter of a word in vim, you can capitalise it by typing x, then p. Give a full description of what happens.arrow_forwardWrite an improved version of the chaos . py program from Chapter 1 thatallows a user to input two initial values and the number of iterations, and then prints a nicely formatted table showing how the values changeover time. For example, if the starting values were . 25 and . 26 with 10iterations, the table might look like this: index 0.25 0.26----------------------------1 0 . 731250 0 . 7503602 0 . 766441 0 . 7305473 0 . 698135 0 . 7677074 0 . 821896 0 . 6954995 0 . 570894 0 . 8259426 0 . 955399 0 . 5606717 0 . 166187 0 . 9606448 0 . 540418 0 . 1474479 0 . 968629 0 . 49025510 0.118509 0 . 974630arrow_forwardWrite a Java program PrintTriangle, to print a triangle. Ask the user, how many rows you want in your triangle? Keep on asking the user to enter the number greater than 1 until he/she enters positive number greater than 1. Print them in ascending order, first row should have one plus sign, second row should have 2.....fifth row should have 5.arrow_forward
- In Java, Write a program that prompts the user to enter a full name consisting of three names (first middle last) into one String variable. Then use methods of class String to: print the number of characters in the full name, including spaces print just the middle name and the number of characters in it. print the three initials of the name print the last name in all upper case. print the full name in the usual alphabetical format (last, first middle) and proper case.arrow_forwardI need to do this in python, help. 7- create a class that represents a point on the Cartesian plane. Next, create a class that represents a triangle, reusing the previous class by composition. Finally, write a program that receives the coordinates of the triangle's vertices from the user and prints its perimeter.arrow_forwardWrite a program that prompts the user to enter a sequence of numbers until a -999 is entered. It will print the numbers the user entered, five number in a row,with a before the first number and after the last number in each row. For example, Enter a number (-999 to stop): 23Enter a number (-999 to stop): 15Enter a number (-999 to stop): 1Enter a number (-999 to stop): 7Enter a number (-999 to stop): 9Enter a number (-999 to stop): 21Enter a number (-999 to stop): 17Enter a number (-999 to stop): 33Enter a number (-999 to stop): -999[23 15.17 9] [21 17 33]arrow_forward
- Implement the design of the Travel class in python so that the following output is produced: You are not allowed to change the code below # Write your code hereprint(“No. of Traveller =”, Travel.count)print("=======================")t1 = Travel("Dhaka","India")print(t1.display_travel_info())print("=======================")t2 = Travel("Kuala Lampur","Dhaka")t2.set_time(23)print(t2.display_travel_info())print("=======================")t3 = Travel("Dhaka","New_Zealand")t3.set_time(15)t3.set_destination("Germany")print(t3.display_travel_info())print("=======================")t4 = Travel("Dhaka","India")t4.set_time(9)t4.set_source("Malaysia")t4.set_destination("Canada")print(t4.display_travel_info())print("=======================")print(“No. of Traveller =”, Travel.count) output: No. of Traveller = 0=======================Source: DhakaDestination:IndiaFlight Time:1:00=======================Source: Kuala LampurDestination:DhakaFlight Time:23:00=======================Source:…arrow_forwardWrite a Python program that draws a circle, triangle, square and octagon using Turtle graphics. The program will prompt the user how many sides each shape has. The valid sizes are: 0 - for circle 3 - for triangle 4 - for square 8 - for octagon When the user selects a number from the options above, the application will draw the shapes. Each shape is to be implemented using a method. You will also implement a main method that demonstrates each of the methods that draws each shape. If the user selects an invalid option, the program must provide an invalid response and prompt the user to enter another selection. There will be five methods in total. For example, if the user selects 0 which is the option to draw a circle, the program must prompt the user for the radius. The radius will be used to draw the circle. The program will prompt the user if they would like to add an additional shape. If they choose "Yes", the program will prompt the user for the amount of sides and draw another…arrow_forwardWrite a program that deals a number of cards (their numerical values) to a player's hand. To begin, the program asks the player for the values of the deck of cards. Then, the program deals the first two cards of the deck to a player's hand, and asks him if he wants another card. If he does not want a card, the program ends. If he wants a card, the program deals the next available card in the deck, adds it to the player's hand, and asks the player if he wants another card. The dealing process repeats as long as the user continues to accept cards, or until the cards in the deck run out. Card dealing involves copying the available card from the deck vector to another vector, which stores the player's hand, at the next available position. Assume that the deck of cards consists of only 10 cards with numerical values from 1 to 10, which the player will enter by keyboard before the program deals. The following functions must be implemented/used: enterDeckValues. - This…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education