Question

write a program that reads the three edges of a triangle (a, b, and c) and...

write a program that reads the three edges of a triangle (a, b, and c) and displays the area and perimeter if the input is valid. Otherwise, display that the input is invalid. The input is valid if the sum of every pair of two edges is greater than the remaining edge. Note that area = √s(s-a)(s-b)(s-c), where s = ( a+b+c)/2

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
write a program that reads the three edges of a triangle (a, b, and c) and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Write a C++ program that reads sides of a triangle a, b and c from a file and computes the are...

    1. Write a C++ program that reads sides of a triangle a, b and c from a file and computes the area of a triangle and counts total number of areas program has computed Program should have two functions sfun(): sfun receives the values of a, b and c then computes and returns the value ofs as areafun 0: areafun receives the value of s and computes and return the area of a triangle to main program using below formulae...

  • Must be java code Project 2b: CalculatePerimeter You are to write code for the application CalculatePerimeter where the computer calculates and displays the perimeter of a triangle, provided the three...

    Must be java code Project 2b: CalculatePerimeter You are to write code for the application CalculatePerimeter where the computer calculates and displays the perimeter of a triangle, provided the three double values entered from keyboard input represent a triangle. If they don't, the computer should display the fact that (at least, in the case of non-positive input) one of the values does not form a valid triangle What makes a valid triangle? All sides must be positive and the sum...

  • Write a MATLAB script that reads in three floating point values from the user (a, b...

    Write a MATLAB script that reads in three floating point values from the user (a, b and c), which represent the lengths of three sides of a triangle. Then compute the area of the triangle according to the equation: Area s(s-a)(s- b)(s -e) where s is half of the sum of the three sides, or the average of a, b, & c Hint: look up MATLAB function that prompts read-in values from user

  • Write a C program that reads a sequence of numbers and display a message 1. The...

    Write a C program that reads a sequence of numbers and display a message 1. The numbers a re red from the standard input. 2. The first number is the length of the sequence (n) followed by n numbers. 3. If n is 0 or negative, the program displays the message "Error_1" followed 4. If the length is shorter than n, it displays "Error_2" followed by a new line 5. The program inspects the list and display one of the...

  • Write a program that reads a positive integer N, where N is greater than 1 and...

    Write a program that reads a positive integer N, where N is greater than 1 and prints the value of the floating-point value SUM where SUM is the results of the following series. SUM = 1/1! + 2/2! + 3/3! + 4/4! + ... N/N! Note that your program should print the message “Sorry, bad N”” if N is <=1, and keep reading user input until the user enters a valid value for N. Also, note that all division operations...

  • this is what i have so far but it does not work. please help thank you...

    this is what i have so far but it does not work. please help thank you Part 2: Perimeter of a Triangle Write a program named Triangle.java that asks for the lengths of the three sides of a triangle and computes the perimeter if the input is valid.The input is valid if the sum of every pair of two sides is greater than the remaining side. For example, the lengths 3, 4, and 5 define a valid triangle: 3 plus...

  • Design in Python (pseudocode) and implement (source code) a program (name it MyRectangle) that defines the...

    Design in Python (pseudocode) and implement (source code) a program (name it MyRectangle) that defines the following 3 methods: Method isValid() returns true if the sum of the width and height is greater than 30 Method Area() returns the area of the rectangle if it is a valid rectangle Method Perimeter() returns the perimeter of the rectangle if it is a valid rectangle The main method of MyRectangle prompts the user to enter the width and height of a rectangle...

  • C Program Question 1: Write a program that reads a date from the keyboard and tests...

    C Program Question 1: Write a program that reads a date from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format: mm/dd/yyyy Note that there is no space in the above format. A date in this format must be entered in one line. A valid...

  • 1. Write a program that determines the area and perimeter of a square. Your program should...

    1. Write a program that determines the area and perimeter of a square. Your program should accept the appropriate measurement of the square as input from the user and display the result to the screen. Area of Square = L (squared) Perimeter of Square = 4 * L 2.  Write a program that determines the area and circumference of a circle. Your program should accept the appropriate measurement of the circle as input from the user and display the result to...

  • Question 1: Write a program in C that reads a date from the keyboard and tests...

    Question 1: Write a program in C that reads a date from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format: mm/dd/yyyy Note that there is no space in the above format. A date in this format must be entered in one line. A valid...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT