2,827 Posted Topics
Re: [QUOTE=bamabambhole01;592866]Hii everyone !! Can anyone creat class delta.h for me ! Its about dirac delta function ( for 2d) . a simple one. Looking urgently. Regards,[/QUOTE] If you expect us to do the entire coding job for you from start to finish, you can at least tell us what a … | |
Re: [QUOTE=pakman31;599567]Hello, this is my first time posting here so im sorry for doing anything wrong. Also I am kinda new at programming so bare with me. I am currently working on a function that basically reads a list of double values and assigns them to an array. But I ran … | |
Re: [QUOTE=loeto;598856]Ok Ancient Dragon The program has to convert pounds to rands, and also convert shillings to cents also display the results. Asuming that there are 20 shillings in a pound and that 1 shilling to 10 cents. The program to run in each line the first entry is the number … | |
Re: [QUOTE=gator6688;599048] I get two gifferent errors[/QUOTE] What are the errors and where are they? What does the underlined code represent? For code like this, it may be better to wrap your code in Java-specific code tags. [noparse] [code=JAVA] // paste code here [/code] [/noparse] That'll add line numbers and you … | |
Re: [QUOTE=alkeshtech;599494]Hey Guys, I want to read from a file. And store the string in a string class array. Number of strings in the file is unknown. How could this be done? [code=C++] int n=0; while(!inFile2.eof()) { string tempStr = getWord(inFile2,n); if(tempStr.length() >=1) { wordCount++; } } inFile2.close(); inFile2.open(inFileName2.c_str()); string wordStr[wordCount]; … | |
Re: [QUOTE=Neke;599029]I would like to draw an array of robots. How do i complete this class to draw the head, body, legs of a robot given that the robot is to be drawn within an invisible rectangular Container. The position and dimensions of the Container are given as parameters to the … | |
Re: [code=cplusplus] #include <iostream> #include <string> using namespace std; int main () { int getNumChildren(); double taxAmount(int,double,double,int); return 0; } getData() { void taxAmount(int & numPerson, double & salary, double & amtInPension, int & standardExemption); char status, answer; int noOfChildren; double salary, amtInPension; int numPerson, standardExemption; double tax; cout << "Please … | |
Re: [QUOTE=CBnewbie;599136]I tried to figure out how to work it while leaving the duplicates in, but that really threw me for a loop trying to figure out a way to do that. here's what I start with: Abilene Amarillo 200 Abilene Dallas 220 Abilene Waco 360 Amarillo Dallas 350 Amarillo Waco … | |
Re: [QUOTE=dan_e6;599058]how do i determine if a number is prime or not in C++?[/QUOTE] There's no standard C++ function to my knowledge to test whether a number is prime or not. There may be one in an optional library such as the boost libraries. There are lots and lots of related … | |
Re: [QUOTE=hezfast2;598963]Would this be the correct way to do it? I'm having some difficulty following the logic of having the infile >> id as the while condition. could you explain how it works? [code] void getData(ifstream& infile, vector<int>& itemID, vector<string>& itemName, vector<int>& pOrdered, vector<int>& pInStore, vector<int>& pSold, vector<double>& manufPrice, vector<double>& sellingPrice) … | |
Re: [QUOTE=r30028;598508]I'm having some trouble getting the shortened integer value of a fairly long double value. The double value in question is "1234567890123457024". When taking the int of it, such as: [CODE]int(value);[/CODE] This value is giving me a result of -2147483648, which is completely illogical due first to the fact that … | |
Re: [QUOTE=kira4;598442]Nobody can help me for the attachment?[/QUOTE] You're trying to add an attachment? When you post, look below the text box and you'll see "Additional Options", then a little bit below that you'll see "Atach Files". Click on the "Manage Attachments" button. Also, please use code tags and formatting. It … | |
Re: [QUOTE=MikeyMan07;598511]Hello, I went to college for computer science and graduated but the school i went to never actually had me focus on a certain language. By happenstance i took cumulatively 4 years of c++ but never got very far. Im really good at beginner stuff and not so good at … | |
Re: [code=cplusplus] void bitmap::rotate() { vector<vector <bool> > Vec; // vector created for the purpose of rotating contents of grid vector <bool> Vec1; // 1d vector for pushing each column of original vector onto Vec temporarily before assigning back to grid for (int i = 0; i < numcols; i++) // … | |
Re: [QUOTE=xtheendx;597516]hey man thanks that worked wonders. I have edited the code and it does run smoother and doesnt crash. The problem i run into now is that when i run it last name and first name are displayed at the same time for the user to enter. Like this last … | |
Re: [QUOTE=KuromanKuro;597560]I'm developing a videogame themed hangman game right now for class and I was wondering how to put spaces in the word they were supposed to guess without making it where the player has to input a space (Makes the game impossible to win by the way.) EX. string SecretWord; … | |
Re: [QUOTE=jimJohnson;597619]and how do I do that[/QUOTE] Use the modulus operator: % | |
Re: Look closely at your Print_Array function in lines 67 - 72. You pass this function a variable called count, but you never use it. You declare a new variable called number_used and assign it a value of 0. Then you have this loop: [code] int number_used = 0; for(int index … | |
Re: I think this program is an excellent candidate for a 2-D array. You have a lot of repeated logic in your code, which could be shortened if you used a 2-D array. For display purposes, I think you could change this code: [code=cplusplus] cout<< sq1 << "|" << sq2 << … | |
Re: [QUOTE=hacker9801;597502]I know the & operator means address-of, but what's it do when in a function prototype? Example: [code=c++]void foo(std::string& str)[/code] or [code=c++]void foo(char& c)[/code] what's the & for in that?[/QUOTE] The & symbol means that you are passing the parameter to the function by "reference" rather than by "value". When … | |
Re: [code=cplusplus] while( !inputFile.eof() ) { for ( row=0; row < ROWLIST; row++) for ( col=0; col < COLLIST; col++) inputFile >> inputARRAY[row][col]; } [/code] I believe you need to add [ICODE]inputFile >>[/ICODE] to line 5 above, as I have done. On a side note, you have a while loop as … | |
Re: [QUOTE=chweetnancy;595775]well ..see i am least gud in java..yet to learn.. there are too many errors which i am nt able to correct...didn understnd hw to bring about the output in JOptionPane..[/QUOTE] Get it down to a manageable number of errors. Start commenting things out till everything works. If you get … | |
Re: [QUOTE=nurulshidanoni;596100]I try to read this file firt , but it have -858993460 in the last? 1 20 2 15 3 50 -858993460 Press any key to continue [/QUOTE] When are you going to start asking questions in a way that we don't have to guess what the problem is? Either … | |
Re: [QUOTE=v31;596115]please help me to create a palindrome with c++.thanks before[/QUOTE] You need to start a new thread for that. | |
Re: What don't you understand? You're given an input file with data in it. You have to set up a struct that can hold that data. You have to read the data from the file into the struct. Then, using the data you have read in, you need to calculate average … | |
Re: [code=cplusplus] void pay_loan(double loan_amount, double interest_rate, double monthly_payment) { int month = 0; double interest; double debt = loan_amount; double total_interest = 0; while(monthly_payment >= debt) { month ++; interest = (interest_rate / 1200) * debt; total_interest += interest; debt = loan_amount + interest; debt -= monthly_payment; } cout << … | |
Re: It's C++ syntax, not Java, and no spaces, so this: [code = java] // code [/code] should be this: [noparse] [code=cplusplus] // code [/code] [/noparse] This'll post the code with line numbers. When you post the error, make sure it points to the line number listed in the code you … | |
Re: > Hi all, I have a problem reading data from my file > for example this is my textfile CODE MARKER //Names of columns in my table PKY KELLYS ELM ELMANS OOC OLIVER QRT QUATAR > A user is asked for code, when the code is entered, the corresponding name … | |
Re: [QUOTE=jimzy2008;593937]yeah i duno if i can post my code on here, but if someone can reply, i need to see if i'm on the right track, i wanna send them my code in a private message and if its correct? starting to bug me and i duno what im doing … | |
Re: I think you have a good start. I revised your code a little bit to give your mazeLayout class a paintComponent that can be called from C2D3DGraphicsApp2D's actionPerformed. I made mlayout a data member of C2D3DGraphicsApp2D to facilitate the calling of paintComponent. I added a new 2-D array of type … | |
Re: That's 1000 lines of code and there's more that you haven't included because your code refers to a CommonInfo class and a Tile class and I don't see either in what you posted. You're going to have to be more specific, I imagine, in what you want checked, particularly since … | |
I see quizzes up here in this forum sometimes, so I ran across this one from PBS's Frontline show that I thought would be interesting to people. It's a quiz given to Marines about to deploy to Iraq regarding when they can/should shoot and when they can't/shouldn't. Like most multiple … | |
Re: [QUOTE=Mark515;593236]what does cin.get function do??[/QUOTE] Depends on how you use it. Here is a link with an example: [url]http://www.cplusplus.com/reference/iostream/istream/get.html[/url] | |
Re: [QUOTE=3pid;592758]Hi I`ve just started working with graphic in c++.I want to display a stack on the console . I taugth draw a rectangle as a stack.but the problem is I don know how to draw a rectangle! I write some codes but my compiler (Dev-c++) couldn support them. I found … | |
Re: Code tags, formatting, and more specificity in your questions please. What is this supposed to do, what's it actually do, what is the problem, where is the problem, etc. Also, if we need an input file to run this, please post it (i.e. where is "maze.txt"?). Here's your code, formatted … | |
Re: [QUOTE=ramankrishna;590372]hi this is ramakrishna, i am in my 3yr and i want o develop a project for my jwellary shop which would be standalone project connected to 4 systems in our office with following fields as 1)Transaction - Purchase, Sales, Debit/Credit note, Account voucher, Goods Issue recept, issue to Karigar(worker), … | |
Re: Well I don't see how you can multiply or add checkboxes or checkbox groups. You multiply and add numbers, so if a person checks "Concert" and a concert costs $20 and there is some text that they enter into some type of text field somewhere and they press a submit … | |
Re: Jim you need to pay close attention to your run-time errors. You have a problem here: [code=JAVA] for(int i = 0; i <=16; i++) topDisplay[i].setBackground(Color.blue); for(int i = start; i <= stop; step++) topDisplay[i].setBackground(Color.yellow); [/code] You have two loops. Don't assume the problem is in the second one. Look closely … | |
Re: I think you are going to have a problem in this function: [code] void OpenFiles(ifstream &inp, ofstream &out, string filename); [/code] You are passing it one filename and then trying to use that same filename to open an ifstream AND an ofstream (lines 32 and 40). Seems to me that … | |
Re: [QUOTE=Roebuc;588742]Just a quick question, I am working with classes and I was trying to rename one as an array, ie: [code] addressType addresses[n];[/code] But I have decided not to make it an array. So is this a legal statement? [code] addressType addresses;[/code] Or does that only work for arrays? Thanks[/QUOTE] … | |
Re: [QUOTE=Black Magic;588129]It is in one case.. No offense but thats spam.. I need to know the answer for binary not something i already have..[/QUOTE] Spam? No spam here. You asked a question, mitrmkar pointed out the problem with your code, and showed you one way it could be made to … | |
Re: [QUOTE=NinjaLink;588699]I just tried and did not get the result I displayed in my first post. I want to put in 5 for feet and 8 and inches to recieve 1.7272 in meters and 172.72 in centimeters.[/QUOTE] Well, if you changed the code, please post the updated code. | |
Re: I didn't get the error that you refer to when I ran your code. I assume you included the cmath library? [url]http://www.cplusplus.com/reference/clibrary/cmath/sqrt.html[/url] [url]http://www.cplusplus.com/reference/clibrary/cmath/[/url] You have a few things going on. One, at least at first glance to me anyways, it seems like an odd algorithm to use to calculate the … | |
Hi all, I am trying to install MySQL++ on Windows XP and use it. I was able to install it in Linux because the website: [url]http://tangentsoft.net/mysql++/[/url] provided an RPM that built the libraries for you. As far as I can tell, no such thing is supplied for Windows. Supposedly, MySQL++ … | |
Hi, I am working on a project wherein one program writes to a file, but allows a different program to read from that file BEFORE the first program is finished writing to it. In this project, the first program is a game. When someone scores in the game, that activity … | |
Re: [QUOTE=tripjokers69;587306]I have a two part assignment. Part one is to create a menu driven program using variables to do certain tasks. Part two is to convert the variables being used into 2 arrays. The code for part one is post below and works perfectly for everything that is required. My … | |
Re: [QUOTE=Moporho;587458]I am trying to get my 2d array to total up values. It is laid out perfectly, but my values do not calculate. Is my math wrong? Please help?? [code] #include <iostream> using std::cout; using std::cin; using std::endl; #include <iomanip> using std::setw; int main() { const int DAY = 7; … | |
Re: If that's the entire example and there's no more code somewhere else and you got that out of a book, then yes, the book is wrong. Get another book. Check again to make sure there isn't more to the example than the 26 lines you posted. It's hard to imagine … | |
Re: How about the sqrt function from cmath? [url]http://www.cplusplus.com/reference/clibrary/cmath/sqrt.html[/url] | |
Re: For stuff like this you really need code tags: Without code tags: ********* * * * * ********* With code tags: [code] ********* * * * * ********* [/code] Simply draw your box, then put code tags around it: [noparse] [code] put box here [/code] [/noparse] Lots of similar threads … |
The End.