Cannot obtain correct answers to these questions

My teacher posted a study guide with no answers and I was hoping I could get some help to compare my work with what the correct answers are. The study guide is as follows:

1) Write a C++ function “Process_List” to read a list of real numbers a file. If any of the numbers are negative skip them but count them and return the count to the calling program, return the average of the positive numbers. File handler is passed as an argument to the function. (You need to decide pass by value or reference is required)

2) Write a C++ function “Process_Num” to receive a float number as argument, find and report the ceil, floor, and rounded number in the form of long type to the calling program. Ceil means the next higher whole number, floor mean the previous whole number and round means if the first digit is 5 or greater then use ceil, if it is smaller than 5 then use the floor. You may use any system math function or make your own calculation, just make sure it works for all possible conditions. Example: for 3.4234 ceil is 4, floor is 3 and round is 3 ; for 2345.89997 ceil is 2346, floor is 2345, and rounded is 2346.

3) Assuming the following class is available:

Right_Triangle

- height : double
- base : double
- hypo : double
- area : double
- perimeter : double


+ Read(ifstream &):void // Reads the measurements of the sides of a right triangle from a file
+ calcArea():void // Calculates and sets area  area = (base * height / 2)
+ calcPerimeter():void // Calculates and sets perimeter  perimeter = base + height + hypo
+ getArea() : double // return the area
+ get Perimeter(): double // return the perimeter
+ Print(): void // Print the sides measurements separated by setw(15) format


Write a function to receive an object of type Right_triangle as argument. The function prompt user for a file name and opens and verifies the file. Read the measurements for the sides of triangles stored in the file. The function finds how many triangles are larger and smaller than the one passed to the function. The function should also create an output file (prompt user for output file name) containing a tabular format showing sides, area, and perimeter of the triangles.9p;






Any answers to any of the questions will be more than helpful. Thanks.
Sorry to be harsh, but if you haven't payed enough attention in class to answer these questions so far, getting cheats from others won't help you either.

I once went to the University's 'help center' for help with a particularly challenging integral (mathematics). The student helper said, "oh, I can do this" and then did it.

That didn't help me. The problem was that I couldn't solve the problem. It made no difference to me that he could solve it. It took me several weeks to get to the point where I could (I hope) actually solve it on my own --which is what matters.

Seeing the/an answer is far less useful than working your way to an answer.


Do your best, post back, and we'll help steer you closer to a correct answer.
Topic archived. No new replies allowed.