1. ## Writing a Code

I am very new to programming and need to write a code to use input. An example input is 5.1, 8.3, 12.2, 8.4 and the expected output is:

Enter x1 and x2.
You entered x1 as 5.10 and x2 as 8.30.
Enter y1 and y2.
You entered y1 as 12.20 and y2 as 8.40.

From the lower-left point clockwise,
the points of the trapezoid are:
(5.10, 0.00)
(5.10, 12.20)
(8.30, 8.40)
(8.30, 0.00)
The area of the trapezoid is 32.96 units.

2. Originally Posted by jdouglass
I am very new to programming and need to write a code to use input. An example input is 5.1, 8.3, 12.2, 8.4 and the expected output is:

Enter x1 and x2.
You entered x1 as 5.10 and x2 as 8.30.
Enter y1 and y2.
You entered y1 as 12.20 and y2 as 8.40.

From the lower-left point clockwise,
the points of the trapezoid are:
(5.10, 0.00)
(5.10, 12.20)
(8.30, 8.40)
(8.30, 0.00)
The area of the trapezoid is 32.96 units.
Introduction to C - Cprogramming.com

3. Are you sure you'll end up with a trapeze for every possible values of y? What if x1=5.10, x2=8.3, y1=12.2 and y2=-10?

4. Originally Posted by flp1969
Are you sure you'll end up with a trapeze for every possible values of y?
Only very special values of y (magical values indeed) will create a trapeze.

5. Originally Posted by flp1969
Are you sure you'll end up with a trapeze for every possible values of y? What if x1=5.10, x2=8.3, y1=12.2 and y2=-10?
This is the output that I was given for the input, so really I'm not sure.

6. Originally Posted by jdouglass
This is the output that I was given for the input, so really I'm not sure.
Really? You do know how to draw with pencil and paper, don't ya?

7. Originally Posted by flp1969
Really? You do know how to draw with pencil and paper, don't ya?
I am in college taking a 101 course in computer programming with 0 prior background in computer science. This is the second class and we were told to compute it, so just asking for a little help....

8. Originally Posted by stahta01
The above is a weblink click on it and read the information!

Tim S.

9. Well, the thing is that code comes towards the end of the (initial) problem solving process. Start by understanding the problem, and in this case one approach is to try different input values and draw the result out on paper. From there you have a better chance of understanding how to arrive at the results (i.e., how to determine the points and compute the area), and hence you can write the code to produce the results from the input.