32,199 Topics

Member Avatar for
Member Avatar for yoshio5908

Hello everyone at Daniweb! This is my first post here, sorry if i do something wrong. Ok, so just a quick background on me and where I'm at in java. This year I'm taking my first Comp Sci class as CSUN (Cal State University Northridge). I am a complete beginner …

Member Avatar for leodash
0
809
Member Avatar for maverick420

I'm trying to write a test class which shows the user the following menu and implements all options. The program should continue to run and process requests until the user chooses to exit. The program should double-check that the user really wants to exit. All input must be validated and …

Member Avatar for stultuske
0
244
Member Avatar for spades0001

Hey guys! I'm trying to figure out how to create a program that lets the user find a picture on the hard drive and display the picture. How can I accomplish this?

Member Avatar for niranga
0
105
Member Avatar for raul8

Hi, I have an XML, I need to create 2 classes: 1. For converting XML into XSD for getting its node objects. 2. For fetching values in each node. I have to use JAX-B for this but I don't know the steps. Please suggest some procedure or decent tutorials I …

0
54
Member Avatar for Rzink92

I have a tic tac toe board i am finding it hard to figure out how to change parts of the array that contains char. I am looking for a way to to ask the user to select a char to change in the the array and then once they …

Member Avatar for Rzink92
0
88
Member Avatar for ali11

