subject

Design a Geometry class with the following methods: A static method that accepts the radius of a circle and returns the area of the circle. Use the following formula: A r e a = π r 2 Use Math. PI for π and the radius of the circle for r. A static method that accepts the length and width of a rectangle and returns the area of the rectangle. Use the following formula: A r e a = L e n g t h × W i d t h A static method that accepts the length of a triangle’s base and the triangle’s height. The method should return the area of the triangle. Use the following formula: A r e a = B a s e × H e i g h t × 0.5 The methods should display an error message if negative values are used for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. Next, write a program to test the class, which displays the following menu and responds to the user’s selection: Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1-4): Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
Write a program that takes in 3 inputs [players (int type), expected game time (double type), team (char type)] and calculates actual game time (double) based on the following conditions: if the number of players or the expected game time is less than or equal to zero, it should output wrong input if the number of players is greater than 0 and less than or equal to 6 and if they are on the â€r’ or â€r’ team, their game time will be 10% faster. and if they are on the â€b’ or â€b’ team, their game time will be 15% faster. and if they are on the â€y’ or â€y’ team, their game time will be 20% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 6 but less than or equal to 12 and if they are on the â€r’ or â€r’ team, their game time will be 20% faster. and if they are on the â€b’ or â€b’ team, their game time will be 25% faster. and if they are on the â€y’ or â€y’ team their game time will be 30% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 12 but less than or equal to 18 and if they are on the â€r’ or â€r’ team, their game time will be 30% faster. and if they are on the â€b’ or â€b’ team, their game time will be 35% faster. and if they are on the â€y’ or â€y’ team, their game time will
Answers: 2
question
Computers and Technology, 22.06.2019 09:00
What is one way in which tablets differ from laptops and notebooks? tablets are designed for touch-based interaction. tablets are designed to be used as desktops. tablets are designed for input via a keyboard and mouse. tablets are designed to be larger than laptops.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
You know the right answer?
Design a Geometry class with the following methods: A static method that accepts the radius of a cir...
Questions
question
Mathematics, 20.03.2021 02:40
question
Mathematics, 20.03.2021 02:40
question
Mathematics, 20.03.2021 02:40
question
Mathematics, 20.03.2021 02:40
Questions on the website: 13722363