C++, Creating Math Funtions For This Weeks Program

Wanna understand E=mc2, English grammer, or maybe just build a computer? We can help!

Moderator: Moderators

Post Reply
LoSTimberWolf
Inmate
Posts: 128
Joined: Sun Jan 27, 2002 4:17 pm

C++, Creating Math Funtions For This Weeks Program

Post by LoSTimberWolf »

Ok, even though I have not written the last two functions (multiplication and divition), I am trying to get the bugs worked out. I currently have seven problems trying to compile:<br><br>(43) : error C2653: 'NumDays' : is not a class or namespace name<br>(45) : error C2065: 'hours' : undeclared identifier<br>(47) : error C2065: 'days' : undeclared identifier<br>(59) : error C2653: 'NumDays' : is not a class or namespace name<br>(59) : error C2146: syntax error : missing ';' before identifier '+'<br>(59) : error C2501: 'NumDays' : missing storage-class or type specifiers<br>(59) : fatal error C1004: unexpected end of file found<br>Error executing cl.exe.<br><br><br>Here is the file I am creating:<br><br>#ifndef NUMDAYS_H<br>#define NUMDAYS_H<br><br>#include <iostream.h><br>#include <stdlib.h><br>#include <math.h><br>#include "numdays.h"<br><br>class NumDays<br>{<br>&nbsp &nbsp &nbsp &nbsp private:<br>&nbsp &nbsp &nbsp &nbsp double hours;<br>&nbsp &nbsp &nbsp &nbsp double days;<br>&nbsp &nbsp &nbsp &nbsp void calcDays ();<br><br>&nbsp &nbsp &nbsp &nbsp public:<br>&nbsp &nbsp &nbsp &nbsp //Constructors<br>&nbsp &nbsp &nbsp &nbsp NumDays() {hours = 0; days = 0;}<br>&nbsp &nbsp &nbsp &nbsp NumDays(double _hours) {hours = _hours; calcDays();}<br>&nbsp &nbsp &nbsp &nbsp //get Function<br>&nbsp &nbsp &nbsp &nbsp double getDays() {return days;}<br>&nbsp &nbsp &nbsp &nbsp //Addition and Subtraction<br>&nbsp &nbsp &nbsp &nbsp NumDays operator+(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp NumDays operator-(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp //Equal to and Not equal to<br>&nbsp &nbsp &nbsp &nbsp int operator==(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp int operator!=(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp //Greater than and Less than<br>&nbsp &nbsp &nbsp &nbsp int operator>(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp int operator<(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp //Greater than or equal to and Less than or equal to<br>&nbsp &nbsp &nbsp &nbsp int operator>=(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp int operator<=(const NumDays &);<br>&nbsp &nbsp &nbsp &nbsp //Increments and Decrements<br>&nbsp &nbsp &nbsp &nbsp NumDays operator++();<br>&nbsp &nbsp &nbsp &nbsp NumDays operator++(double);<br>&nbsp &nbsp &nbsp &nbsp NumDays operator--();<br>&nbsp &nbsp &nbsp &nbsp NumDays operator--(double);<br>&nbsp &nbsp &nbsp &nbsp //Times and Divide<br>&nbsp &nbsp &nbsp &nbsp NumDays operator*(double);<br>&nbsp &nbsp &nbsp &nbsp NumDays operator/(double);<br>};<br><br>#endif<br><br>/*****************************************************************/<br><br>void NumDays::calcDays()<br>{<br>&nbsp &nbsp &nbsp &nbsp if (hours >= <!--EZCODE EMOTICON START 8) --><img src=http://www.ezboard.com/images/emoticons/glasses.gif ALT="8)"><!--EZCODE EMOTICON END--> <br>&nbsp &nbsp &nbsp &nbsp {<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp days += (hours / <!--EZCODE EMOTICON START 8) --><img src=http://www.ezboard.com/images/emoticons/glasses.gif ALT="8)"><!--EZCODE EMOTICON END--> ;<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp hours = hours % 8;<br>&nbsp &nbsp &nbsp &nbsp }<br>&nbsp &nbsp &nbsp &nbsp else if (hours < 0)<br>&nbsp &nbsp &nbsp &nbsp {<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp days -= ((abs(hours) / <!--EZCODE EMOTICON START 8) --><img src=http://www.ezboard.com/images/emoticons/glasses.gif ALT="8)"><!--EZCODE EMOTICON END--> + 1);<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp hours = 8 - (abs(hours) % <!--EZCODE EMOTICON START 8) --><img src=http://www.ezboard.com/images/emoticons/glasses.gif ALT="8)"><!--EZCODE EMOTICON END--> ;<br>&nbsp &nbsp &nbsp &nbsp }<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator+(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp NumDays temp;<br><br>&nbsp &nbsp &nbsp &nbsp temp.hours = hours + right.hours;<br>&nbsp &nbsp &nbsp &nbsp temp.days = days + right.days;<br>&nbsp &nbsp &nbsp &nbsp temp.calcDays();<br>&nbsp &nbsp &nbsp &nbsp return temp;<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator-(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp NumDays temp;<br><br>&nbsp &nbsp &nbsp &nbsp temp.hours = hours - right.hours;<br>&nbsp &nbsp &nbsp &nbsp temp.days = days - right.days;<br>&nbsp &nbsp &nbsp &nbsp temp.calcDays();<br>&nbsp &nbsp &nbsp &nbsp return temp;<br>};<br><br>/*****************************************************************/<br><br>int NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator==(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp if (days == right.days && hours == right.hours)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 0;<br>};<br><br>/*****************************************************************/<br><br>int NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator!=(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp if (days != right.days && hours != right.hours)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 0;<br>};<br><br>/*****************************************************************/<br><br>int NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator>(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp if (days > right.days)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else if (days == right.days && hours > right.hours)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else <br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 0;<br>};<br><br>/*****************************************************************/<br><br>int NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator<(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp if (days < right.days)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else if (days == right.days && hours < right.hours)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else <br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 0;<br>};<br><br>/*****************************************************************/<br><br>int NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator>=(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp if (days >= right.days)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else if (days == right.days && hours > right.hours)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 0;<br>};<br><br>/*****************************************************************/<br><br>int NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator<=(const NumDays &right)<br>{<br>&nbsp &nbsp &nbsp &nbsp if (days <= right.days)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else if (days == right.days && hours < right.hours)<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 1;<br>&nbsp &nbsp &nbsp &nbsp else<br>&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp return 0;<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator++()<br>{<br>&nbsp &nbsp &nbsp &nbsp ++hours;<br>&nbsp &nbsp &nbsp &nbsp calcDays();<br>&nbsp &nbsp &nbsp &nbsp return *this;<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator++(double)<br>{<br>&nbsp &nbsp &nbsp &nbsp NumDays temp;<br><br>&nbsp &nbsp &nbsp &nbsp hours++;<br>&nbsp &nbsp &nbsp &nbsp calcDays();<br>&nbsp &nbsp &nbsp &nbsp return temp;<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator--()<br>{<br>&nbsp &nbsp &nbsp &nbsp --hours;<br>&nbsp &nbsp &nbsp &nbsp calcDays();<br>&nbsp &nbsp &nbsp &nbsp return *this;<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator--(double)<br>{<br>&nbsp &nbsp &nbsp &nbsp NumDays temp(hours, days);<br><br>&nbsp &nbsp &nbsp &nbsp hours--;<br>&nbsp &nbsp &nbsp &nbsp calcDays();<br>&nbsp &nbsp &nbsp &nbsp return temp;<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator*(double)<br>{<br>};<br><br>/*****************************************************************/<br><br>NumDays NumDays:<!--EZCODE EMOTICON START :o --><img src=http://www.ezboard.com/images/emoticons/embarassed.gif ALT=":o"><!--EZCODE EMOTICON END--> perator/(double)<br>{<br>};<br><br>/*****************************************************************/<br><br><br><br>The main file was given to us by the teacher:<br><br>#include <iostream.h><br>#include "numdays.h"<br><br>void main()<br>{<br>&nbsp &nbsp &nbsp &nbsp NumDays one(25),two(15),three,four;<br>&nbsp &nbsp &nbsp &nbsp NumDays five(12),six(1<!--EZCODE EMOTICON START 8) --><img src=http://www.ezboard.com/images/emoticons/glasses.gif ALT="8)"><!--EZCODE EMOTICON END--> ,seven(1<!--EZCODE EMOTICON START 8) --><img src=http://www.ezboard.com/images/emoticons/glasses.gif ALT="8)"><!--EZCODE EMOTICON END--> ,eight(36);<br>&nbsp &nbsp &nbsp &nbsp NumDays nine;<br><br>&nbsp &nbsp &nbsp &nbsp cout << "One: " << one.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp cout << "Two: " << two.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp three = one + two;<br>&nbsp &nbsp &nbsp &nbsp cout << "Three = one + two: " << three.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp three = one - two;<br>&nbsp &nbsp &nbsp &nbsp cout << "Three = one - two: " << three.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp four = three++;<br>&nbsp &nbsp &nbsp &nbsp cout << "Four = Three++: " << four.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp four = ++three;<br>&nbsp &nbsp &nbsp &nbsp cout << "Four = ++Three: " << four.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp four = three--;<br>&nbsp &nbsp &nbsp &nbsp cout << "Four = Three--: " << four.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp four = --three;<br>&nbsp &nbsp &nbsp &nbsp cout << "Four = --Three: " << four.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp cout << "Five: " << five.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp cout << "Six: " << six.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp cout << "Seven: " << seven.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp cout << "Eight: " << eight.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp nine = five * six;<br>&nbsp &nbsp &nbsp &nbsp cout << "Nine = five * six: " << nine.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp nine = six/eight;<br>&nbsp &nbsp &nbsp &nbsp cout << "Nine = six/eight: " << nine.getDays() << endl;<br>&nbsp &nbsp &nbsp &nbsp if(six == seven) cout << "Six and seven are equal" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Six and seven are not equal" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(six != seven) cout << "Six and seven are not equal" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Six and seven are equal" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(seven > five) cout << "Seven is greater than five" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Seven is not greater than five" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(five > six) cout << "Five is greater than six" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Five is not greater than six" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(seven >= five) cout << "Seven is greater than or equal to five" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Seven is not greater than or equal to five" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(six >= seven) cout << "Six is greater than or equal to seven" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Six is not greater than or equal to seven" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(seven < five) cout << "Seven is less than five" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Seven is not less than five" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(five < six) cout << "Five is less than six" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Five is not less than six" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(seven <= five) cout << "Seven is less than or equal to five" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Seven is not less than or equal to five" << endl;<br>&nbsp &nbsp &nbsp &nbsp if(six <= seven) cout << "Six is less than or equal to seven" << endl;<br>&nbsp &nbsp &nbsp &nbsp else cout << "Six is not less than or equal to seven" << endl;<br><br>}<br><br>/*<br>Correct output:<br><br>One: 3.125<br>Two: 1.875<br>Three = one + two: 5<br>Three = one - two: 1.25<br>Four = Three++: 1.25<br>Four = ++Three: 1.5<br>Four = Three--: 1.5<br>Four = --Three: 1.25<br>Five: 1.5<br>Six: 2.25<br>Seven: 2.25<br>Eight: 4.5<br>Nine = five * six: 3.375<br>Nine = six/eight: 0.5<br>Six and seven are equal<br>Six and seven are equal<br>Seven is greater than five<br>Five is not greater than six<br>Seven is greater than or equal to five<br>Six is greater than or equal to seven<br>Seven is not less than five<br>Five is less than six<br>Seven is not less than or equal to five<br>Six is less than or equal to seven<br>Press any key to continue<br>*/ <p>-LoS-TimberWolf{FF}<br>Vehicle Specilist</p><i></i>
User avatar
XMEN Gambit
Site Admin
Posts: 4122
Joined: Thu Nov 18, 1999 12:00 am