I m new.I am not getting any result for Number of A Number of B Numbers of C Number of D number of F for A,B,C,D,F i always get 0. [CODE]import java.util.Scanner; public class ExamScores1 { public static void main (String[]args) { String a; int count= 0; int grade=0; // …

Member Avatar for hfx642
0
146
Member Avatar for sike.mausa

I am trying to read a file using a string input as the filename. For example, if the filename is datafile.txt then if the input is "datafile.txt" and there is a file of that name in the directory, how do I read it? Here is my initial code: [CODE]Scanner kbd …

Member Avatar for Aviras
0
178
Member Avatar for softDeveloper

Hi all, Does anyone know how to read a .doc file with reader in java? Is it possible to read a doc file the same way you read a txt file? Thanks in advance

Member Avatar for hfx642
0
57
Member Avatar for win10301

it says can not find symbol.... [CODE]import java.util.Scanner; public class wage2 { private static Scanner Reader= new Scanner (System.in); // private static double OverTimeRate=1.5; public static void main(String[] args) { //constants double person_Name; double hourly_wage; double regular_hours; double overtime_hour; double regularpay; double overtimepay; double totalpay; person_Name=InputPersonName(); hourly_wage=InputhourlyWage(); regular_hours=InputRegularHours(); overtime_hour=InputOvertimeHours(); regularpay=regular_hours …

Member Avatar for hfx642
0
86
Member Avatar for fishStudent

I can't get the object array in lab9 class (named "thelist") to be populated with objects from the Foreign class. please see line 35 in lab9 class. I've tried using toString, useing a Foreign type variable as a parameter in a addData(), a addData() method ect... I am really really …

Member Avatar for NormR1
0
203
Member Avatar for fmnajp

I am new to Java and I am having trouble knowing if my array is populating when I click the enter button and printing out the data into the text area when I click the run reports button. When I put data in the text boxes the boxes are being …

Member Avatar for fmnajp
0
192
Member Avatar for DK58

Ok so my problem should have a fairly simple fix. My program takes the number of families and their income and prints the families that make less than 10% of the maximum income. Below is a sample run. Please enter the number of families: 5 Enter an income: 8500 Enter …

Member Avatar for DK58
0
96
Member Avatar for ndb1995

My problem is in the guessing method, I am not sure if the way I set up playing the game again works, (don't know if entering yes will work) and I'm not sure on how to call the main method to play again, and also I'm suppose to give the …

Member Avatar for ndb1995
0
191
Member Avatar for eddy556

No I know that in order to compare a String you have to call its method .equals but how I check if a String is NOT equal to something? Will it be something like if ("hello" != String.equal())?? or is there a special method? I know I'm being dumb here …

Member Avatar for stultuske
0
754
Member Avatar for Zuni123

I'm getting Error: `<identifier>` expected and not sure why, any tips? public class BioCalc { // instance variables private Date myToday;//Date object today private Date myBday;//Date object birthday private int myDaysAlive;//birthday-today private final int PCYCLE=23;//physical length private final int ECYCLE=28;//emotional length private final int ICYCLE=33;//intellectual length /** * Constructor for …

Member Avatar for stultuske
0
321
Member Avatar for sike.mausa

Hello. I'm attempting to start a Caesar cipher program and can't get the program to display the output key[1]. Here is my code: [CODE]import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Caesar { private String[] key = new String[26]; public static void main(String[] args){ Scanner kbd = new Scanner(System.in); String …

Member Avatar for NormR1
0
141
Member Avatar for Yaseen16

Can anyone develop the Ideal height calculator with following specifications? The picture of required software is attached Write the ideal weight calculator so that height in inches is entered by using a slider. Use the approximate formula: W = H2 / 30 , for female W = H2 / 28 …

Member Avatar for Yaseen16
0
212
Member Avatar for tygergyrl

i am trying to put this together so it opens a file sorts the data saves a file and appends a file i have got my self so confused. can any one help???? this is the code Ive got so far. [code]import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import …

Member Avatar for StephNicolaou
0
158
Member Avatar for eddieteddie

Hi everyone I have an exam coming up soon, and now is the time for review. I have some questions regarding this review, I will only ask the ones I am so unclear about. [CODE]How many times will the following do-while loop be executed? int x = 11; do { …

Member Avatar for JamesCherrill
0
160
Member Avatar for amras123

[CODE] package primecdesc; import java.util.Scanner; public class Primecdesc { public static void main(String[] args) { Scanner myScanner = new Scanner (System.in); int a,b=0,ctr=0, ktr=1; System.out.print("Enter a number: "); a = myScanner.nextInt(); while(b>=1001) { if (a%b==0) b++; ctr--; } /*for(b=1;b<=1001;b++) { if(a%b==0) ctr--; }*/ if(ctr==1) { System.out.println(a + " is a …

Member Avatar for JamesCherrill
0
162
Member Avatar for pro_learner

I get this error in my Java programme which coded by me according to a tutorial.I coded it to connect my Java App with MySql database.This is the code.[CODE]package Gui; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; /** * * */ public class connectionconfig { private connectionconfig() …

Member Avatar for masijade
0
278
Member Avatar for Pravinrasal

I want display 2nd cycle after sleeping 1st cycle time 1 second after that display 2nd ,3rd and so on.... I bold my thread code in above program.... [CODE] public class MainDrawCycle extends JPanel implements ActionListener ,Runnable { JButton button; JLabel lblclkValue,lbldispValue,lblTitle; JTextField textField; JScrollPane pane; JPanel panel; JFrame frame; …

Member Avatar for JamesCherrill
0
443
Member Avatar for sidra 100

hey i have written this code to make a GUI but it compile correctly but gives error at run time. the error is exception in thread main "java.lang.NullpointerException" at GUI.intGUI(GUI.java:22) at GUI.(init)(GUI.java :75) at GUI.main (GUI.java:79) the code is [CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUI { JFrame …

Member Avatar for peter_budo
0
220
Member Avatar for drameshgar1

import java.util. *; import java.util. ArrayList; public class Module { private int moduleCode; private String classlist; private ArrayList<String>studentsEnrol; public Module(){ studentsEnrol = new ArrayList<String>(); } public void storestudent(String student){ studentsEnrol.add(student); } public String classlist(){ return classlist(); } This is a code i wrote, the code meant to store student in …

Member Avatar for stevanity
0
213
Member Avatar for cvanithakpm
Member Avatar for cvanithakpm
0
96
Member Avatar for rahul.ch

[CODE]class Mammal { String name = "furry"; String makeNoise() { return "generic noise";} } class Zebra extends Mammal { String name = "stripes"; String makeNoise() { return "bray";} } public class Zoo { public static void main (String[] args) { new Zoo().go();} void go() { Mammal m = new Zebra(); …

Member Avatar for rahul.ch
0
151
Member Avatar for ali11

Hi i am looking for following output.I am just getting 0 for a,b,c,d,f. total no of grades Number of A's Number of B Numbers of C Number of D number of F [CODE]import java.util.Scanner; public class ExamScores { public static void main (String[]args) { String a; int count= 0; int …

Member Avatar for Rzink92
0
136
Member Avatar for cgen

I'm finding it difficult to implement an in-place algorithm for bucket sort. The question and my attempt are below. Can anyone give me a hint or an explanation of how I can implement in-place bucket sort? Q: Use the bucket sort idea to sort in-place an array of n records …

0
80
Member Avatar for writeout

Hello forum, I want to write a simple code of two dices rolling for two players. The players can roll as many times as they want per turn. If they are matching numbers, the total is zero. If a person passes, it is passed on to the next player. Please …

Member Avatar for CSloan7597
0
295
Member Avatar for mv740

[CODE]import java.util.Scanner; import java.util.Random; public class test { public static void main(String[] args) { Random rand= new Random(); // being able to use random object int[][] array = new int[3][9]; // print array in rectangular form for (int i=0; i<array.length; i++) { for (int j=0; j<array[i].length; j++) { int k …

Member Avatar for hfx642
0
210

The End.