# Question: computer science ii func assignment 2 this is an...

###### Question details

*Computer Science II – func. assignment
#2*

This is an example of a function where, (in the function) you read in 3 numbers, do a calculation, and return a value

Write a C function that will:

- Determine if you have entered a right triangle
- Accept 3 ints (in main)
- Length of side one of the triangle
- Length of side two of the triangle
- Length of side three of the triangle

- returns a bool (true or false) whether the 3 lengths entered determines a right triangle
- the function does not print out the answer, just returns the answer
- answer is printed in main
- the three sides of the triangle are printed in the function
- the length of the sides are not input in any particular order

function header should be

**bool
determineRightTri()**

in the function

- ask for the length of one side of a triangle
- read in this length
- ask for the length of one the second side of a triangle
- read in this length
- ask for the length of one the third side of a triangle
- read in this length
- determine whether this is a right triangle
- return true if you have a right triangle, else false

**Output should look like the following**

**??? length of side
1**

**??? length of side
2**

**??? length of side
3**

**is a right
triangle**

**
Or**

**is not a right
triangle**

**these lines are printed in the function**

**??? length of side
1**

**??? length of side
2**

**??? length of side
3**

**this is printed in main--using the returned Boolean
value**

**is a right
triangle**

** Or**

**is not a right
triangle**

**Use the output (cout) manipulators to format the output
correctly [setw(?), fixed, right, left, etc]**

*Sacond part*

Write a C program that has 1 function:

void giveDays(int days, int weeks)

- accepts as parameters two ints. The first is a number of days and the second is a number of weeks
- calculates how many total days are represented by the 2 parameters

Example: 25 days and 3 full weeks represents a total number of days of 46

- print out (in the function) how many total days are calculated

function headers should be:

**void giveDays(int days, int
weeks)**

in main

- ask for the number of days
- read in the number of days
- ask for the number of weeks
- read in the number ofweeks
- call your function giveDays(int, int)

output
**from the function** should look
like:

??? days

??? weeks

has ??? total days

**Use the output (cout) manipulators to format the output
correctly [setw(?), fixed, right, left, etc]**