Re: C++, Creating Math Funtions For This Weeks Program

Post by XMEN Gambit »

I was able to change up the picture considerably by removing the line <br>#include "numdays.h"<br><br>From the file "numdays.h". Recursive inclusion is generally a no-no. Try it, you'll like it. (Even though the number of errors actually increases, it gets rid of THOSE.) <p><!--EZCODE IMAGE START--><img src="http://www.xmenclan.org/xmengambit.gif"/><!--EZCODE IMAGE END--><br>XMEN member<br>Card-carrying DTM<br>OKL Fish-napper<br><br>Though a program be but three lines long, someday it will have to be maintained.<br><!--EZCODE ITALIC START--><em> The Tao of Programming</em><!--EZCODE ITALIC END--></p><i></i>
Image
BlackRider
Inmate
Posts: 966
Joined: Thu Jan 17, 2002 5:26 pm

Re: C++, Creating Math Funtions For This Weeks Program

Post by BlackRider »

recursive inclusion is fun... also try recursive constructors <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/images/emoticons/smile.gif ALT=":)"><!--EZCODE EMOTICON END--> <br><br>Just to be dumb, I once had a constructor that created an object of its own type... it compiled just fine, but when i ran it it never did anything but fill memory <!--EZCODE EMOTICON START :lol --><img src=http://www.ezboard.com/images/emoticons/laugh.gif ALT=":lol"><!--EZCODE EMOTICON END--> <br><br>I once had a friend that would e-mail me once a week with programs he couldn't get to compile. After something like 5 weeks of me just debugging his programs I got quite sick of it. So, this last time, instead of fixing his code for him I gave him some simple advice.<br><br>1) Until you are practiced enough to write 100+ line programs w/o a single compile, don't try it. Develope your programs bit by bit. When I was learning I started with an outside in approach. I'd start with the most basic functions/classes and wouldn't even add functionality to them until I was ready. Just build a little bit and compile and run. This drastically reduces where your errors could be. After my programs started getting far too complex for the outside in method, I'd use a modular method on top of outside in. I'd break the program down into as many parts as reasonable and then I'd work on one part at a time. Just don't tackle large projects all at once.<br><br>2) If ever you should run across a concept you don't understand, there are many good C++ books on the market. Don't get the new ones, not much has changed. I went and got me 5 books that ranged in price from $0.25 to $1.00 each. If I didn't understand a concept in one book I'd read about it in another. I works! I picked up the C++ language in a matter of hours... much less than 21 days! <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/images/emoticons/smile.gif ALT=":)"><!--EZCODE EMOTICON END--> <br><br>3) Its nice to ask friends for questions and help, but try to avoid relying on them. Crutches are nice when you can't get about without them, but if you rely on them too heavily your leg will never heal. (Sorry, I'm not too good with analogies)<br><br>I don't have a problem with your asking questions and seeking help. I'm just offering some help. <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/images/emoticons/smile.gif ALT=":)"><!--EZCODE EMOTICON END--> So I hope this helps.<br><br><br><br>Outside in, bit by bit... <p><!--EZCODE FONT START--><span style="color:red;font-size:large;">C</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:orange;font-size:large;">O</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:green;font-size:large;">L</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:blue;font-size:large;">O</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:indigo;font-size:large;">R</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:violet;font-size:large;">S</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:pink;font-size:xx-large;">!</span><!--EZCODE FONT END--><br><br><!--EZCODE FONT START--><span style="color:red;font-size:xx-large;"> I LOVE EZBOARD... WAIT...</span><!--EZCODE FONT END--></p><i></i>
LoSTimberWolf
Inmate
Posts: 128
Joined: Sun Jan 27, 2002 4:17 pm

