2,827 Posted Topics

Member Avatar for mostermand

[QUOTE=mostermand;990882]Hi I have a problem, I hope you can help me with. I have a number, which I need to compare to some values. I do not wish to go through all the values, and compare them individually, as I there are too many for it to be efficient. Neither …

Member Avatar for mostermand
0
175
Member Avatar for pvt_geeker

[QUOTE=pvt_geeker;988907]Hello, JAVA community. I am currently working on developing a system (Hotel Reservation System) as academic work. I am using Netbean IDE 6.7 and MySQL or MS SQL as development tools. I am quite amateur with the use of Netbean, I also find that manual coding is very tedious. So, …

Member Avatar for Ezzaral
0
91
Member Avatar for leadenwinter

You need to give the user the option of typing in a value that represents that there are no more values to enter. Perhaps give a prompt like: [code] Please enter a value. Enter -999999 if you have no more values [B]:[/B] [/code] As for the ten (or fewer) values, …

Member Avatar for MattyRobot
0
221
Member Avatar for lotrsimp12345

[QUOTE=DdoubleD;987476]It's based on C, so I believe the answer is absolutely and the same.... perhaps someone will have more to add to this...[/QUOTE] If you can do it in C, you can almost certainly do it in C++. In a handful of rare cases, this not being one of them, …

Member Avatar for lotrsimp12345
0
174
Member Avatar for privs

difftime returns the difference in time in seconds, not minutes, so you would have to divide by 60 to get the number of minutes. difftime wants two time_t objects: [url]http://www.cplusplus.com/reference/clibrary/ctime/difftime/[/url] [code] double difftime ( time_t time2, time_t time1 )[B];[/B][/code] I don't know what [ICODE]time[/ICODE] represents here: [code]diff = difftime(startdate,time)[B];[/B][/code] Is …

Member Avatar for VernonDozier
0
145
Member Avatar for NinjaLink

I would imagine that the fact that the data is coming from a file is irrelevant to the withdraw and deposit functions. You're probably supposed to adjust balance: [code] void SavingsAccount::deposit(double amount) { balance += amount; } [/code] Can't see what else it would be.

Member Avatar for NinjaLink
0
250
Member Avatar for leverin4

[QUOTE=leverin4;988330]I tried searching and couldn't find anything, so I'm sorry if this has been posted before. I need help aligning output at the command line. I want to make even columns, but can't figure out how to do it. Attached is a screenshot of my current output. I want the …

Member Avatar for PopeJareth
0
143
Member Avatar for serdengil

Start by making sure you understand what exactly you are supposed to do. Start by making sure you understand what all of these functions are supposed to do and why he has main the way he has it. Start by spending a considerable amount of time doing all of these …

Member Avatar for Lerner
0
122
Member Avatar for kahaj

You have no [ICODE]System.out.println[/ICODE] statements in either the functions themselves or the calling statements. You create the String you want to display to the screen, but never display the String. Since your functions have the word "Display" in them, I imagine you want the System.out.println command in the functions. And …

Member Avatar for kahaj
0
146
Member Avatar for Samyx

[QUOTE=Samyx;985250]Sorry, I should had paid attention. How can I return the list of words? and how do I find an anagram?[/QUOTE] You made words[] global, so you don't have to return it or pass it. You do have a potential problem in that you declare a local variable with the …

Member Avatar for VernonDozier
0
174
Member Avatar for kevlam

One, who wrote this code? Is it yours? Two, what exactly is the problem? We need a more specific question. Point us to the section of the code to look at it. Three, repost in code tags with formatting/indentation: [noparse] [code=JAVA] // paste code here [/code] [/noparse]

Member Avatar for kevlam
0
132
Member Avatar for hao001

If the person you are copying is who I think it is, be aware that there are many flaws in his code. He would ask questions, get answers, but do a seemingly random copy and paste of the answers, but often in an incorrect way, so the end result, often, …

Member Avatar for VernonDozier
0
152
Member Avatar for Jennifer84

[QUOTE=Jennifer84;681678]If I understand you would meen an example like the code below. I use a file to write i to it but nothing is written to the file. If I change to: [COLOR="Red"]for( int i = 0; i < 10; i+=1 )[/COLOR] then it writes i to the file. [code] …

Member Avatar for puluke
0
128
Member Avatar for lebronjames

