This is my assignment for my programming class at school and I am so confused and really need help with this. Here is the assignment. Please help if you can.
Write a Math class which contains 4 functions which calculate following:
1.) The result of x^y.
2.) The floating point equivalent for an input fraction.
3.) A plot point for f(mx+y).
4.) A plot point for f(mx+y^n).
Write a main test class which does the following:
1.) Creates a Math object from your Math class.
2.) Uses the Math object to:
a.) Print the results of 2^0 thru 2^31.
b.) Print the results of the inverse of the first 25 prime numbers.
c.) Print the series of coordinates which results from: m=1 thru 25 given x=10 and y=10.
d.) Print the series of coordinates which results from: n=1 thru 25 given m=1, x=10, and y=10.
okay. well really i don't understand it very well and i think i have the first part but right now i'm stuck on the floating point equivalent. its 3 files...
#include <iostream>
using namespace std;
class Math
{
private:
public:
int power(int x, int y);
int result;
float divide(int x, int y);
};
------------------------------------------------
#include "Math.h"
int Math::power (int x, int y)
{
int result = 1;
for (int count = 0; count < y; count ++) //run y times
result = result * x;