Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming in C Must have to use all Assignment Objectives Assignment objectives: Arrays Loops Decision making Functions Problem Description: Write a program that generates a

Programming in C

Must have to use all Assignment Objectives

Assignment objectives:

  • Arrays
  • Loops
  • Decision making
  • Functions

Problem Description:

Write a program that generates a sequence of 18 random numbers between 1 and 99. Each three number in sequence represents a side of a triangle. Therefore, you will have six sets of three numbers each representing a side of a triangle. Your program must check each set to see if they could make a valid triangle and if so, compute the area of that triangle and display the sides and the area of the valid triangles.

A triangle is valid if sum of its two sides is greater than the third side. If three sides are a, b and c, then three conditions should be met.

image text in transcribed

Requirement:

  • Must use array to save random numbers
  • Must use a user defined function to generate random number
  • Must use function to calculate area of a valid triangle
  • Must use function to determine if triangle is valid
  • Functions Must be generic, they should not display anything

General requirement

1. Next few line of your source code must be comments describing what this program is supposed to do.

2.The first output (display) must be your name

3.The source code file must include comments documenting the design.

4. Indentation and spacing should be used to make the program readable.

(a +6>6) . (a+c>6) a L - b (6+c>a)

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

More Books

Students also viewed these Databases questions

Question

Can anything be misinterpreted?

Answered: 1 week ago

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago