36,051 Topics

Member Avatar for
Member Avatar for chonobob

Hey everyone, I have been assigned to create a recursive maze program and I am having trouble to figure out how to start it. I am pretty much lost and confused and don't know what to do. I do not want anyone to complete it for me but giving me …

Member Avatar for JamesCherrill
0
607
Member Avatar for ELMX27

i have to create a DigitsDisplay application that prompts the user for a non negative integer and then displays each digit on a separate line like such "Enter a positive integer: 789 7 8 9 so far i have int num; c.print ("Enter a postive number: "); num = c.readInt …

Member Avatar for stultuske
0
2K
Member Avatar for rami sohaill

hello everyone i'm trying to create algoithm for binary search in multi dimensinal array i have done it on one dimensinal and changed some things but still there is something wrong here's the code i hope you can help public static void binarysearch(int [][] numbers,int searchedvalue) { int lowrow = …

Member Avatar for rami sohaill
0
224
Member Avatar for michelleruth

Write java program to do the following:  Write a METHOD to input an array of type LONG that stores the value of all the powers of 2 from 0 to 63 (i.e. 2^0 to 2^63 )  Output the contents of the array screen (what happens if you try …

Member Avatar for michelleruth
0
2K
Member Avatar for alek.mieczkowski

Hi all, Im writing a program, that takes the a, b, and c from an equation, and uses them to find x using the formula: [http://www.purplemath.com/modules/quads/qform01.gif](http://www.purplemath.com/modules/quads/qform01.gif). The problem im getting, is that when I plugin the equation 1x^2 +3x +4 I get x = -Infinity and x = infinity instead …

Member Avatar for M4trixSh4d0w
0
248
Member Avatar for anisha.silva

hi i create a jsp and a servlet to get data from the data to be displayed in the jsp page. the code is below ListCustomer.jsp <table id="customerListTable" border="3"> <tr > <th bgcolor=>ID</th> <th bgcolor=>Name</th> <th bgcolor=>Address</th> <th bgcolor=>TelNo</th> <th bgcolor=>Req</th> </tr> <c:forEach var="customer" begin="0" items="${requestScope.customerList}"> <tr> <td>${customer.cusid}&nbsp;&nbsp;</td> <td>${customer.cusname}&nbsp;&nbsp;</td> <td>${customer.cusaddress}&nbsp;&nbsp;</td> …

Member Avatar for LastMitch
0
263
Member Avatar for chitrasuriya
Member Avatar for joshfizzle

This is my first program apart from the infamous "HelloWorld" one. The purpose of this program is to simulate a lottery number generator. The program is printing numbers which is great, but it isn't behaving like how it should. It's supposed to print 100 number combinations and it only prints …

Member Avatar for joshfizzle
0
230
Member Avatar for smurfy

Hi to Dear Daniweb Members, The application populates data from database into JTable in Netbeans. It has 2 classes. First class retrieves all data from Employee table using Derby. Second class creates the GUI with a JTable component inside it. However i got the following messages. I am so confused. …

Member Avatar for stultuske
0
2K
Member Avatar for smurfy

Dear Daniweb Members, First of all sorry my english writing. I installed JavaJDK 7u13 with NetBeans 7.2.1 and db-derby-10.5.3.0-bin.zip on a fresh OS. Then i set the environment variables according to their relative paths as seen below. By using ij the test database and the test table created, records inserted …

Member Avatar for stultuske
0
2K
Member Avatar for andrew.ferrebee

im having a little troubele with this problem. i am working on an intrest calculator and have hit a snag.its saying there is error with my Math.pow punction can someone help please. ill add what i have so far below import java.util.Scanner; public class Calculator { public static void main …

Member Avatar for radhakrishna.p
0
240
Member Avatar for smurfy

Dear Daniweb Members, First of all sorry my english writing. I installed JavaJDK 7u13 with NetBeans 7.2.1 and db-derby-10.5.3.0-bin.zip on a fresh OS. Then i set the environment variables according to their relative paths as seen below. By using ij the test database and the test table created, records inserted …

Member Avatar for radhakrishna.p
0
429
Member Avatar for nostalgia

Hello, I'm trying to code a genetic algorithm in java but my code doesn't seem to be working as it should. I think the problem lies within my roulette wheel selection method. Can anyone spot it/point me in the right direction on how to solve it? private static Individual[] rouletteWheelSelection2(Individual[] …

Member Avatar for M4trixSh4d0w
0
3K
Member Avatar for hwoarang69

i dont understant why its not going inside "error_01 or error_02" if statment? if user enter username and hit sumbit than it goes in "worked" if statment but if user dont enter any thing in usrname it still go in "worked" if statment. <!-- login form --> <form method ="POST" …

Member Avatar for M4trixSh4d0w
0
194
Member Avatar for hwoarang69

i have project folder name: website_test package name: hello_servet testing_01.java web.xml index.html i need help with servlet name. i think iam names wrong. for ex is servlet-name the class name or project folder name?? web.xml file: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <servlet> <servlet-name>website_test</servlet-name> <servlet-class>hello_servet.testing_01</servlet-class> …

Member Avatar for LastMitch
0
212
Member Avatar for javaprog200

Hello, I am trying to learn how to use the JGrapht API and a sample program on the web has the following line on how to create a SimpleGraph: SimpleGraph graph = new SimpleGraph<String, DefaultEdge>(DefaultEdge.class); The above line is clear execpt for the "DefaultEdge.class" in the parenthesis. What's the significance …

Member Avatar for M4trixSh4d0w
0
113
Member Avatar for gkaran487

I have a string as [Ian Wood P. M. Visscher] [Ian Wood L. Mengersen] [Ian Wood] [P. M. Visscher Ian Wood].I want to write this string into two dimensional array. (i.e) String a[0][0]=Ian Wood ,a[0][1]=P. M. Visscher,a[1][0]=Ian Wood, a[1][1]=L. Mengersen and so on.Every time when I would give input, the …

Member Avatar for JamesCherrill
0
271
Member Avatar for ray.chappel

I am working on a project that is suppost to work with 3 xml files. The program is suppost to ask which file you would like to import. It then makes a new folder in the current directory. The program is supposed to create a new file in the created …

Member Avatar for ray.chappel
0
373
Member Avatar for new_zal

Hi all Just looking a creating a possible java or jsp based messenger for a web site. I have tested java based lan messengers, p2p messengers and even openfire+spark+smack instant messaging, XMPP (also called Jabber) which I admit I liked a great deal. They say dont try re-invent the wheel …

Member Avatar for M4trixSh4d0w
0
424
Member Avatar for engrjd91

Scanner input = new Scanner(System.in); System.out.println("Enter a value : "); String s3 = input.next(); System.out.println("Enter another value: " ); String s5 = input.next(); String s = ("1= add, 2 = subtract"); int op = Integer.parseInt(s); double result=0; switch (op) { case 1: result = addValues(s3, s5); break; case 2: result …

Member Avatar for engrjd91
0
138
Member Avatar for engrjd91
Member Avatar for engrjd91
0
143
Member Avatar for aabbccbryanmark

hi folks, im having a problem here on my code can't figure what's wrong.. so here's my code: import java.awt.*; import java.awt.Font.*; import java.awt.Color.*; import java.awt.Button.*; import java.awt.event.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.*; import javax.swing.JOptionPane; public class Calc extends JFrame implements ActionListener { JTextArea txtArea; static final …

Member Avatar for stultuske
0
556
Member Avatar for sufu
Member Avatar for tux4life
0
109
Member Avatar for maxbummber

I was proposed a project that sounds like this. Consider a set of logical gates like AND, OR, XOR or NOT. Allow for building any logical circuit by connecting such gates. Provide input (0/1) to a number of gates and collect the results at the output of some of the …

Member Avatar for maxbummber
2
294
Member Avatar for Fernando_1

System.out.printf("\nRegular pay:$ %.2f",regularPay) System.out.printf("\nOvertime pay:$ %.2f",overtimePay) System.out.printf("\nTotal Pay:$ %.2f",overtimePay+regularPay); to print like /Regular Pay: $ Overtime Pay: $ ///Total Pay: $ ignore the '/'

Member Avatar for bguild
0
171
Member Avatar for amrita111

I have created my project using jsp,servlets.I have also used meta tag for deleting browser's cache. Once logout,the user should not be able to perform any function using back button.I dont want to disable back button.The user should be on logout page even if he presses back button.

Member Avatar for LastMitch
0
98
Member Avatar for yup790

Sorry for the long code. Here it loops through a text file with up to 5 lines and reads a random line. If the line it reads is null then it generates a random response. However when compiled with a test file of 2 lines it only has an output …

Member Avatar for yup790
0
186
Member Avatar for breakingthekonkrete

Write a Java program to do the following: A dairy farm sells organic brown eggs to local customers. They charge $3.25 for a dozen eggs, or 45 cents for individual eggs that are not part of a dozen. Write, compile, and test a Java class that prompts a user for …

Member Avatar for peter_budo
-4
317
Member Avatar for john.stepanek.9

This prompt scanner works outside of this program but when i integrate it, it doesn't work: All code work. just no together. Help would be much appreciated. Scanner in = null; Scanner key= new Scanner(System.in); System.out.print("Input file name: "); try { String filename = key.nextLine(); in = new Scanner(new File(filename)); …

Member Avatar for Starstreak
0
309
Member Avatar for Louie_Rave

Uhh, hello. I just want to get a sample line of codes that displays the given string, insert a new element and deletes an old element. So far, this what I have done: import java.io.*; public class EmpLists { String employees[] = {"A", "B", "C", "D", "E" }; } class …

Member Avatar for Louie_Rave
0
509
Member Avatar for fazae

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Calculator extends JFrame{ // Declare GUI components private JTextField jtfFirst; private JTextField jtfSecond; private JTextField jtfResult; private JLabel jlblFirst; private JLabel jlblSecond; private JLabel jlblResult; private JPanel entryPanel; private JPanel buttonPanel; private JButton jbtAdd; …

Member Avatar for fazae
0
233
Member Avatar for sofien.fkih

I have done the following codes to create a bar chart with the data from DB, and save it as an JPEG file. I wanted to add percentage value anywhere in the table, JDBCCategoryDataset dataset = new JDBCCategoryDataset("", "oracle.jdbc.OracleDriver", "", ""); String query = "SELECT std,id from table"; dataset.executeQuery(query); JFreeChart …

Member Avatar for nandosss
0
131
Member Avatar for london-G

Hello, When I run the project using my localhost, everything works fie. But when I use an other server I get this error: No suitable driver found for jbdc:mysql:// public void populateList2() { Connection con = null; Properties conProps = new Properties(); conProps.setProperty("user", "abn859"); conProps.setProperty("password", "100011399"); try { con = …

Member Avatar for tux4life
0
312
Member Avatar for jocelyn.eyog
Member Avatar for narino

well, this question maybe so silly, but i need to know.. i have to make an application with client-server system with java (client application for on android and server application for on PC) and i asked to make the class diagram for both in one class diagram (not seperately). so …

Member Avatar for georges-l5
0
1K
Member Avatar for shibu2all

Hi, Can anyone please help me out .I am trying out to send a mail using JAVAMAIL API, While executing the jsp code on server it is throwing few exception error. <%@ page import="java.io.*,java.util.*,javax.mail.*"%> <%@ page import="javax.mail.internet.*,javax.activation.*"%> <%@ page import="javax.servlet.http.*,javax.servlet.*" %> <% String result; // Recipient's email ID needs to …

Member Avatar for stultuske
0
401
Member Avatar for chandub

hai every one.. am uploading image file before uploading i want know the height and width of image and also size of file please help in java script. thank you

Member Avatar for chandub
0
246
Member Avatar for jalpesh_007

I have made following code.The first statement gives me output 21. That is i know that default capacity is 16 + 5 for Hello But i don't get, why it gives 44 as output as i am increasing capacity from 21 to 30 by using ensurecapacity() method. StringBuffer sb = …

Member Avatar for jalpesh_007
0
194
Member Avatar for rchrist3

So im working on a public and private case and i posted ealier with issues, but i thought i had most of them fixed and turns out fixing those just opened up more problems... any help is appreciated thank you! ( I am very new to using java...) /** * …

Member Avatar for tux4life
0
278
Member Avatar for ricardo_maple

One large chemical company sells its chemical equipment at the following rates: Equipment Code Description Price RQ1 Reactor 0.5KL GMP $1500 RQ2 Reactor 20 KL Non GMP $3000 The company pays its salespeople on a commission basis. The salespersons receive the basic pay of $ 2000 per month plus a …

Member Avatar for CleanSanchez
0
146
Member Avatar for terence193

My problem is with a **Polymorphic** method , getSalary (which should be of type double. The problem is that the salary in this case depends on the average mark of a student and thus I felt the need for an **If Statement** because of the 2 conditions. However java does …

Member Avatar for deceptikon
0
183
Member Avatar for ganges
Member Avatar for terence193
-1
188
Member Avatar for rchrist3

I have been working on this code for days now and I am down to one error:error: class, interface, or enum expected showing at line 56, I have no idea why it won't work... any suggestions? thanks! import java.util.*; public class Pet { // This gives the user a field …

Member Avatar for rchrist3
0
782
Member Avatar for Cameronsmith63

Ok so I do not know where this post belongs, but apparently, Java is the language that is used for Arduino boards...I thought that it would be C. I have no idea where to begin, but I am really interested in tinkering with Arduino boards. Like REALLY. So I need …

Member Avatar for Cameronsmith63
0
187
Member Avatar for awfootball7

Hey guys I'm having problems figuring out how to write my driver class for my Array class. My questions 1.How do I make the array in my Array class reference the array in my Driver class? 2.How do I pass my class methods from my Array class to my Driver …

Member Avatar for stultuske
0
741
Member Avatar for awfootball7

Hey guys looking for some help with my ArrayTester class... The array is supposed to 1.create a 20 element int array and populates it with random elements in the range 20 through 65 (both inclusive). -I Believe I have already done this. 2.Use the java.util.Random class with a seed of …

Member Avatar for stultuske
0
329
Member Avatar for Lindsey1211

Hi! So i'm trying to code a program that works like an ATM machine. You 'insert a card' and then enter your pin. once the program has verified your pin, you may continue on to the next steps which include making a deposit, withdraw, printing a monthly statement and checking …

Member Avatar for stultuske
0
228
Member Avatar for adecker0033

I'm writing a class to represent a flight. The only error I'm getting is on line 97. Flight.java:97: error: missing return statement /** Class Flight represents a plane at an airline Author: Anna Mae Decker E-mail address: adecker0033@kctcs.edu Last changed: 02/10/13 Assignment1 */ public class Flight { /* * declare …

Member Avatar for stultuske
0
207
Member Avatar for Arjun_Sarankulu

I have done RND on Spring Application development on Apache Server at home which works fine. Now we are about to start the development of web application using Spring in my company. Is Spring deployment is feasable with **sun java system web server** And which tool to prefer for development …

0
81
Member Avatar for Lindsey1211

Im trying to call the method "public void insertCard(int p)" within the same class into the method " public void deposit (double amount) " My code for both methods is displayed below. the objective would be to have the deposit method return the last print statement if the card is …

Member Avatar for csstu
0
267

The End.