- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 7
- Posts with Upvotes
- 7
- Upvoting Members
- 5
- Downvotes Received
- 4
- Posts with Downvotes
- 4
- Downvoting Members
- 3
22 Posted Topics
Next project in my C++ course is to create a class Polynomial to add, subtract, multiply by a scalar, and multiply by another polynomial. I've written my code, and it works fine when I run it, but there's an application that is provided by our instructor to compare my .exe … | |
Having issues with this program. I've been trying to identify all the areas where data is created, then tried to destroy it likewise after using it. I've put a lot of delete[] coef (coef is a pointer double array to hold coefficients). The program will run half the time, then … | |
I'm working (well have been for the past few weeks) on a polynomial class to do different things between two polynomials: multiply, divide, get remainder, subtract, add. The coefficients are stored in a pointer to an array listed under private and the degree (also the amount of slots in the … | |
Re: [CODE]Term[COLOR="Red"]&[/COLOR] Term::operator +=(const Term &t)[/CODE] Added the reference. Not positive because I don't know what the class Term consists of, but I don't think you can use cin with an object of a class. I am not completely sure of this, so it's worth looking into. Just throwing some suggestions … | |
Re: What they said^^. Here's one way, may not be the best: Just looking at what you need to accomplish, you can use two "for" loops. Set a double (say maxRain) equal to the first number in the array, then use the first for loop to cycle through and compare the … | |
Re: create a pointer to the array then use "object pointed to"=new "type"[size] ex: [CODE] double* array; array=new double[69]; [/CODE] Or if you really want to get crazy, you can have the user input the size, but make sure to remember data is stored in the 0th spot of an array … | |
Re: I'll give an example of what I've been working on for my C++ class: consider a program to process polynomials (add, subtract, multiply etc). I created a class called Polynomial. From within this class, I had private variables of an array to hold the coefficients of a polynomial, as well … | |
Re: Make sure to enclose all C++ code within the code tags. [url]http://www.daniweb.com/forums/announcement8-3.html[/url] Look up ifsteam and ofstream. You'll need the <fstream> header as well. This is the method you might want to use for opening a file to read (ifstream) and outputting your data (ofstream). One method of doing so … | |
I'm trying to clean up my coding a bit for a program I'm working on. Here's an example of my code (not my exact code, but I've adapted it to an example): [CODE]class Example { private: double* group; int number; public: Example() {group=new double[1]; number=0;}; Example(const Example& ex); Example& Example::operator=(const … | |
Say I have an array: array={1, 2, 3} but I want to be able to increase the size, and shift the data to the front, leaving 0's behind. So i want the array to turn into this: array={1, 2, 3, 0, 0} Where I added two to the size of … | |
I'm working on a project for my first use of classes and OOP. I've read all our slides (only provided examples though) and two tutorials on classes, but I confused about a few things. I'll show first the assignment then I'll post my specific questions after. [QUOTE]You will need to … | |
I'm looking for a few suggestions on different ways to input a polynomial into an array (coef[]) using a degree (double degree). I have one way that works, but my most recent project needs a new way to do the same thing (not sure why but it can't hurt to … | |
Re: [QUOTE=marshella;1145637]how to write a program in c++ for this type of question? Write a calculator program in c++ that allows the user to select which operation they would like to perform such as: Addition, subtraction, multiplication, division, modulus, Square, Square root, Convert Celsius to Fahrenheit (Fahrenheit = 1.8 Celsius +32), … | |
Re: [URL="http://www.computer-books.us/cpp_8.php"]free bookz---exception handling inclusive[/URL] | |
I have to be able to read text from a file then manipulate it to find the average value of an integral over a given bounds [a,b] from an input file, then export it to another file. I do not know how to store the information to process it. Say … | |
Re: These are the posts that scare me about asking for coding help...haha. | |
So I've missed the past week of my C++ class due to the SEC swimming championships being a week long :@, and I've missed the whole topic on file processing. I've been reading the slides and a few tutorials via lovely google searching, but it's a little hazy. Can anyone … | |
trying to do input checking for an alpha character inputted where a numeric one is needed. I've implemented this function firstChoice() to allow a certain response is '2' or '3' was picked and then another certain response for anything other than '0 '1' '2' or '3'. I must add another … | |
Re: in your cin statements, use your declared variables (ex. year, make, model) for what you want to be inputted. When you run the program, the type you enter for each question will be stored as each value (careful that you don't try to store 'Bronco' as an int value). When … | |
As you can see I am new here. I found this site from googling a question about a getChoice() function , and I was able to learn how to implement the function in my project to fit my needs from the post. ([url]http://www.daniweb.com/forums/thread162456.html[/url]). Well anyways, I have more issues that … | |
Re: Hey YRM, nice to meet you. I too am learning C++ currently, I think this community has a lot to offer for us! | |
I was lucky enough to find Daniweb via google on searching for explanation on a getChoice() function for C++. I'm excited to be a member of the community. I can see that there is a lot to learn on these forums, as well as some people extremely qualified to help … |
The End.