32,204 Topics
| |
I was working on Problem 17 on Project Euler: [url]http://projecteuler.net/index.php?section=problems&id=17[/url] and I'm stuck; my answer is close, but not correct. I got the answer 21108 with the following code: I do realize the code can be optimized, but I would like to simply get this to work, and not try … | |
First off: I am not looking for somebody to do my homework. Although it would make it easier for me in the short term, please don't "help" me by writing my code for me. I would rather lose points for being late and understanding the code than get the grade … | |
Hi People, When creating this program, I am trying to add a while loop so that I can continue to pull in input from the user until they put a -1 for the input. This is the error I get. java:46: cannot find symbol symbol : variable input location: class … | |
Okey now the problem is that if the previewFrame is set to the default layout the buttons show but since it is using a layout manager the setBounds,setLocation,setSize commands dont work. So I used the code previewFrame.setLoayout(null) which would let me set my own position of the buttons on the … | |
Hey guys and gals I need alittle help. i have an assignment that needs to print a certian number of stairs according to a user input. Example program run (user input is in bold): Please enter the number of rows: 4 Please enter the number of stars in row 1: … | |
Hi we are supposed to modify this class for my school project to create a code that will print out a rectangle made of asterisks * something like ********* * * * * * * * * * * ********* here is my code [CODE] // Exercise 7.21: TurtleGraphics.java // … | |
I started developing an HTML editor using Java. After spending a lot of time I am now stuck in between. Most of the things are done but now I don't find any way to implement some of very important features. [B]I think[/B] java is too weak too support these features. … | |
Hello.. I'm new with java and have some problem with my assignment. I want to write a class named phoneBookEntry that has field for a person name and phone number. The class should have a constructor and appropriate accessor and mutator method. Then, write a main class that create five … | |
..Hi to all...just want to ask.. ..I have already created an ideal layout for my calculator..my problem is...I dont know how to insert a value into a field everytime I press a button(0 to 9)..without deleting the previous integer after I press my operator.. ..how shall I do so..??.. | |
is it possible to send an sms through JAVA.. My requirement is a chat application like Rediff bol. am able to do chat using networks. but can i be able to send sms. just like when i press a button called send sms then a window needs to get a … | |
Is this a simple way to return the number of occurrences of theValue in a bag? [code] /** * Return the number of occurrences of theValue in the bag. */ public int countOccurrences( String theValue ) { // fill in code for(int index = 0; index <= topPosition; index++ ) … | |
If you read the Prologue section of the code I posted it will give you an explanation of what I am trying to accomplish with this program. The problem I am having is that I am unable to find an example of how to pass an argument through the string … | |
please help me import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.net.*; import javax.swing.border.*; /** * Summary description for userlogin * */ public class userlogin extends JFrame { public static ServerSocket ssoc1; public static Socket sousoc1,ss1; // Variables declaration private JLabel userlabel; private JLabel jLabel2; private JLabel jLabel3; private JLabel jLabel4; … | |
hi, good day to you, [url]http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/WebCrawler.java[/url] :-/ can anyone run this code in eclipse IDE ? because i cant seem to run it though and it caused errors. Is this code meant to run in IDEs ? thanks for visiting this thread and hope you can help me. | |
I'm trying to create a class that reads in a set of numbers from a file, stores them in a generic array, and then sorts them using the generic bubbleSort method. I usually write in C++ and the switch from templates to generics hasn't been easy. I'm fairly certain my … | |
Hello [B]I am experimenting with Java applets & communicating between a Servlet & an applet. I am experiencing a HTTP 501 error when I go to retrieve the input stream from my URLConnection object.[/B] I know that the 501 error means that I am attempting to perform an action that … | |
this code does not compile successfully because of the error which says update is not an abstract and does not override abstract method validate in line 5 and line 14 class updateinfo implements validateinfo [CODE]public interface validateInfo { public void validate(String empcode, String password); } class updateInfo implements validateInfo { … | |
Im trying to make a tax and tip calculator and whenever the tax comes up it goes 10 or more decimal places and im trying to restrict it to two. [code=java] public static void main(String[] args) { double cost, total, tip, taxtotal, tiptotal, subtotal, grandtotal; Scanner myScanner = new Scanner(System.in); … | |
Hey all. I'm in the process of learning Java in my spare time, and I've bumped into a problem that I'm having a hard time wrapping my head around. I'm writing a small game (currently little more than an animation) involving a handful of blocks moving on-screen. I've created a … | |
Hi guys, my program im working on ends when it shouldnt..... here's the main method. [code] public static void main(String[] args) { String answer; do { boolean whole=false; boolean whole2=false; Scanner sc = new Scanner(System.in); int one=0, two=0; do { try{ System.out.print("Enter the first whole number: "); one = sc.nextInt(); … | |
I am using an array to store 5 test scores. Then I have another array for the total possible score the test could have. I just need to find out what percent the grade is out of the total possible score. [CODE]public class Main { /** * @param args the … | |
Hi Am currently taking a Java class and we are supposed to use turtle graphics to draw the following shape rectange made of Asterix ************* * * * * * * * * * * * * * * ************* My program builds and compiles successfully but I cant get … | |
Hi What is the best way to go forward with finding all possible combinations of nCr Eg: 5C3 for the number 12345 123 134 135 145 234 235 345 Like that thanks | |
hi guys.. can any gurus give me a hints or tips on implementing TF-IDf on java ? how do i start first? i am kinda confused here.. is it i need to read the file and count the words first ? | |
Hi, I have this really important project where in, I must perform the following tasks. VIEW - view records that are present in the database using a "primary key" ADD - add new records to the database EDIT - a specific line in the said record within the database [INDENT]Under … | |
Hello All I was using Java for capturing the screen and printing it. Now I need to capture the window, which is a ALt +Printscreen of Windows. I tried in Java. Could you pls help? Thanks in advance | |
Hi folks, I have a java maze, I cant seem to pass the 2d array to the next method. Any ideas on how i can do this? I need to get the character to move around the maze. Thanks [CODE] public class arrayAttempt1 { static int i=0; static int j=0; … | |
helow everyone!when i execute the following code,i have saved it as validateInfo.java it tells me that line 5:duplicate class:validateInfo.Please help public interface validateInfo { public void validate(String empcode, String password); } class validateInfo implements validateInfo { public void update() { //code to update information of customer } public static void … | |
[code]import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Books extends Applet { Choice b; String [] blist; //CheckboxGroup edition; int i; public void init() { setBackground(Color.green); add(new Label("Please Pick a Book:")); b = new Choice(); blist [0] = ""; blist [1] = "Java Programming"; blist [2] = "C# Programming"; blist … | |
I'm currently working on a tic-tac-toe program and it is working to the point that it runs and X's and O's appear. However when the right combination is made or the board gets full the method "Resultat();" should recognize it and "Clear();" should clear out the board and a JFrame … |
The End.