Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Home/Questions/Q 18845
Next
In Process
newcoder
  • 0
newcoder
Asked: June 14, 20222022-06-14T21:58:01+05:30 2022-06-14T21:58:01+05:30In: Programming Language

Study the scenario and complete the question(s) that follow: You …

  • 0

Study the scenario and complete the question(s) that follow:
You are provided with the following functions
Min = CalcMin(x1, x2, x3)
The function must determine and return the minimum of the 3 variables.
Area = AreaofTriangle(base, height)
The function must calculate and return the area of a triangle using the parameters

3.1 Write the complete function Min = CalcMin(x1, x2, x3) in pseudocode to calculate and
return the minimum of the three variables.
Note: Assign the correct data type to each variable (10 marks)

3.2 Write the complete function Area = AreaofTriangle(base, height) in pseudocode to calculate
and return the area of a triangle using the parameters. (5 Marks)

3.3 Create your function to estimate the circumference of a circle by passing the radius of the
circle as a parameter only. (5 Marks)

question
  • 1 1 Answer
  • 244 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. I'M ADMIN
      2022-06-15T16:54:23+05:30Added an answer on June 15, 2022 at 4:54 pm

      3.1

      Explanation:-

      CalcMin() function takes three integer type values as input, and this function returns an integer type value, inside this function, if x1 is less than or equal to x2 and x1 is less than or equal to x3 then return x1

      if x2 is less than or equal to x1 and x2 is less than or equal to x3 then return x2

      Otherwise, return x3

      Pseudocode:-

      int CalcMin(int x1,int x2,int x3){
          if x1<=x2 and x1<=x3:
              return x1
          else if x2<=x1 and x2<=x3:
              return x2
      [mepr-show rules="18938" unauth="message"] 
          else:
              return x3  
      }

      3.2

      Explanation:-

      AreaofTriangle() function, takes two float type values as input, and this function returns a float type value, inside this function, multiply base with height, then divide the result by 2, and store the result in float type variable, area, at the end return area

      Pseudocode:-

      float AreaofTriangle(float base,float height){
          float area=(base*height)/2
          return area
      }

      3.3

      Explanation:-

      circumference() function, takes a float type value as input, and this function returns a float type value, inside this function, multiply 2 and 3.14 with radius, and store the result in float type variable, result, at the end return result

      Pseudocode:-

      float circumference(float radius){
          float result=(2*3.14*radius)
          return result
      }
      
      [/mepr-show]
      • 0
      • Reply
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 139
    • Best Answers 65
    • Probability and Statistics NPTEL Assignment answers – Week 1
    • NPTEL Joy of Computing Using Python Week 2 Assignment Answers 2023
    • NPTEL Problem Solving Through Programming In C Assignment 2 Answers 2023
    • NPTEL Problem Solving Through Programming In C Assignment 1 Answers 2023
    • NPTEL Python for Data Science Assignment 1 Answers 2023

    Popular Questions

    • I'M ADMIN

      Internshala ethical hacking final test answers: Question sequence differs but ...

      • 6 Answers
    • AK

      You have a green lottery ticket, with ints a, b, ...

      • 4 Answers
    • mj

      Solve by Gauss Elimination Method 5x+y+z+w=4 ,x+7y+z+w=12 , x+y+6z+w=-5, x+y+z+4w=-6

      • 3 Answers

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow

    © 2021-2022 Sikshapath. All Rights Reserved

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.