Re: C++, Creating Math Funtions For This Weeks Program

Post by LoSTimberWolf »

I have gotten all but one problem from the error list worked out. The modular, %, does not like using a double and is preventing my program from compiling. Is there any way to either trick it to work or do I have to change a double into an int to work with it? <p>-LoS-TimberWolf{FF}<br>Vehicle Specilist</p><i></i>
BlackRider
Inmate
Posts: 966
Joined: Thu Jan 17, 2002 5:26 pm

Re: C++, Creating Math Funtions For This Weeks Program

Post by BlackRider »

mod only works with ints... <!--EZCODE EMOTICON START :( --><img src=http://www.ezboard.com/images/emoticons/frown.gif ALT=":("><!--EZCODE EMOTICON END--> <p><!--EZCODE FONT START--><span style="color:red;font-size:large;">C</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:orange;font-size:large;">O</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:green;font-size:large;">L</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:blue;font-size:large;">O</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:indigo;font-size:large;">R</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:violet;font-size:large;">S</span><!--EZCODE FONT END--><!--EZCODE FONT START--><span style="color:pink;font-size:xx-large;">!</span><!--EZCODE FONT END--><br><br><!--EZCODE FONT START--><span style="color:red;font-size:xx-large;"> I LOVE EZBOARD... WAIT...</span><!--EZCODE FONT END--></p><i></i>
XMEN Durango
Posts: 44
Joined: Wed Feb 19, 2003 3:17 am
Location: Texas

Re: C++, Creating Math Funtions For This Weeks Program

Post by XMEN Durango »

and put it in a 10X13 pan and bake for 45 min. at 350 ice when cooled <!--EZCODE EMOTICON START :duh --><img src=http://www.contrabandent.com/cwm/s/cont ... freakB.gif ALT=":duh"><!--EZCODE EMOTICON END--> <p></p><i></i>
LoSTimberWolf
Inmate
Posts: 128
Joined: Sun Jan 27, 2002 4:17 pm

Re: C++, Creating Math Funtions For This Weeks Program

Post by LoSTimberWolf »

Well, the program has been running most of today, but it has become aparrent over the past several hours that the overloaded operators are not easy to figure out exactly how the teacher got the answeres he did. So its back to the paper to figure out how to get a mathimatical equation to work in the program with signs that are changed. Its like trying to find the top of a Morbius strip, there is only one side. <p>-LoS-TimberWolf{FF}<br>Vehicle Specilist</p><i></i>
FaLLGuY
Inmate
Posts: 311
Joined: Thu Feb 13, 2003 5:30 pm
Location: Minnesota

Re: C++, Creating Math Funtions For This Weeks Program

Post by FaLLGuY »

Wow! Far out dude...<!--EZCODE EMOTICON START :smokin --><img src=http://www.ezboard.com/images/emoticons/smokin.gif ALT=":smokin"><!--EZCODE EMOTICON END--> This stuff blows right over my head..<!--EZCODE EMOTICON START :lol --><img src=http://www.ezboard.com/images/emoticons/laugh.gif ALT=":lol"><!--EZCODE EMOTICON END--> <p><!--EZCODE IMAGE START--><img src="http://homepage.ntlworld.com/planetburt ... <!--EZCODE IMAGE END--></p><i></i>
Post Reply