This is my assignment.
Write a program to convert between yards and meters. Your solution must utilize functions to perform the conversions. Your functions must meet these requirements:
One of the functions must use pass-by-value, returning the converted measure
One of the functions must use pass-by-reference to store its result (the function does not have a return value).
Your program must create two tables - one showing the yards equivalent to meter measures from 0 yards to 100 yards (by 5 yard increments: 0, 5, 10, . . . , 100) and the other showing meters equivalent to yards measures 0 through 100 (by 5 meter increments: 0, 5, 10, ... , 100). Original measures are all integer values. Calculated measures are to be displayed accurate to two decimal places.
The output for both tables must fit on one default screen (79 columns by 23 rows), so your tables will need to be organized into multiple columns. Everything must be lined up nicely and the tables neatly and informatively labeled. This assignment can be done with a single file. It is not necessary to define any classes.
I have gotten this code written, but im getting these errors. Im at a loss for fixing them
Compiling...
Conversions.cpp
c:\documents and settings\owner\my documents\visual studio 2005\projects\damel_7\damel_7\conversions.cpp(21) : error C2440: '=' : cannot convert from 'double (__cdecl *)(void)' to 'double'
There is no context in which this conversion is possible
c:\documents and settings\owner\my documents\visual studio 2005\projects\damel_7\damel_7\conversions.cpp(22) : error C2660: 'getmeters' : function does not take 2 arguments
Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\damel_7\damel_7\Debug\BuildLog.htm"
damel_7 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#include <iostream>
using std::cout;
using std::endl;
double y2m=1.09361329834;
double m2y=0.9144;
double getyards(int);
double getmeters();
int main (void)
{
int i;
double yards, meters;
for (i=5; i<=100; i=i+5)
{
double yards = getyards(i);
cout << i << yards << endl;
;}
for (i=5; i<=100; i=i+5)
meters=getmeters;
getmeters(i,meters);
cout << i << &meters <<endl;
;}
double getyards (int x)
{
return
(x*m2y)
;}