A school would like educational software to help students check their answers to math problems related...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
"A school would like educational software to help students check their answers to math problems related to right angle triangles. The program should allow the student to enter the adjacent and opposite sides of the right-angle triangle and output a summary of the triangle listing the lengths of the 3 sides, as well as the length of the hypotenuse, perimeter, and surface area. All number outputs should be formatted to 4 decimal places". Specifics The program will have a class with constructors, mutators (gets, sets), and at least one (or more) work method(s) to generate results or perform calculations. The first class RightAngle Triangle has had the design already created. You will need to implement the class and then create a second class called Practice3 including a method main to complete the program. The class RightAngleTriangle is listed below in a UML class diagram. RightAngle Triangle -adjacent double -opposite:double +RightAngle Triangle() +RightAngle Triangle(adjacent:double, opposite:double) +getAdjacent():double +setAdjacent(adjacent double):void +getOpposite():double +setOpposite (opposite:double):void +calculateHypotenuse():double +calculatePerimeter():double +calculateArea():double +createReport():String Practice 3 +main(args:String[]):void Questions 1. Provide an outline for methods: calculateHypotenuse(), calculatePerimeter(), calculate Area(), and calculateReport(). Include an example of each math calculation as well. Tip: The method that calculates the Perimeter, and the method that generates a String representation of the RightAngle Triangle both need the hypotenuse. Call the calculateHypotenuse() method inside of these methods, rather than re-creating the logic for calculating the hypotenuse 2. Write Pseudocode: Write pseudocode to design these methods of the class RightAngle Triangle: calculateHypotenuse(), calculatePerimeter(), calculateArea(), and createReport. Write pseudocode for the method main of the main program that includes: (1) prompt the user for inputs, (2) place data into an instance of your class, (3) provide outputs resulting from using the work methods. | 3. Create a flowchart for the above Pseudocode "A school would like educational software to help students check their answers to math problems related to right angle triangles. The program should allow the student to enter the adjacent and opposite sides of the right-angle triangle and output a summary of the triangle listing the lengths of the 3 sides, as well as the length of the hypotenuse, perimeter, and surface area. All number outputs should be formatted to 4 decimal places". Specifics The program will have a class with constructors, mutators (gets, sets), and at least one (or more) work method(s) to generate results or perform calculations. The first class RightAngle Triangle has had the design already created. You will need to implement the class and then create a second class called Practice3 including a method main to complete the program. The class RightAngleTriangle is listed below in a UML class diagram. RightAngle Triangle -adjacent double -opposite:double +RightAngle Triangle() +RightAngle Triangle(adjacent:double, opposite:double) +getAdjacent():double +setAdjacent(adjacent double):void +getOpposite():double +setOpposite (opposite:double):void +calculateHypotenuse():double +calculatePerimeter():double +calculateArea():double +createReport():String Practice 3 +main(args:String[]):void Questions 1. Provide an outline for methods: calculateHypotenuse(), calculatePerimeter(), calculate Area(), and calculateReport(). Include an example of each math calculation as well. Tip: The method that calculates the Perimeter, and the method that generates a String representation of the RightAngle Triangle both need the hypotenuse. Call the calculateHypotenuse() method inside of these methods, rather than re-creating the logic for calculating the hypotenuse 2. Write Pseudocode: Write pseudocode to design these methods of the class RightAngle Triangle: calculateHypotenuse(), calculatePerimeter(), calculateArea(), and createReport. Write pseudocode for the method main of the main program that includes: (1) prompt the user for inputs, (2) place data into an instance of your class, (3) provide outputs resulting from using the work methods. | 3. Create a flowchart for the above Pseudocode
Expert Answer:
Answer rating: 100% (QA)
Code Outline and Pseudocode 1 Method Outlines calculateHypotenuse Example a2 b2 c2 c sqrta2 b2 Pseudocode Square the adjacent and opposite sides Add the squares together Take the square root of the su... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Popsters just opened a branch in Baguio City this December 2015. Summary of transactions for the first month of operations follows: 1. Baguio Branch received P15,750 cash from home office to start...
-
Hollingsworth Personnel started business on January 1, 2014. The company produced monthly financial statements and had total sales of $500,000 (of which $400,000 was on account) during the first four...
-
In rocks of what era or eras would you expect to find fossils of (a) Horses; (b) Ferns; (c) Clams; (d) Insects; (e) Apes?
-
How many times can you define a function?
-
In the Illustrative Case in this chapter, payroll transactions for Brookins Company were analyzed, journalized, and posted for the third quarter of the fiscal year. In this problem, you are to record...
-
The specific heat of a certain type of cooking oil is 1.75 J/(g.C). How much heat energy is needed to raise the temperature of 2.92 kg of this oil from 23 C to 191 C? 9 = J
-
1. What benefits do customers receive in return for the sacrifices they make when buying a membership at Planet Fitness? 2. How does this benefit-sacrifice ratio give Planet Fitness a competitive...
-
Compare and contrast each of the following types of systems, and support each type separately with a use of an example: Real-time systems Data-processing systems Decision-support systems Expert...
-
Pick two of the following challenging situations. Start a discussion and describe how you would respond assertively in each of those two situations. Here are the four situations to choose two from: A...
-
Which communication is better upward communication or downward communication in criminal justice?
-
Question content area top Part 1 The Bretton Woods exchange rate system was an example of a Question content area bottom Part 1 A. modified gold standard. B. floating exchange rate system. C. managed...
-
1. What is downward communication? 2. What is the role of technology in organizational behaviour?
-
Answer of the following questions . Identify or explain briefly 1. attributes of useful information 2. MI 3.real-time information 4information overload 5. big data 7. cybersecurity 8. CRM 9. total...
-
Samantha, CPA, has been assigned to audit the accounts receivable and inventory of Tasty Treats Inc., a large distributor of food products (canned goods, rice, frozen foods). Tasty Treats Inc. has a...
-
How does health insurance risk differ from other types of insurance risk (e.g., automobile or homeowners insurance)? What is the difference between cost sharing and cost shifting? Is retiree health...
-
Identify a situation where a firm competes with another firm but the two firms also have a strategic alliance or joint venture. Explain why situations such as this exist.
-
Youre a middle manager in a small manufacturing plant. Today is Monday, and youve just returned from a weeks vacation. The first thing you discover is that your assistant wont be in today (his aunt...
-
At Univision, a manager was having trouble communicating because of always sitting behind a large desk. Recall and discuss an office or home you may have been in recently that communicated specific...
-
Which of the following types of epigenetic changes may promote cancer? a. DNA methylation b. Covalent modification of histones c. Chromatin remodeling d. All of the above may promote cancer.
-
The underlying cause(s) of epigenetic changes associated with cancer may be a. mutations in genes that encode chromatin-modifying proteins. b. environmental agents that alter the function of...
-
Normal (nonmutant) tumor-suppressor genes often function a. as negative regulators of cell division. b. in the maintenance of genome integrity. c. in the stimulation of cell division. d. as both a...
Study smarter with the SolutionInn App