A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

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

  • This Question is Closed
  1. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  2. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  3. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks for the answer........what about the algorithm of the equation?

  4. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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;

  5. mathmate
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    @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.

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

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.