- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Another student, another beginner.
43 Posted Topics
Hi, just wondering... is there a site offering some sort of c++ programming mentoring? Something like: make this programme... how would you do it? and then people writing code for it. Would that be a feature for DANIWEB? | |
Re: wendellrob, if you make all your variables and the computeNetPay() method static you'll be able to access them from main() (that should be also static). Since your variables are static you don't have to create an instance of your class (Pay). If you don't want to declare your variables and … | |
Hi, I'm starting playing with javascript and bounce to some problems. The script tries to read the <p> background color that is set using stylesheet and set a global variable with this value for later use. It seems that the variable does not instantiate (and btw. there is more than … | |
I'd appreciate if somebody could have a look at this code and tell me where the problem is. The program is meant to take a .txt file and split it in three different files: one with words of 1 to 4 letters, one with words of 5 to 7 and … | |
Re: Have a good sleep and then have a look in the [URL="http://java.sun.com/docs/books/tutorial/java/nutsandbolts/index.html"]trails[/URL] | |
Re: Raik.48, welcome to the forum. Please next time use code tags when you post code. When you make a call to calcArea() method the area is calculated as it says in the method. When you call println() method you print the location on memory of object a. This is all … | |
Re: axelle, if your problem is how to use NetBeans IDE take a look at the [URL="http://www.netbeans.org/kb/index.html"]tutorials[/URL]. Gook luck, | |
Re: newjavastudent, as it's coded, you just have to break your while loop with ctrl+c while the program is running and once you've finished writing whatever you'd like on the new generated file. | |
Hi, I'm trying to print a string on the center of a window using GridBagLayout. All I see printed is a part of the string I expect (the current month) instead of the whole string. I don't seem to be able to spot where the error is and I'd appreciate … | |
Re: So, where's your problem? finding the algorithm or coding it? | |
Re: akulkarni, in loop on line 30 to 36: Think what happens when i == 3... you need to reset j to 0. That way you check letters before variable i. try [CODE=java] for(int j=i+1;j>3;j++) { if (j>3) j = 0; if(str.charAt(i)==str2.charAt(j)) count2=count2+1; }[/CODE] please, mark it solved if you think … | |
Re: latinajoyce, just a small addition. In your problem description you tell us you need to choose numbers between 1 and 10. However your code chooses numbers between 0 (included) and 10 (excluded). I don't know what you really need but, if you need numbers between 1 and 10 (both included) … | |
Hi, I'm starting working with the Graphics and related and strugling to understand it. I'm trying to do something as simple as drawing a String on a panel. The string changes on runtime. I post the code below. In effect, every new number is drawn on top of the old … | |
Re: Lokth, can't you put an if statement saying if input equals h then give hint? Something like, [CODE=java] String inputString = String.valueOf(input); if (inputString == "h") { // give hint function } [/CODE] I know it's pretty general but you'll have to give us your code for more specifics. ______________ … | |
Re: [URL="http://www.google.com/search?q=how+spam+filter+works&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a"]google search[/URL] [URL="http://computer.howstuffworks.com/spam.htm"]http://computer.howstuffworks.com/spam.htm[/URL] Have a good read and mark the thread as solved if you think it is. | |
Hi, I'm trying to understand how the Calendar, GregorianCalendar and Locale classes work. Say I instantiate two Locale objects and then two Calendar objects, each with their respective Locale. Then ask for the always troublesome DAY_OF_WEEK on every Calendar object as in the following code: [CODE=java] import java.util.Calendar; import java.util.Calendar.*; … | |
Re: You'll have to give some more details and some code to chew on. | |
Re: @sam_inquisitive, chill out man! Nobody told you were going to ask for implementation, it's just that we've all seen in here what Salem said. Surely Salem didn't mean it personaly. Anyhow, Salem's got a point. It's OK to discuss since, like as you point out, this is a discussion community. … | |
Re: Yeah, I'd like to know too. Also, if the problem is solved, could you please mark it as solved? Thanks | |
Re: [URL="http://support.sas.com/certify/"]http://support.sas.com/certify/[/URL] | |
Re: you might find these links useful: [URL="http://sourceforge.net/projects/jcom"]http://sourceforge.net/projects/jcom[/URL] [URL="http://sourceforge.net/projects/jacob-project"]http://sourceforge.net/projects/jacob-project[/URL] | |
Hi, I'm having trouble with the following simple test program to extract 10 random numbers from 0 to 5. [CODE=java] import java.util.*; public class TestRandom { public static void main(String[] args) { Random rand = new Random(); for (int i = 0; i < 10; i++) { int j = … | |
Re: did you do any code already? can you post it? | |
Hi, I'm starting with Java and have an issue with how to use the classpath variable and where to put certain library. This is probably pretty easy but it's got to the point of driving me crazy. Now, I'd like to have my library, let's call it "mylib", under C: … | |
Hi, I'm trying to set a simple send an email script as I found it on the internet. Here is the code: [CODE=php]<html> <head> <title>PHP Mail Array Loop</title> </head> <body> <?php $to = "mymail@anydomain.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "anybody@somedomain.com"; … | |
This's got probably an easy answer but it's been puzzling me a few hours already. The code below declares a string object and fills it character by character. I can print every single character (line 16) but I can't print the string as a whole (line 19). Could anybody tell … | |
Hi, I'm trying to have a function that takes an ifstream object and returns an int as in [ICODE]int wCount(ifstream myFile);[/ICODE] Is that possible? The compiler gives me loads of errors that I simply don't understand. Thanks, | |
Hi all, let's say I have a string object. I can cout the string literal by just stating the name of the object or I can use the data function. [CODE=cpp] string myStringObj = "Hello World!"; cout << myStringObj; cout << myStringObj.data();[/CODE] So, why do we have a function like … | |
Hi, here is my problem: I'm writing a small program that needs to read a text file and write the words of this text as a list. I could only come up with the little piece of code I wrote below and it's not even working. I believe the problem … | |
Hi, the following code works fine, that is, strcpy effectively copies the whole string on temporal to word. [CODE=cpp] char word[20]; char temp[ ] = "hola"; cout << temporal << endl; strcpy(word, temporal); cout << word << endl; [/CODE] However, if I try to use the heap to store the … | |
Hi, why is it giving me the warning: deprecated conversion from string constant to ‘char*’ How may I fix this? Any help is welcome [CODE=cpp] #include <iostream> using namespace std; class Melarki { public: Melarki(): first(""){}; Melarki(char * mimi): first(mimi){}; ~Melarki(){delete first;}; char * first; }; int main() { Melarki … | |
Hi, let's say I define this two classes that do not inherit from one another. I get an error at line 10: field "DataNoFather" has incomplete type. 1.Any idea what that means and how to fix it? 2. Is it possible to have a variable like DataNoSon labeled with type … | |
This is more of a general question to see if I got the concept. I defined a class with private member data: one is an int variable and the other is a pointer. 1. Where is the int variable stored?... on the heap or on the stack? 2. Where is … | |
Re: SQ89, are you sure your formula to calculate e is correct?. Google "Derangements" and you should be able to find the correct formula for it. Alternatively you can look for "hat check problem". | |
Hi, when I try to assign \0 using the expression: pPtr->myArray[127]="\0"; my compiler throws the following error: "invalid conversion from ‘const char*’ to ‘char’. Any idea on what's wrong? Any idea on how to solve the problem? | |
Hi, is there a factorial function implemented on math lib? Alternatively, is there any way I could check if it's implemented on my compiler? thanks | |
Re: samjars, two suggestions: 1. when comparing two strings you may want to use the strcmp function on string.h Have a look at [url]http://www.daniweb.com/forums/thread5663.html[/url] 2. you'd like to think about controlling the flow with another type of loop... otherwise you need to enter price=0 for item i. | |
Hi, during an assignment I needed to write a function that, among other things, had to print some of an array values. The simplified version that I show below creates an array of 50 pointers, populates it, and prints the values from main and from a function. I'm really struggling … | |
Hi, is it possible to find out the size of an array created on the free store? thanks | |
Hi, I'm learning C++ at the moment using one of Jesse Liberty's books and got to the pointers day. They ask to code a stray pointer as an exercise and give as a solution the following code: [CODE=syntax] int main() { int *pVar; *pVar = 9; return 0; }[/CODE] Could … | |
Hi, I'm learning c++ at the moment and the problem I have is probably very simple. I wrote some code to calculate prime factors of a given number. If I define variables as unsigned long, the code compiles and the program runs. If I define variables as double then compiler … |
The End.