Write a program that calculates and displays the area of a triangle based on the user...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that calculates and displays the area of a triangle based on the user input values of the base and the height of a triangle. Area 2 (base) (height) a height b base Make sure your program asks the user his/her full name and then greet the user. After that, tell the user what the program is all about. The program will then ask the user to enter the base and the height of a triangle. The program will calculate and print the area of the triangle. Make sure to test your program with different input values. Your program should reject zero or negative numbers. Below is an example of a running program: Welcome to my program. Please enter your full name: Jane Doe Hello, Jane Doe This program will ask you to enter the base and the height of a triangle. The program will calculate and print the area of the triangle. Enter base of triangle: 7.5 Enter height of triangle: 10.2 The area is: 38.25 Thank you and have a nice day. Good bye! Write a program that calculates and displays the area of a triangle based on the user input values of the base and the height of a triangle. Area 2 (base) (height) a height b base Make sure your program asks the user his/her full name and then greet the user. After that, tell the user what the program is all about. The program will then ask the user to enter the base and the height of a triangle. The program will calculate and print the area of the triangle. Make sure to test your program with different input values. Your program should reject zero or negative numbers. Below is an example of a running program: Welcome to my program. Please enter your full name: Jane Doe Hello, Jane Doe This program will ask you to enter the base and the height of a triangle. The program will calculate and print the area of the triangle. Enter base of triangle: 7.5 Enter height of triangle: 10.2 The area is: 38.25 Thank you and have a nice day. Good bye!
Expert Answer:
Answer rating: 100% (QA)
Algorithm Greet the User Ask the user for their full name and greet them Expl... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these algorithms questions
-
In writing his name, Tomas is holding a pencil between his thumb and forefinger, while his younger sister Tia is scribbling with a pencil by holding the pencil with her palm and outer fingers pressed...
-
Your task is to build upon your calendar from Assignment 1 to fix a few things and add more functionality to your program. (****************************************** HERE IS ASSIGNMENT 1 THAT WE ARE...
-
Discuss how the environment acts does as a stimulant to business. Analyze why business often does little for the preservation of physical environment despite the fact that it is significant for...
-
y Working this on the www.bis.doc.gov website. "MY company makes fingerprinting powder kits for both domestic and external clients. It is a popular item in my inventory. I have a new customer in...
-
Vaughan Enterprises Ltd. has grown from its beginnings in the steel fabrication business to become a multinational manufacturer and supplier of all types of packaging, including metal, plastic, and...
-
Reflection by thin layers. In Figure, light is incident perpendicularly on a thin layer of material 2 that lies between (thicker) materials 1 and 3. (The rays are tilted only for clarity.) The waves...
-
Graphic solution for a linear programming problem Refer to the data about the production of sealers for Sharped Company in Exercise 25-10. Exercise 25-10 Setting up a linear programming problem...
-
A piece of newly purchased industrial equipment costs $975,000 and is classified as seven-year property under MACRS. Calculate the annual depreciation allowances and end-of-the-year book values for...
-
Additional information from the accounting records: A building that originally cost $ 1 4 4 , 0 0 0 , and which was three - fourths depreciated, was sold for $ 7 , 0 0 0 . The common stock of Byrd...
-
What is content marketing?
-
Johnson Corporation is preparing a flexible budget and desires to separate its electricity expense which is semi-variable and fluctuates with total machine hours, into its fixed and variable...
-
The Lower Colorado River consists of a series of four reservoirs as shown in Fig 1. Mass balances can be written for each reservoir, and the following set of simultaneous linear equations results:...
-
1.Parker Company produces mathematical and financial calculators and operates at capacity. Data related to the two products are presented here: Mathematical Financial Annual production in units...
-
what ways do team dynamics influence the emergence of informal leaders and "gatekeepers" within a team, and how do these roles affect information flow, decision-making, and team efficacy ?
-
Grace company: What amount should be debited to Factory overhead control to record spoilage pertaining to unrecovered cost? Ladyfinger: determine the applied factory overhead rate of fabrication...
-
Question #1 (a) Assume that you want to purchase 1,000 shares of Evil Empire stock. It currently sells for $57 per share. The initial margin requirement is 60%. How much can you borrow from your...
-
Draw and label the E and Z isomers for each of the following compounds: 1. CH3CH2CH==CHCH3 2. 3. 4. CH,CH2C CHCH2CH Cl CH3CH2CH2CH2 CH CH2CCCH2CI CHCH3 CH3 HOCH CH CCC CH O-CH C(CH
-
Corporate headquarters expenses (Learning Objective 5) In Exhibit 10-20, the next to last line of the CEOs report consists entirely of expenses. Describe the kinds of expenses that would be included...
-
Management by exception (Learning Objective 5) Look at the performance report in Exhibit 10-20. According to the management by exception principle, on which variances should the manager of the...
-
Prepare a sales budget for a not-for-profit organization (Learning Objective 2) Great Start Preschool operates a not-for-profit morning preschool. Each family pays a nonrefundable registration fee of...
Study smarter with the SolutionInn App