Question: Can you show me how to form a c program for task 2. The output is given below. Task 1 create a function called cubic,

Can you show me how to form a c program for task 2. The output is given below.

Task 1

  1. create a function called cubic, which takes an integer X as input and returns a float Y as the output, satisfying the equation

Y = 1000X - 30000X + 200000X + 500000

  1. create a int array of size 21 that contain data of cubic(0) to cubic(20)
  2. print the table of X and Y values from the array data.

Task 2

  1. create a function called graph, which takes a pointer to int called table as the input, and display a graph that satisfy the following criteria:
    1. vertical axis(y-axis) is represented by |
    2. horizontal axis (x-axis) is represented by -
    3. origin is represented by +
    4. line of graph is represented by %
    5. each column(x-axis) represent 1 unit
    6. each row(y-axis) represent 50000 units, for example:

| row 2: from 50001 to 100000

| row 1: from 1 to 50000

| row 0: x-axis, all use - except x-intercept use %

    1. only need to show graph of x-value from 0 to 20 inclusive, and y-value from 0-1000000
    2. x or y intercept is showed as % instead of - if any
    3. 2 space is padded between each column of the graph, but for x-axis whole line use -
  1. pass the pointer to data as input to the function graph.
  2. Output: Can you show me how to form a c program for task

+---+-------+ | X1 YT +---+--- + | 0 5000001 | 1 6710001 | 2 | 788000 | 3 8570001 | 4884000 | 5 875000 | 6 836000 | 7| 7730001 | 8 6920001 | 9 599000 | 10 500000 | 11 4010001 | 12 3080001 | 13 227000 | 14 1640001 | 15 | 125000 | 16 | 116000 | 17| 143000 | 18 212000 | 19 329000 | 20 500000 +---+------ + 1 | 1 % % % % I % I | % % . I % . % % % 1 1 % % % % % % % % % | +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!