7,116 Posted Topics

Member Avatar for Sherwin_4

> I'm having trouble coming up with a way to print the max and this line "The longest hailstone sequence starting 7 with a number up to has length____." for the output. You don't explain exactly where you are stuck, but all you need is something like for i = …

Member Avatar for Sherwin_4
0
2K
Member Avatar for Adm666

subSet method is way off - contains code that is not just unneccesary but actually prevents it working - it's really simple given what you already have done, but you have made it too complicated. s2 is a subset of s1 if for each element in s2 the element is …

Member Avatar for JamesCherrill
0
930
Member Avatar for Monique_2

Look at line 45. You have an extra `;` that completely changes the meaning of that line of code, and therefore the meaning of what follows.

Member Avatar for JamesCherrill
0
562
Member Avatar for Dani

Dani. Please. For the sake of all of us who love and contribute to DaniWeb, please stop fiddling about with techy black holes and put 100% of your time into saving DaniWeb. DW is the one and only flagship demo for Dazah. Without a thriving living growing example Dazah will …

Member Avatar for Dani
0
470
Member Avatar for shivali_1

There's nothing in Swing, but if you have moved up to javaFX then that has a date picker. Otherwise there are open source solutions such as http://www.codejava.net/java-se/swing/how-to-use-jdatepicker-to-display-calendar-component

Member Avatar for JamesCherrill
0
108
Member Avatar for Adm666

The surfing is still a nested loop potentially with On^2 (depending on how many zeros there are). Similarly Adam and Danis solution is also potentially On^2 You can make one pass ascending and set each element to its distance from the previous zero, then a second pass descending overwriting any …

Member Avatar for JamesCherrill
0
409
Member Avatar for Adm666

Doing it by comparing characters implies a loop or recursion that maintains a current index for each string - it's going to be quite fiddly to get right. As a completely different approach... if you write a method to remove all the duplicated consecutive chars from string2 then the result …

Member Avatar for Adm666
0
4K
Member Avatar for Monique_2

Some basics: Everything you use in Java must have been declared. You try to use a variable `employee` but you have not defined it anywhere. Spelling, including upper/lower case must be exactly correct... `print1n` is not the same as `println` Punctuation in Java has to exactly correct all the time, …

Member Avatar for JamesCherrill
0
657
Member Avatar for Aromal

The condition is that the string with all its letters reversed is the same. Alternatively, for each position `i` in the string `letter at i = letter at (length -i)`

Member Avatar for JamesCherrill
0
83
Member Avatar for Eugene_8

No need for an array, just read each line from the file, calculate the price x num tickets, add that to a total that you initialise before starting to read the file,

Member Avatar for rproffitt
0
617
Member Avatar for Jacob_10

Jacob You posted this before. You were referred to some good advice. You chose to ignore it and re-post. I'm closing this thread. Go back to your first thread and show some effort if you want help. JC

Member Avatar for JamesCherrill
0
125
Member Avatar for Jacob_10

> I need codes for issue and edit in library management systems No you don't. You need to learn php so you can code it yourself. It's what we call "education". Show what you have done so far, and someone will help you from there.

Member Avatar for JamesCherrill
-4
156
Member Avatar for NhejdLoise

It is covered in Oracle's Java Tutorials https://docs.oracle.com/javase/tutorial/uiswing/components/button.html

Member Avatar for JamesCherrill
0
311
Member Avatar for Belén_2

Sorry, my lack of Spnish makes that hard to understand, but I can see that you are using arrays when the spec asks for List. Anyway - what exactly is your question?

Member Avatar for JamesCherrill
0
292
Member Avatar for divinity02

Hi D2 - hadn't noticed that it was you! :) JC Sketching out a GUI is a good way to understand the requirements etc, but it's NOT the place to start actual development. This is an OO exercise, so start with the objects. Look for the important nouns in the …

Member Avatar for divinity02
0
2K
Member Avatar for Qayyum_1

I ws going to post you a "Let me Google that for you" link, but in deference to your seniority I won't :) Anway... > The Zakat is a form of giving to those who are less fortunate. It is obligatory upon all Muslims to give 2.5 % of wealth …

