Write a
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):
If the user enters 1, the program should ask for the radius of the circle and then display its area. Use 3.14159 for π. If the user enters 2, the program should ask for the length and width of the rectangle, and then display the rectangle’s area. If the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. If the user enters 4, the program should end.
Input Validation: Decide how the program should handle an illegal input for the menu choice or a negative value for any of the other inputs.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 4 images
- Add Fractions problem: create in a sandbox environment. Directions: In this program you will ask the user for 4 integers that represtent two fractions. First ask for the numerator of the first and then the denominator. Then ask for the numerator and denominator of the second. Your program should add the two fractions and print out the result. For example: a sample program run might look like this, Numerator One: 1 Denominator One: 2 Numerator Two: 2 Denominator Two: 5 The sum is 9/10 //remember if you have two fractions, the following formula should be used: a/b + c/d = (a*d +b*c) / b* d public class MyProgram { public static void main(String[] args) { //Ask the user for 4 numbers. (don't forget to import your Scanner class) //create your final numerator //create your final denominator //print out your result like the example abovearrow_forwardBaby btc program - python Budget: $75,000 Make a string based bitcoin menu which shows the price of a bitcoin (pseudo random price), able to buy bitcoin with $75,000 budget (say "buy 0.5" meaning buy half of a bitcoin or "buy 3000" meaning buy $3000 worth of bitcoin), able to sell their bitcoin currently owned (using same format), can print their balance (show their current USD, the number of bitcoins they have in their wallet, and USD value of the bitcoins they have), and able to print their buy/sell transaction history.arrow_forwardoe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The program should perform the following steps: Ask the user for the diameter of the pizza in inches. Calculate the number of slices that may be taken from a pizza of that size. Display a message telling the number of slices. To calculate the number of slices that may be taken from the pizza, you must know the following facts: Each slice should have an area of 14.125 inches To calculate the number of slices, simply divide the area of the pizza by 14.125. The area of the pizza is calculated with this formula: Area NOTE: π is 3.14159. The variable r is the radius of the pizza. Divide the diameter by 2 to get the radius.arrow_forward
- A program is needed to manage sales of Super Bowl souvenir t-shirts. There are three types of shirts that we are selling: Chiefs t-shirts Eagles t-shirts Super Bowl t-shirts The t-shirts are all priced at $40 each without any customization. Input: Your program is to display a menu listing each type of shirt. It should then prompt the user for the number of Chiefs t-shirts they would like to order. After the number of Chiefs t-shirts has been entered (which may be 0), if the number was greater than 0, we will ask if they need to add lettering to the shirt (costs 1 dollar per printed letter) the program should continue displaying a prompt and reading the number to order for the other two types of t-shirts in the same way. The program also needs to keep track of the customer name and mailing address. Prompt and read the customer’s name, street address, city, state, and zip code.arrow_forwardIN VISUAL BASIC, solve: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?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