32,199 Topics

Member Avatar for
Member Avatar for mwenyenia07

Below is a two dimensional array ineteger variable. int[ ][ ] value={{1, 2, 3, 4 }, {5, 6,7}, {8, 9}, {10}} please write a java code that can print the values and sum the column values as shown below: 1 2 3 4 5 6 7 8 9 10 Sum …

Member Avatar for jwenting
-2
208
Member Avatar for kayleigh0411

I have to create a program that will calculate the the average miles per tank and the cost to fill tank of a car. The inputs are tank capacity, miles per gallon, and price per gallon, the outputs are average miles per tank and cost to fill tank. I have …

Member Avatar for Tarek_2
0
202
Member Avatar for engrjd91

I have the following code: import java.util.Scanner; public class WhileLoop { public static void main(String[] args) { int number; int maxValue = Integer.MAX_VALUE; int minValue = Integer.MIN_VALUE; Scanner input = new Scanner (System.in); System.out.println("Enter the length of numbers"); int loop = input.nextInt(); for(int i=1; i<=loop; i++){ System.out.println("Enter a number: "); …

Member Avatar for oussama_1
0
238
Member Avatar for moaz.amin.37

hello i have a problem with Priority when I set priority of any thread then I get wrong output my code is below class Run implements Runnable{ private String st; public Run(String s){ st=s; } public void run(){ for(int i=1 ; i<=10 ; i++){ System.out.println(st+"="+i); } } } class PriorityCheck{ …

Member Avatar for moaz.amin.37
0
258
Member Avatar for SQLpower

Hello, So I basically loaded to 2 keys and I want to verify them after I've signed something with one of them, but I a having difficulties. I am getting verified: false at the end without any error. Can someone please point out the flaw? package fliesigning; import static fliesigning.FlieSigning.verifySig; …

Member Avatar for SQLpower
0
285
Member Avatar for sekwamote

import java.util.Scanner; import com.sun.speech.freetts.VoiceManager; import com.sun.speech.freetts.Voice; public class TextToSpeech { public static void main(String args[]){ Scanner input = new Scanner(System.in); String userInput = input.nextLine(); if(userInput == "hi"){ Voice v; VoiceManager vm=VoiceManager.getInstance(); v=vm.getVoice("kutlo1"); v.allocate(); v.speak("Hey my name is kutlo"); input.close(); }else System.out.println("you suck try again"); } }

Member Avatar for jwenting
-1
95
Member Avatar for Gl753

My code has me stumped, My method is right...I think but the output begs to differ. Basically this code is supposed to convert seconds to minutes but the output is somewhat off..here's what I have don so far. String input = JOptionPane.showInputDialog(null, "Enter a value for seconds (positive whole number): …

Member Avatar for oussama_1
0
293
Member Avatar for ksekwamote

guys please help! im having trouble splitting a word into syllables. what i have so far is splitting a word into different compartment bt cant do syllables, i want the code to to be able slice a part of a word,by looking, vowels INSIDE the word!at the end of each …

Member Avatar for sekwamote
-2
2K
Member Avatar for Wisnu_2

Hello guys, i have a problem, is there someone can help me? this is my logic.. public static void Check_Fund(){ String header = "Text1,Text2,Text3,FUND_UALFND_1,FUND_UALPRC_1,FUND_UALFND_2," +"FUND_UALPRC_2,FUND_UALFND_3,FUND_UALPRC_3,FUND_UALFND_4,FUND_UALPRC_4,FUN D_UALFND_5,FUND_UALPRC_5," +"Text4,Text5,Text6,Text7"; String text = "ABC;CDE;EFG;PRMF;0;PRFF;50;PREF;;PRCF;0;PRMP;50;HIJK;;LMNO;PQRST"; String[] head; String[] value; String showText = ""; head = header.split(","); value = text.split(";"); String regex = "\\d+"; String …

Member Avatar for Wisnu_2
0
254
Member Avatar for Vinolia

hi guys.iv been trying hard to do a code which requires me to separate a word into syllables in java but i dont no hw to do it. e.g the word:someone #in syllable: so/me/on/e

Member Avatar for jwenting
-2
2K
Member Avatar for emmas4impact

Hello guys, I have the project to build an Automative Leads. The process flow for this scoring engine needs to be as: SOAP webservice will advertise a "SCoreLead" function that requires an ADF lead to be passed to it. any idea will be appreciated Thanks

Member Avatar for emmas4impact
0
218
Member Avatar for Toby_1

I am on euler project 4, the largest palendrome product of 2 3digit numbers. Here is the program, however it doesn't print a value. please help. package euler; public class problem004 { String reversed; public static void main(String[] args) { int product =0; String stringproduct; //cycles through all the numbers …

Member Avatar for Toby_1
0
162
Member Avatar for navjeet123

The requested resource is not available. please help me . how to solve this thnx in advance

Member Avatar for JamesCherrill
0
71
Member Avatar for My_1

I got everything until to the point that check if the space is emprty or not. I dont know how to do it. can someone give me an example?

Member Avatar for My_1
0
162
Member Avatar for Ritesh_4

Hello I have a text-editor (CKEditor one) whereby am retrieving all the texts (which are in 3 paragraphs), in a single string variable, using Java codes. However, all the 3 paragraphs being retrieved have leading spaces, and I want to remove them for display purposes. How can I do so, …

Member Avatar for stultuske
0
211
Member Avatar for kayleigh0411

There are no errors or anything in my code, and the program runs and works. However, when I only enter a value in one of the text fields to test the error message, it enters "0" in all of the text fields below it. How can I get it so …

Member Avatar for stultuske
0
278
Member Avatar for Vlad_2

What is wrong with my java code in Eclipse? I have 4 different classes and it won't give an output. the problems are in the scorestest with the print function and in scores with the nodes. Please help. ScoresTest: public class ScoresTest { public static void main(String[] args) { // …

Member Avatar for joseph.henriquez
0
246
Member Avatar for hahahanz

hi im having a hard time fixing and identifying the problem. sorry abstraction really confuses me. the problem is I should write a weather prediction program using the random number generator. three outcomes should be possible: rain sun and cloud. import java.util.Random; public abstract class WeatherPredicMain { public static void …

Member Avatar for stultuske
0
174
Member Avatar for engrjd91

I have a simple class named as Invoice, in which I'm taking four instance variables to intialize PART NO, PART DESCRIPTION, QUANTITY PURCHASED & PRICE PER EACH ITEM. I have made getters and setters for each variable, also a method is created in the same class as InvoiceAmount which Calculates …

Member Avatar for engrjd91
0
219
Member Avatar for Necrozze

So I have writen a program that takes a linkedlist and shuffles it randomly using mergesort algorithm. The problam I'm having now is that the original list loses elements after the shuffle, and after som checking with some outputs it seems that it always one of the extra lists who …

Member Avatar for Necrozze
0
812
Member Avatar for ashokkmr22

Need to set cache in browser using javascrip.If the internet is disconnected the web page is load by the same. Guide Me how will arrive this.

Member Avatar for AleMonteiro
0
70
Member Avatar for Shibbir Khan

I would like to stop and mark as failed too long running junit tests (executed within Maven 3 build). I am aware of three ways of doing it: 1) Using Test annotation with timeout parameter: @Test(timeout=100) public void testWithTimeout() { ... } 2) Using Rule annotation: @Rule public Timeout globalTimeout …

Member Avatar for ~s.o.s~
0
155
Member Avatar for moaz.amin.37

i write a code of multithreading in which arise an race condition code is below class Race1{ public void show(String s){ try{ System.out.print("["+s); Thread.sleep(1000); }catch(InterruptedException e){ e.printStackTrace(); } System.out.println("]"); } } class Checking implements Runnable{ Race1 ob=new Race1(); String s; public Checking(String s){ this.s=s; } public void run(){ synchronized(ob){ ob.show(s); …

Member Avatar for vantrendin
0
246
Member Avatar for Shibbir Khan

So i've got a for loop that's reversing every other word in a string. I can't determine which condition is causing this. I've spent a good amount of time staring at this and the API, to no avail. Anyone have any idea why it's not working? String newMessage; StringBuilder stringBuilder …

Member Avatar for JamesCherrill
0
162
Member Avatar for moaz.amin.37

when we create a thread like this class Run implements Runnable{ public void run(){ //You code } } class Helloworld{ public static void main(String args[]){ Thread t1=new Thread(new Run()); Thread t2=new Thread(new Run()); } } in above code thread t1 and thread t2 is creating in `main()` method its mean …

Member Avatar for JamesCherrill
0
268
Member Avatar for ajharul

Hi all! This is my frist discussion. I'm shearing you a very helpfull website that helping me to learn HTML,CSS,Javascrift online. It's w3schools Wish it will help you.

Member Avatar for shashikumar s g
0
220
Member Avatar for Stefce

Hello i have a little problem over here im trying to make a mouse listener and on mouse click the ball to come to the mouse pointer... i have maked a small "game" which is not bunch of confusing code... i have maked the ball to be controlled by the …

Member Avatar for Stefce
0
2K
Member Avatar for laavanya

What does this mean ? Statement st=con.CreateStatement(); how method of Statement interface is accessed by Connection interface reference con ? please help me to understand the concept...

Member Avatar for JamesCherrill
0
362
Member Avatar for Trevor_4

double hours=0, rate=0; double Federaltaxes, Ficataxes, Statetaxes; double netpay=0, grosspay=0, totaltaxes; if (hours <= 40){ System.out.println("how many hours did you work"); hours= input.nextDouble(); System.out.println("what is the rate you get paid"); rate= input.nextDouble(); grosspay= hours * rate; System.out.println("the gross pay is:" + grosspay); Federaltaxes= grosspay * .20; System.out.println("Federal taxes are:" + …

Member Avatar for oussama_1
0
90
Member Avatar for James_30

Changed properties on the embedded derby db. protocol, driver etc. org.apache.deby.jdbc.ClientDriver ... A connection could not be established

0
73

The End.