Member Avatar for neon_2
0
4K
Member Avatar for Peter_36

1. `y = x - (1+1)` is NOT the same as `y = x - 1 + 1` You should learn about operator precedence and L-R execution before criticising 2. Where exactly do you suppose OP should check for division by zero? That code does not have a single example …

Member Avatar for JamesCherrill
0
491
Member Avatar for Krunal_3

Maybe you need to work on your Google technique. I Googled `ACH - NACHA payment C# ` for 38,600 relevant hits. On the very first page I found a [GitHub project: C# library for the NACHA ACH input file structure](https://github.com/mrfright/NACHO) plus 4 more hits with actual solutions.

Member Avatar for JamesCherrill
0
95
Member Avatar for scheppy

Hi Scheppy Picking an unknow number of entries from an array of unknown length - you will have problems coding this with ordinary loops because you won't know how many loops to code. It has "recursion" written all over it. Eg array contains 1,3,4,3,5,8,2,1, target is 5 take the 1, …

Member Avatar for JamesCherrill
0
256
Member Avatar for ICHI_2
Member Avatar for JamesCherrill
0
227
Member Avatar for Dani

I also cashed in once to see how it worked. But dividing the reward by the number of posts I made it's clear that the financial motivation was vanishingly close to zero. I say "let it die a peaceful death"

Member Avatar for Matthew_17
4
388
Member Avatar for Suzie999

Every rule has its exceptions, and this is one. It's very common that you end up with a bag full of assorted utility methods that are low-level things used in various different parts of your system. A literal interpretation of SOLID says you should put each one in a different …

Member Avatar for JamesCherrill
0
223
Member Avatar for dhivya_1

Did you notice the pinned Programming thread "Read this before posting a question"? It's there for a reason https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question

Member Avatar for JamesCherrill
0
71
Member Avatar for can-mohan

It looks like the "manipulations" involve re-ordering the words, so the first stage would be to split the input into an array of words. ps: Have you identified the relationship between `n` and the exact manipulation yet?

Member Avatar for JamesCherrill
0
484
Member Avatar for Mark_61

If you have numbers to display in a JLabel there are two steps: 1. create a String that contains the info you want to display by combining descriptive text with the actual numbers 2. Use the JLabel's setText method to display the String in the JLabel eg: String textToDisplay = …

Member Avatar for JamesCherrill
0
332
Member Avatar for Anu_6

I see you failed to test this code, because it doesn't get anywhere near the stated functionality. If you don't understand why try these test strings: "This data has one sentence starting with a CAPITAL letter." "this has none, says James." "An ellipsis looks like this: ... . "É is …

Member Avatar for anand01
0
285
Member Avatar for Vegito1991

Never do this when writing new code: } catch (Exception e) { } If/when there is an error you just told Java that you didn't want to know anything about it, and please discard the detailed error message that Java just created for you. ALWAYS put an e.printStackTrace(); in your …

Member Avatar for Arun_18
0
6K
Member Avatar for eel

This is difficult, if only because the problem isn't rich enough to require much in the way of OO design or implementation. Anyway, here's one thought: We start with picking Objects from the components in the problem defintion (DataSet, Filter), but you also need objects to represent the overall processes …

Member Avatar for JamesCherrill
0
837
Member Avatar for jengels

Apart from being 11 years too late, your solution to counting capitals is way worse than the one in the previous post - not just longer more complex code, but fails completely for any alphabet other than basic English.

Member Avatar for JamesCherrill
0
4K
Member Avatar for can-mohan

Your question doesn't seem to make sense. You have one variable x that is defined in A and inherited in all its subclasses. That variable can only have one value at any one time. The constructors set x variously, and the value of x will be the last value set …

Member Avatar for can-mohan
0
476
Member Avatar for AQWst
Member Avatar for JamesCherrill
0
13K
Member Avatar for Seijuro

Hi avudai, welcome to Daniweb. Your thanks are welcome, but if you like a post you should show that by giving it an up-vote. Don't make a new post unless you have a relevant contribution to the actual topic. You should also be aware that this is a six year …