You want to use getline instead of the >> operator. [url]http://www.cplusplus.com/reference/iostream/istream/getline/[/url]

Member Avatar for lebronjames
0
83
Member Avatar for hao001

[QUOTE=hao001;986462]Hi..i saw this a randomly..i got some part don't understand: [url]http://www.daniweb.com/forums/thread214624.html[/url] @ancient dragon's reply 1) const unsigned int MAX_SIZE = 2; student array[MAX_SIZE]; Q: Why MAX_SIZE = 2 ? 2)15: void insert(student array[],const unsigned int MAX_STUDENT); 33: void mySort(student array[],const unsigned int MAX) 55: void display(const student array[], unsigned int …

Member Avatar for hao001
0
132
Member Avatar for icu222much

[QUOTE=icu222much;985238]I am new to programming in C++. I have a bit of experience in Python and ActionScript3. I decided to pick up C++ so I downloaded Dev-C++ complier. I tried to run the following code but it doesn't seem to do anything. I complied the code, and it did not …

Member Avatar for hao001
0
207
Member Avatar for Der_sed

One, you have some semicolons directly after your if statment and your else statement. They may not be errors, but you don't want them. Two, x is a float, so the % operator doesn't make much sense if you use it with a float. Are you sure you want x …

Member Avatar for VernonDozier
0
94
Member Avatar for xfreebornx

[QUOTE=hao001;986399]Hi..i saw this thread randomly..i got some part don't understand: 1) const unsigned int MAX_SIZE = 2; student array[MAX_SIZE]; Q: Why MAX_SIZE = 2 ? 2)15: void insert(student array[],const unsigned int MAX_STUDENT); 33: void mySort(student array[],const unsigned int MAX) 55: void display(const student array[], unsigned int MAX); Q: 1. From …

Member Avatar for hao001
0
320
Member Avatar for helpme123456789

You can use pointers and pointer arithmetic to isolate the characters in a string, but I think the code is much more readable if you use the [] operator... char* address = "joe_smith@yahoo.com"; for (int i = 0; i < strlen (address); i++) { char letter = address[i]; cout << …

Member Avatar for VernonDozier
0
227
Member Avatar for and12

Chalk it up as a learning experience. There's absolutely nothing you can do about it. You have a half hour to reconsider your post and have second thoughts. In that time period, you can edit it down to nothing. Of course, if someone else has RESPONDED to your quote and …

Member Avatar for ~s.o.s~
-2
464
Member Avatar for xfreebornx

And again, read the other half dozen threads on the same topic that you have started. [url]http://www.daniweb.com/forums/thread215686.html[/url]

Member Avatar for VernonDozier
0
105
Member Avatar for tomtetlaw

[QUOTE=Hiroshe;934825]It's a stratagy to make your teachers stop asking you questions. :P I kinda wrote it as I was looking it up so it ended up slightly longer than I thought. Also didn't notice the scroll bar shrinking. Oww well :$[/QUOTE] I liked the essay. +rep. Some good points.

Member Avatar for kaninelupus
0
606
Member Avatar for nicolek808

Line 51 - You're assigning a string to itself. What's the point? Lines 49 - 52 - Either use a loop or recursion. Not both. You are required to use recursion, so don't use a loop. Line 47 - You are overwriting the parameter you passed to the function without …

Member Avatar for VernonDozier
0
143
Member Avatar for khanalone1

Seems similar to this thread. Tux's advice is good. Split everything up into smaller tasks. [url]http://www.daniweb.com/forums/thread221572.html[/url] I'll add the same advice that I gave the person in the thread I linked. Don't hard-code the keys (37, 173, 200). Have variables for them and give them descriptive names. And when you're …

Member Avatar for khanalone1
0
528
Member Avatar for droeph

[QUOTE=droeph;983750]Ok I made the changes but I still get incompatible types for case 2 : MonthDescription = "February"; dayDescription = (Year % 4 == 0 && Year % 100 != 0) || (Year % 400 == 0) ? 28: 29;[/QUOTE] You made the changes? What changes did you make? You …

Member Avatar for javaAddict
0
165
Member Avatar for heels

//for loop for (line=1; line <=height; line++) { for(col=1; col <=line; col++) { if (line%2 !=0)// odd line { if (col%2 != 0)//odd line,odd col System.out.print(A); else //(col%2 == 0) //odd line, even col System.out.print(B); } if (line%2 == 0)//even line { if(col%2 !=0)//even line, odd col System.out.print(A); else //(col%2 …

Member Avatar for heels
0
221
Member Avatar for VernonDozier

I see a potential problem with the new format regarding code tags. Before, you had the option of doing this: [code] // paste code here - Courier-style fomatting, multiple spaces allowed, but no line numbers or syntax highlighting. [/code] or this: [code=cplusplus] // paste code here - Courier-style fomatting, multiple …

Member Avatar for John A
0
771
Member Avatar for feartrich

[QUOTE=feartrich;984655]This supposed to return the user's BMI. But the output is always 0. Why is that? [code=java] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.DecimalFormat; public class bmi extends JApplet implements ActionListener { JTextField inputLbs, inputInches, displayBmi; public void init() { JLabel labelLbs = new JLabel("Weight (lbs):", SwingConstants.RIGHT); inputLbs = …

Member Avatar for VernonDozier
0
93
Member Avatar for kernel>panic

[QUOTE=Kioti16;981120]It is not a real .dll file just a .txt file. Oh and the part I need help with says: //Problems start here //<-------------------------------------------> //Problems end here //<-------------------------------------------> Can you help me, thanks.[/QUOTE] Call it a text file then. Anyone seeing a .dll extension expects it to be a DLL …

Member Avatar for VernonDozier
0
682
Member Avatar for mrnutty

[QUOTE=firstPerson;984459]I haven't ever used CLA so I had to ask. For simplicity sake, Say I have a program that takes in at most 5 arguments. The arguments from args[1] - args[4] has to be some numbers. These number will be used for something, say to calculate its average. How could …

Member Avatar for mrnutty
0
173
Member Avatar for foraswim

Close on the code tags: [code=cpluplus] #include <cstdlib> #include <string> #include<iostream> #ifndef MARK_FOO #define MARK_FOO #include "node.h" struct node{ std::string data; node* next; }; class LinkedList { typedef std::string value_type; typedef size_t size_type; public: //constructors LinkedList(); LinkedList(const LinkedList& obj); ~LinkedList(); //mutating member functions void Insert_Node_tail( node* tail_ptr, value_type entry); void …

Member Avatar for VernonDozier
0
124
Member Avatar for ganesh.guddu

[QUOTE=ganesh.guddu;983877] PLEASE NOTE THAT I DON'T HAVE PERMISSION TO MODIFY THE SOURCE CODE OF EXISTING CLASS .. So please tell me how to proceed to get the solution .. [/QUOTE] If you can't modify the source code of class A or class B, then what are you allowed to do?

Member Avatar for ganesh.guddu
0
81
Member Avatar for smco9

You have too many swaps for a selection sort. You should have at most one swap for every trip through the outer loop, so you should not have a swap inside the INNER loop. The algorithm, from Wikipedia. [LIST=1] [*]Find the minimum value in the list [*]Swap it with the …

Member Avatar for vincent2085
0
188
Member Avatar for Robes

Line 9 - Am I correct that this doesn't compile? I'd say you need to post a driver/main program for anyone to make any sense of these functions. It could make perfect sense, but not knowing what i represents and not knowing what the book[] array is initialized to be, …

Member Avatar for VernonDozier
0
94
Member Avatar for cbreeze

You have brackets problems which will be impossible to solve until you format your code with consistent indentation. NetBeans and Visual Studio will do that for you. Then start counting brackets and make sure you don't have more ending brackets than starting brackets, or vice versa.

Member Avatar for namehere05
0
212
Member Avatar for nope3d

[QUOTE=nope3d;980462]I am having a problem in this program....can anybody help me create a BufferedReader out of this maze problem... [/QUOTE] Yes. [QUOTE=nope3d;980462] then i have to create a text document entitled with maze.txt... [/QUOTE] Okay. If you want better answers, you're going to have to ask more detailed questions, particularly …

Member Avatar for nope3d
0
127
Member Avatar for Alexia Noir

[QUOTE=Alexia Noir;981819]hi there. say i have a text file. in this text file is all the information i need for my output. the problem is, probably because i'm still very new at this, i don't know how to read this particular text file and output it onto the screen. suppose …

Member Avatar for Alexia Noir
0
145
Member Avatar for smco9

You need a compare function and a swap function: [code] int compare (data item1, data item2) { // returns -1 if item1 is "before" item2 // returns 0 if item1 and item2 have "equal" value regarding ordering // returns 1 if item2 is "before" item1 // You'll have to decide …

Member Avatar for VernonDozier
0
96
Member Avatar for robgeek

[QUOTE=robgeek;978913]I am trying to write a program in which a big text file is read and then user searches for a word and replaces it with another word. To implement this I was thinking to store the file read into an array since that would the easiest way to implement …

Member Avatar for VernonDozier
0
167
Member Avatar for Bladtman242

[QUOTE=Bladtman242;978895] it doesent even wait for input. it seems like the [icode]getline (cin,plac);[/icode] is ignored?[/QUOTE] Yes, it doesn't wait for input. It isn't ignored, but it DOES ignore YOU, as in it doesn't wait for you to enter anything because it already has an unused newline in the cin stream …

Member Avatar for Bladtman242
0
534
Member Avatar for GooeyG

[QUOTE=GooeyG;979861] Everything seems to work, but when you input more than 40 hours, it doesn't calculate overtime.[/quote] You make no attempt to calculate overtime. [code] float OverTime::getsalary() { return hoursWork * hourlyRate; } [/code] [QUOTE=GooeyG;979861] Another thing is that, i can't get a message to pop up when someone input …

Member Avatar for DdoubleD
0
168
Member Avatar for Whilliam

This is a perfect candidate for a 4 x 4 GridLayout. [url]http://java.sun.com/docs/books/tutorial/uiswing/layout/grid.html[/url] [url]http://java.sun.com/javase/6/docs/api/java/awt/GridLayout.html[/url]

Member Avatar for Whilliam
0
2K
Member Avatar for rainny

[QUOTE=rainny;980269]I wish to develop a program which used to play the sound file. The problem I face now is I wish can play the sound file when select the userID from mysql database. For example, when I select one of the userID from combobox, then the sound file can automatically …

Member Avatar for rainny
0
173
Member Avatar for Edward_Nelson

Well, do you have ten rungs or six? [quote] I have a ladder with 6 rungs. I can climb up 1 rung, 2 rungs, or 3 rungs at a time. The goal is to find every way I can climb up 10 rungs. [/quote] One way to do it is …

Member Avatar for VernonDozier
0
105
Member Avatar for Miganders

[QUOTE=vmanes;979751]"Hello world", of course. It's the law![/QUOTE] Followed by "Hello <Your name here>".

Member Avatar for William Hemsworth
0
102
Member Avatar for treyd

[QUOTE=treyd;979007]This is where I am now: [ICODE]public class Avgtwod { public static int[][] avgRows(int[][] a) { int[][] avgRows = {{1, 2, 3}, {3, 4, 5}}; for (int row = 0; row < avgRows[0].length; row++) { int total = 0; for (int column = 0; column < avgRows.length; column++) { total …

Member Avatar for treyd
0
110
Member Avatar for Rastafari

I don't see a PrintDashes () function anywhere. If you add one, then type "g++ main.cpp" in Linux, it compiles for me. Is there a makefile for this? Maybe it's trying to compile project01.cpp into object code and then link, in which case project01.cpp won't know anything about MAX_COLS. But …

Member Avatar for VernonDozier
0
116
Member Avatar for ItecKid

[QUOTE=ItecKid;979824]Hello, I am writing a C++ program to find the largest such number such that the square root of that number is less than or equal to a fixed number, set by me, like this: [code=c++] #include <stdio.h> #include <math.h> int main (void) { long fixed, param, result; result = …

Member Avatar for ItecKid
0
125
Member Avatar for Der_sed

[QUOTE=Der_sed;978893]I know that an array matrix would have been better but Im taking a freshman course so coulnt use it. 1- Tic tac toe grid is defined from locations 1 to 9 2- For loop executes 9 times for 9 turns 3- A functions takes all 9 locations as argument …

Member Avatar for DdoubleD
0
144
Member Avatar for valleymorning

[quote] Could anyone help me on finding all magic numbers using JAVA with 1000 iterations or less? [/quote] You may need to elaborate on what precisely this restriction means, including the word "iterate". I imagine it means that this brute-force method is no good: [code] for (int i = 100000; …

Member Avatar for valleymorning
0
472

The End.