Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise#1: The sum of the interior angles of a triangle is 180 degrees. Write a program that reads two interior angles of a triangle in

image text in transcribed
Exercise#1: The sum of the interior angles of a triangle is 180 degrees. Write a program that reads two interior angles of a triangle in degrees, and then calculates the third angle and print its value. The program should then print a message telling whether the triangle is equilateral (all angles equal), isoceles (exactly two angles equal),or scalene (no two angles equal) Sample input-output (1) Enter the value of two angles: 60 60 The value of the third angle is: 60 The triangle is equilateral Sample input-output (2 Enter the value of two angles: 60 50 The value of the third angle is: 70 The triangle is scalene Exercise#2: A mail order house sells five different products whose retail prices are: Product 1 Product2 Product3 Product 4 Product 5 AED 3.0 AED 4.50 AED 10.5 AED 5.98 AED 6.69 These prices are to be initialized in your program. Write a program that prompts the user to enter a (product, quantity) pair to calculate its retail price. Your program should use a if-else structure to help determine the retail price for each product. Exercise#3: Rewrite exercise (2), but at this time, read the prices of each product from file Then prompts the user to enter a (product, quantity) pair to calculate its retail price. And instead of using if-else statements, use switch structure

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago

Question

7. What traps should she avoid?

Answered: 1 week ago

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago

Question

6. What data will she need?

Answered: 1 week ago