anonymous
  • anonymous
Please can someone help me with this using pseudocode and algorithm to compute the model: A = √(s-b)(s-b)(s-c) S = a+b+c/2 with explanation
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
step 1: Define a function (I am using this in the most general sense) ---lets call it CalculateArea ---which accepts inputs of type integer s, b and c.
anonymous
  • anonymous
The BODMAS/BIDMAS/BIRDMAS rule tells you: do what is in the brackets first, so Step 2. subtract the value b from s and store in a temporary variable called A1 subtract the value b from s and store in a temporary variable called A2 subtract the value c from s and store in a temporary variable called A3 You will then need to multiply these values according to your formula so: Step 3: multiply A1, A2 and A3 and store the result in a temporoary variable called M1 Finally, you will need to get the square root of M1, the result of multiplying these together Step 4: get the square root of M1 and assign this to the variable A Finally you will need to print out the value Step5: Print the value of A to the screen. leave out my comments and just include the steps, and you will have the pseudocode for the first equation.
anonymous
  • anonymous
Thanks for the answer........what about the algorithm of the equation?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
From the pseudocode, we can deduce the algorithm as follows, (remember an algorithm is just a series of steps). Imagine you are trying to tell a computer how to do this. Algorithm: create a function called CalculateArea which accepts 3 integers called s,b,c A1 = s-b A2 = s-b A3 = s-c M1 = A1 x A2 x A3 A= sqrt (M1) Print A;
mathmate
  • mathmate
@ubah Isn't the Hero's formula meant to be: \(\color{red}{s} = \color{red}{(a}+b+c\color{red}{)}/2\) \(A = \color{red}{\sqrt{\color{black}{(s-\color{red}{a})(s-b)(s-c)}}}\) In programming, - upper/lower case count - brackets count - names of variables count - order of statements counts The compiler is not very forgiving, it does exactly what you tell it to do.

Looking for something else?

Not the answer you are looking for? Search for more explanations.