Member Avatar for JamesCherrill
0
8K
Member Avatar for ChangWon

Look at line 18 If you try to create a value greater than 3 this will reject it

Member Avatar for ChangWon
0
256
Member Avatar for Stanley_1

1. Google Java RSA 2. Click on any of the tutorial/example links that displays 3. Use some initiative and do a bit of work before posting another lazy request like this.

Member Avatar for JamesCherrill
0
73
Member Avatar for Smain

So let's suppose I have done what you said and modified my Ackermann function successfully. Now, did you have question, or were you just issuing some kind of Xmas holiday challenge?

Member Avatar for AssertNull
-1
424
Member Avatar for dennis_10
Member Avatar for markdean1989

It depends on your employer. Most companies expect you do attend meetings, drink coffee, document your code, fill in time sheets etc etc. Others expect you to code 22/24 hours for peanuts and treat you like an idiot slave. If you have any empathy sensors at all you will se …

Member Avatar for markdean1989
0
306
Member Avatar for brothman01

First thing is to fix that terrible catch clause. If/when there is an error you just told Java that you didn't want to know anything about it, and please discard the detailed error message that Java just created for you. ALWAYS put an e.printStackTrace(); in your catch blocks until/unless you …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Connie_4

/n has no special meaning. But \n is the new line character. The \ is used to start an "escape sequence" that allows you to enter special codes like the following either as a char or as part of a String: \b (backspace BS, Unicode \u0008) \t (horizontal tab HT, …

Member Avatar for brothman01
0
768
Member Avatar for Siberian
Member Avatar for pranjiee

You don't. Java is cross-platform, and exe files are not. Give him the jar file and it will run on his Windows/Linux/Mac computer - anywhere with a JRE installed. If for some obscure reason you absolutely must have an exe file for some specific operating system there are a couple …

Member Avatar for JamesCherrill
0
622
Member Avatar for HibaPro
Member Avatar for imchivaa
0
340
Member Avatar for Brian_22

I'm no expert at C++, so can someone else look at this and see if I'm missing something? > zachattack05 : 25 % 2 would return 5

Member Avatar for rubberman
0
541
Member Avatar for sireiz

Yes. The simplest way is to display each node as some kind of button. Edges are a bit more fiddly - you proably want to allow the user to tap "close" to the line because the line itself will be a difficultly small target. If the graph is tidy, with …

Member Avatar for JamesCherrill
0
317
Member Avatar for Violet_82

OK, it's a start. Be careful with your terminology. If Person is a class then the others have to `extend` it. If it's an interface the others `implement` it. Chosing between an abstract superclass and an interface is often one of those difficult decisions. Chose a class and you prevent …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Sulayman_1

> you can help, and send me an e-mail of solution No, absolutely not. That will not help you (unless your only objective is to be a learn-nothing cheat). Yes, we will help you, IF you make a proper effort to learn and develop. Show your work and we will …

Member Avatar for JamesCherrill
-2
860
Member Avatar for cproger

Are you sure that code is being executed? Maybe there's a problem with your listener. Try printing the selected index in those if tests to confirm. You can have a "total" variable that you add 250 or 500 (etc) to in your listener the set the text field to `total …

Member Avatar for JamesCherrill
0
327
Member Avatar for Angela_6

We only help people who are trying to help themselves. Your mastery of copy/ paste isn't enough. Don't post again until you have actually done some work, and have a genuine question

Member Avatar for JamesCherrill
0
166
Member Avatar for PulsarScript

Those two are not equivalent. In the first you seem to hope that allowing your entity manager to be garbage collected is enough to be sure you have no resource leaks. The second guarantees that the em is closed properly. The first is bad coding, the second is much better. …

Member Avatar for JamesCherrill
0
208
Member Avatar for gregkawere

Android: yes Windows: yes, but it's not the best option IOS: No, not possible <edit> Seems I was wrong about that - see OMAF below </edit> Having said that, switching language Java - C# - Swift isn't that hard. Its the API that's hard to learn and doesn't translate. Start …

Member Avatar for Andrew_35
0
637

The End.