201 Posted Topics

Member Avatar for minimi

minimi, I think you are getting confused between calling a method, and constructing a new object using a constructor. A constructor is a special member function of a class that is used to create objects of that class. It is special since it has the same name as the class …

Member Avatar for apines
0
143
Member Avatar for intes77

If you are not forced to use charAt() (assignment restrictions, etc') I recommend a different approach - using [URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html"]String[/URL]'s [URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)"]split(String regex)[/URL] method with the regex "/", you can divide your String into a String array with the day, month and year in its cells. This will be much more convinient …

Member Avatar for intes77
0
443
Member Avatar for saqib_604

There was a similar question [URL="http://www.daniweb.com/forums/post1381852.html#post1381852"]here[/URL]. Try to review the example, and if you still encounter any trouble I'll go over it with you.

Member Avatar for apines
0
306
Member Avatar for dead1
Member Avatar for sazad1

This is funny - you actually expect someone to build an ftp client for you and send you the jar file. [URL="http://tinyurl.com/y8o2qrq"]Here you go[/URL]. A simple search and a [I]little bit[/I] of effort: [url]http://www.jibble.org/simpleftp/[/url]

Member Avatar for sazad1
-1
190
Member Avatar for TraderX

You can define several accounts in outlook, and then choose from where to send. Take a look [URL="http://www.articlesbase.com/e-learning-articles/introduction-to-outlook-2007-managing-multiple-email-accounts-808237.html"]here[/URL]. Is this what you were talking about?

Member Avatar for BSkiLLs
0
212
Member Avatar for ymb6
Member Avatar for BboyRodimus

The code you have posted here seems fine. Can you post the code that prompts the user for input?

Member Avatar for apines
0
1K
Member Avatar for Phil++

Your code is reading the line, replaces the string, but doesn't write the new string back into the file. Half way there :)

Member Avatar for apines
0
96
Member Avatar for biggie_011

[QUOTE=biggie_011;1378503]Hi Guys, I'm trying to have the user enter an integer than an outline of a pyramid would be printed on the console. I just can't get the last line to print out with "*" all across. So say a user enters 5 I need the output to be: [CODE] …

Member Avatar for apines
0
125
Member Avatar for lu25

The main method's syntax is as follows: The main method's syntax is as follows: public static void main(String args[]) { // ... } The `args[]` variable is simply an array of String, and can be passed to other methods like every other variable. When typing in the command line parameters …

Member Avatar for coil
0
135
Member Avatar for javajavajava

[QUOTE=hanvyj;1381695]make an "add" method that creates a new array of the origional length plus one and copy all the values over - with the extra one :/[/QUOTE] That depends whether you can insert elements to any cell you see fit just like a regular array. What you are describing is …

Member Avatar for Eric Cute
0
218
Member Avatar for CLina

The solution you have provided for the first question is not recursive. You can have a recursion that will stop when max.next() is null, and otherwise will return the max value between the current node and the next node. [CODE=java]int findMax(Node node) { if(node.next() == null) { return node.getKey(); } …

Member Avatar for CLina
0
5K
Member Avatar for The Alchemist

If you guys are planning to study together to the exams, it's in your interest to share the notes with them - maybe they will understand things that you didn't, and by sharing with them it will help you as well. I am speaking as someone who took notes for …

Member Avatar for The Alchemist
0
135
Member Avatar for sciprog1

This is the Java forum, not JavaScript - you probably want [URL="http://www.daniweb.com/forums/forum117.html"]this forum[/URL] :)

Member Avatar for apines
0
98
Member Avatar for ssubnel

the syntax for the following methods is not coorect: [CODE=java]public return getMonthlyInterestRate(annualInterestrate) public return withdraw(balance, withdrawlAmount) public return deposit(balance, depositAmount) [/CODE] The Correct syntax is [CODE=java]public double getMonthlyInterestRate(double annualInterestrate) public double withdraw(double balance, double withdrawlAmount) public double deposit(double balance, double depositAmount)[/CODE] The syntax of Java methods is [CODE=java]<scope> <return type> …

Member Avatar for ssubnel
0
132
Member Avatar for 123a

Try to first copy one ArrayList to a new one. [LIST=1] [*]Create a new ArrayList. [*]Iterate over all the cells of the original ArrayList [*]Add each cell from the original ArrayList to the new one. [/LIST] After you have copied the entire original ArrayList to a new one, try to …

Member Avatar for JamesCherrill
0
153
Member Avatar for spades0001

Take a look at my response to your [URL="http://www.daniweb.com/forums/post1379071.html#post1379071"]previous post[/URL] regarding loops. The structure of the for loop is: [CODE=java]for (initialization; termination; increment) { //do something }[/CODE] Nobody said the that the initialization and increment parts need to be only by 1 each iteration. One can, for example increment as …

Member Avatar for tong1
0
131
Member Avatar for annitaz
Member Avatar for apines
0
97
Member Avatar for CompSci_Guy

Quick reading about inheritance [URL="http://download.oracle.com/javase/tutorial/java/concepts/inheritance.html"]here[/URL]. Now, let's review #4: [CODE=java]var4.method1();[/CODE] When class method1 in class Four is defined: [CODE=java] public void method1() { System.out.println("Four1"); super.method1(); }[/CODE] Meaning that first a line will be printed "Four1" and then the super.method1() will be invoked. You are right, you cannot see method1() inside …

Member Avatar for apines
0
967
Member Avatar for Cuchara

The expression (array[i]>otherVariable) is boolean - meaning it will return true if indeed array[i] is bigger than otherVariable and false otherwise. If you are trying to insert into myVariable the largest of the two variables, you might want to take a look at the [URL="http://download.oracle.com/javase/6/docs/api/java/lang/Math.html"]Math [/URL]class, spcifically the [URL="http://download.oracle.com/javase/6/docs/api/java/lang/Math.html#max(int, int)"]max(int …

Member Avatar for apines
0
82
Member Avatar for soccer13

I'm not sure that I understand your problem. If you represent the grades as String then if the length is more than 1, you have a sign afterwards, otherwise you don't. You can represent the grades using enum as well.

Member Avatar for apines
0
8K
Member Avatar for spades0001

[QUOTE=spades0001;1379037]I made a flowchart that will print counting numbers 1-10 automatically, and I'm supposed to print their sum and average at the end. Now, I have to convert the flowchart into three Java programs: For, While, DoWhile. I'm having a bit of a problem on the flowchart and the programs. …

Member Avatar for apines
0
204
Member Avatar for AlvinLiu
Member Avatar for atticusMom
Member Avatar for Taywin
0
121
Member Avatar for SabrinaAlex

If you can build an algorithm for this problem, it means that the problem is computable, therefore it can be done using a Turing machine (Church–Turing thesis). When you look at a string what do you do to determine if it's in the language? Perhaps something of the sort of: …

Member Avatar for paoconnell
0
183
Member Avatar for shamagantu
Member Avatar for apines
0
318
Member Avatar for muncher10

First of all, please wrap your code with [CODE=java] [/CODE] tags for more convenient reading. I have placed your main method inside the DataSet tester for now. This is the code again for clearer reading for everyone: [CODE=java]import java.util.Scanner; public class DataSet { private int sum = 0; private int …

Member Avatar for apines
0
157
Member Avatar for kezkez
Member Avatar for wobuaini

(a) i=i*2 means that the loop will iterate for log2(n) times, therefore your complexity for the first problem is O(log2(n)). All other operations such as System.out can be counted as O(1). (b) Correct. (c) Think how many times the recursion is called. It is like a loop iteration, all the …

Member Avatar for apines
0
159
Member Avatar for v30

If you solved the problem (by yourself, good for you) then please mark it as solved :)

Member Avatar for apines
0
146
Member Avatar for rasmn

Quadratic algorithm means that for input of size n the complexity will be O(n^2). In other words the operation of the algorithm, starting for some n, will be <= C*n^2 for some number C>0. In our case 500 = 5 * 10^2. Now replace 10 with 1000 and you will …

Member Avatar for apines
0
107
Member Avatar for DallasFan3

You need a method which accepts a String as the parameter [CODE=java] public static String translate(String word) { // TODO: Implement according to guidelines. } [/CODE] Now, lets think about the first case. You need to check and see [B][COLOR="Red"]if[/COLOR][/B] the first character of the word is a vowel (or …

Member Avatar for peter_budo
0
726
Member Avatar for seekdestroy

Let me get this straight - you have an array list consisting of N cards and you want to see that each one of the cards is different?

Member Avatar for apines
0
13K
Member Avatar for 123a
Member Avatar for LianaN
Member Avatar for nichu
Member Avatar for speedy94519

Mux circuits always come with input value that are powers of two, but you can define that some input entrances are blocked, meaning that no value will come of them.

Member Avatar for apines
0
154
Member Avatar for ottilie

[QUOTE=ottilie;1145389]Okay, I have this problem to do and I have no idea how to do it. Refer to the method result: [CODE]public int result (int n) { if (n == 1) return 2; else return 2 * result(n-1); }[/CODE] If n > 0, how many times will result be called …

Member Avatar for apines
0
129
Member Avatar for ewander

You need to visit the [URL="http://download.oracle.com/javase/6/docs/api/"]Java 6 API[/URL], more specifically the [URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html"]String[/URL] class in the API, and inside that you have all the methods that the String class have, among them is the [URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html#substring(int, int)"]substring(int beginIndex, int endIndex)[/URL] method. For any questions about Java classes and methods you can always …

Member Avatar for griswolf
0
90
Member Avatar for Haile12

[QUOTE=Haile12;1378574]Does anyone know how to hack passwords, like Facebook or email through Java?[/QUOTE] If you need to ask, you probably don't have the knowledge to implement the answer.

Member Avatar for peter_budo
-2
93
Member Avatar for vbx_wx

[QUOTE=vbx_wx;1378102][code] package cls; public class main34 { public static void main(String[] args) { for(int i = 2; i <= 100; i++) { for(int j = 2; j <= i; j++) { if(i % j == 0) { break; } else { System.out.println(i + " "); } } } } } …

Member Avatar for apines
0
88
Member Avatar for vbx_wx

>> - shift right. i.e. 20 >> 2 = 5 << - shift left. i.e. 5<<2 = 20 >>> - unsigned shift right. You can read it all in [URL="http://en.wikipedia.org/wiki/Bitwise_operation#Shifts_in_C.2C_C.2B.2B.2C_C.23_and_Java"]Wikipedia[/URL]

Member Avatar for Taywin
0
110
Member Avatar for sonakrish

[url]http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html[/url] [B]static void sleep([COLOR="Red"]long[/COLOR] millis)[/B]: causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds, subject to the precision and accuracy of system timers and schedulers.

Member Avatar for masijade
0
122
Member Avatar for kangkan_14

In concurrent programming (using threads) you might have a resource that you cannot have it being accessed simultaneously. For example, imagine that you have a linked list, and you want to remove a node from it. Imagine that in the middle of the removal, when not all the pointers are …

Member Avatar for Dhruv Gairola
0
287
Member Avatar for wowz

You are not incrementing the values properly in the next() method: [CODE=java] public int next() { int result = recent + previous ; previous = recent; recent = result; return result;// todo: Update previous and recent, and return result. }[/CODE] Your tester is basically a recursion that doesn't do anything …

Member Avatar for kramerd
0
181
Member Avatar for shahab.burki

You are iterating only once on the entire array, so I can't how your algorithm will work... I didn't check my code, but I think that should do the trick. It goes around all the subsequences possible and returns the start, end and max value of the subsequence with the …

Member Avatar for apines
0
193
Member Avatar for eppoair2

I agree with SasseMan, the problem is pure analytic. In addition, if you have to stop for 30min for gas and food, that depends where on the road you have to do it. If the gas station is reached before the t calculated in the previous section, then you have …

Member Avatar for apines
0
101
Member Avatar for --Fire--

It might sound really stupid, but something like this happened to me once and I simply renamed the folder, and it helped (Windows, go figure). Can't you just copy all the relevant material besides the problematic folder?

Member Avatar for Montreal
0
137
Member Avatar for apines

Hi all, I need some advice in implementing a new ADT that has length of n and the following operations: 1) Init() : Initializes all n elements to 0. Can assume that this is the first one called and called only once. 2) Write(i,x): write value x to position i. …

Member Avatar for ~s.o.s~
0
82

The End.