Computer Science, asked by Princess936, 2 months ago

Given that y=a(x-h)²+k, write an algorithm and draw the corresponding flowchart to solve for Y

Answers

Answered by kunadaprabhavathi
0

Answer:

 {2158 \sqrt[566 \sqrt{ \frac{ {xy50}^{2} }{?} } ]{?} }^{?}

ha ha ha

Answered by dreamrob
1

Algorithm:

Step 1: START

Step 2: Declare variables a , x , h , k and y

Step 3: Take input from the user in variable a , x , h and k

Step 4: Calculate y

y = (a * Math.pow(x - h, 2)) + k

Step 5: Print the value of y

Step 6: END

Flowchart:

Flowchart is attached as an image.

Program in JAVA:

import java.util.*;

public class MyClass

{

   public static void main(String args[])

   {

       Scanner Sc = new Scanner(System.in);

       double a , x , h , k , y;

       System.out.print("Enter the value of a : ");

       a = Sc.nextDouble();

       System.out.print("Enter the value of x : ");

       x = Sc.nextDouble();

       System.out.print("Enter the value of h : ");

       h = Sc.nextDouble();

       System.out.print("Enter the value of k : ");

       k = Sc.nextDouble();

       y = (a * Math.pow(x - h , 2)) + k;

       System.out.print("Value of y = " + y);

   }

}

Output:

Enter the value of a : 10

Enter the value of x : 20

Enter the value of h : 30

Enter the value of k : 40

Value of y = 1040.0

Attachments:
Similar questions