## 15 Reputation

11 years, 217 days

## How do I allow sqrt in my procedure?...

`I've tried all sorts of different assignments for a,b and c but all still give me an error `
`for root 2. `
`have tried posint, int, nonnegative, positve but none work `
`any help would be appreciated. `
` `
`isTriangle:=proc(a::posint,b::posint,c::posint)if (a+b) > c then print (a,b,c,`are lengths of a triangle`)#this is according to the triangle inequality theoremelif (a+b) < c then print ...`

## How do I add a statement to a procedure?...

I've tweaked it a bit to now look like this. Trialed it out with some examples:

`Marks:=proc(m::positive)if m < 40 then print (m, `Fail`)elif m < 50 then print (m, `Third Class`)elif m < 60 then print (m, `Lower Second Class`)elif m < 70 then print (m, `Upper Second Class`)elif m < 100 then print (m, `First Class`)elif m > 100 then print (`error`)else end if;end proc;proc(m::positive)  ...  end;Marks(30);`

## How to write a procedure to determine if...

Maple 16
`Q3) Write a procedure, isTriangle, to determine if any three given`
` numbers represent the lengths of the sides of a triangle.       The procedure should be able to deal with any input.I have done the following and get an error`
` `
`isTriangle:=proc(a,b,c::nonnegative and numeric)if (a^2+b^2)=c^2 then print (a,b,c "represent the sides of a triangle")end if;end proc;Error, unexpected string`

Maple 16
`Thanks very much for your help!`
`So I've done this so far:`
` `
`Marks:=proc(m::nonnegative, numeric)if m < 40 then print (m, Fail)elif m < 50 then print (m, `Third Class`)elif m < 60 then print (m, `Lower Second Class`)elif m < 70 then print (m, `Upper Second Class`)elif m < 100 then print (m, `First Class`)elif m > 100 then print (`error`)end if;end proc;proc(m::nonnegative, numeric)  ...  end;`

## How do I set up a procedure for a table ...

Maple 16
`Been attempting this question for some time now and can't seem to get it right. `
`Each time coming up with a different error.`
`It's part of our weekly homework, an extention question.`
` `
`Write a procedure, marks, to take a students mark and output the appropriate grade, `
`based on the following table:mark       0-39.99          40-49.99           50-59.99          60-69.99            70+`
 Page 1 of 1
﻿