32,199 Topics

Member Avatar for
Member Avatar for Xufyan

In my program I've created two methods , one with integr type and other with float (line # 20 and 29) !! [CODE]class Stack{ int StackArrayI[] = new int[2]; //0,1,2,3,4,5,6,7,8,9 float StackArrayF[] = new float[2]; //0,1,2,3,4,5,6,7,8,9 int tos=-1; public void push(int value){ if (tos==1) System.out.print ("Stack already Full..!\n"); else StackArrayI[++tos] …

Member Avatar for Xufyan
0
112
Member Avatar for nix_xin

Simple Reusable Portable (Platform Independent) Distributed Robust Secure High Performance Dynamic Threaded Interpreted aside from those, what else are the fundamental components of java application programs?

0
55
Member Avatar for slixtrix

[CODE]import java.util.Scanner; import java.io.*; public class infixtopostfix { String fname; String output = ""; public infixtopostfix(){ System.out.println("starting infixtopostfix() method..."); getFileName(); readFileContents(); } public int priority(Object x){ if(x.equals('+') || x.equals('-')){ return 1; }else if(x.equals('*') || x.equals('/')){ return 2; }else{ return 0; } } public void getFileName() { Scanner in = new …

Member Avatar for slixtrix
0
142
Member Avatar for jems5

Since starting this course and seeking to join this forum, I have learned a lot and want to thank everyone for their assistance on my own forum questions as well as those I have read during research in this forum. Having said that I have another array question. I now …

Member Avatar for jems5
0
132
Member Avatar for justme_nick

I need to make a program to illustrate the Random Class and loop sentinels. So far, I can ask for the input of the number. After that, there are countless logical issues that are coming up. Can anyone help me sort this out? [CODE]import java.util.Scanner; import java.util.Random; public class HiLo …

Member Avatar for coil
0
106
Member Avatar for jwmollman

Hello, I'm trying to figure out how to populate an array by using subroutines. We have begun procedures last week, and now this week we are moving onto arrays. College moves too fast sometimes. :( What I'm trying to do is make a subroutine which will populate the entire array …

Member Avatar for NormR1
0
145
Member Avatar for xterradaniel

I need to create a custom panel that displays X,0, or nothing, randomly. It is supposed to be something like a tic tac toe board. The only thing is, when you open it it must randomly place the x's, 0's, or blank spaces, and when the screen is resized by …

Member Avatar for NormR1
0
133
Member Avatar for HDavison4139

what i am trying to do is this Display the mortgage payment amount and then list the loan balance and interest paid for each payment over the term of the loan. If the list would scroll off the screen, use loops to display a partial list, hesitate, and then display …

Member Avatar for NormR1
0
130
Member Avatar for HDavison4139

This is what i have so far.. i've figured out how to do the mortgage payment but I am having trouble displaying the loan balance and interest paid for each payment over the term of the loan. can someone please help with the code and formulas? Here's the code i …

Member Avatar for NormR1
0
568
Member Avatar for plasticfood

[CODE] int [] wronglist = new int [incorrect]; for (int i = 0; i < 6; i++){ for (int j = 0; j < i; j++){ if (studentArray[i] != ansArray[i]) wronglist[i] = (j+1); [/CODE] ok i'm trying to write a program that figures out what number did the user got …

Member Avatar for plasticfood
0
268
Member Avatar for mallak alrooh

hello Friends:; I have question and I wont your help.. I do it,but I'm stuk in printing :icon_cry:.. This the code, I hope you can help ,, Thanks Write a class TelephoneDirectory. It has a telephoneList attribute as a HashMap. The TelephoneDirectory has the following methods: a.addTelephoneEntry ( TelephoneNumber number, …

Member Avatar for JamesCherrill
0
261
Member Avatar for poly712

hi.. we really need help on how to d i s p l a y, a d d, s u b t r a c t, m u l t i p l y polynomials. the display should be in ascending order of degree.. and our program should be j …

Member Avatar for NormR1
0
142
Member Avatar for dreamsky999

Hi Netizens, I wish you guys can guide me in here. In the following code, I've compiled flawlessly and I didn't managed to get the output screen and I'm kind of in the dark since I didn't find the answer that I wanted through internet browsing after a while. Any …

Member Avatar for JamesCherrill
0
246
Member Avatar for Xufyan

in this program i've pushed 10 values into array but i use the condition [iCODE]if (tos==9)[/iCODE] which means no value should be stored at 10th position but when i am storing values, [iCODE]for (int i=1;i<=10;i++) first.push(i);[/iCODE] [CODE]class Stack{ int StackArray[] = new int[10]; int tos; Stack(){ tos=-1; } public void …

Member Avatar for NormR1
0
281
Member Avatar for wadelucy

I got some problem here..I wanted to generate 6 digits number without repeating into a textbox when the form load in java...but i m stuck and lost here...someone can help me ??

Member Avatar for kramerd
0
91
Member Avatar for mihu

Hallo everybody, Can someone help me with some regexs for testing : - in a textbox , i need to test only string carachters , not numbers,digits, spaces; - in a textbox , i want to text only numbers, not strings, char..other. Please.. Pattern patternForInfo = Pattern.compile("[a-zA-Z]", Pattern.CASE_INSENSITIVE); Pattern patternForNumere …

Member Avatar for mihu
0
145
Member Avatar for purijatin

What is the maximum size of one Datagram Packet java makes. Iam implementing my own protocol with defined features which runs over UDP. For every packet i have defined a set of headers. Now these headers are to be defined in every packet. So unless i do not know the …

Member Avatar for NormR1
0
97
Member Avatar for Lxyslckr

[CODE]import java.util.Scanner; import java.text.DecimalFormat; public class Assignment3 { public static void main(String [] args) { Scanner scan = new Scanner(System.in); String first,last ; int id; //First and last names and ID input System.out.println("Welcome to the Grade Calculator"); System.out.print("Please enter your first name:\t"); first = scan.nextLine(); System.out.print("Please enter your last name:\t"); …

Member Avatar for NormR1
0
129
Member Avatar for sky_B

I don't know what is wrong with my code here, the if conditions there never run true.[CODE] String words [] = new String[10];{ //Store the word string words[1] = "apple"; words[2] = "ice cream";} String searchData = ""; JTextField mySearchArea = new JTextField(7); public void init() { setLayout(new FlowLayout(FlowLayout.RIGHT,10,10); add(mySearchArea); …

Member Avatar for sky_B
0
118
Member Avatar for sixdegreesunder

Hi everyone, I m running program but got stuck in after if/else if statements, Jpane doesnt show anything.I couldnt figure out. Thanks [CODE]public class FancyGuessingGame { public static void main(String[] args) { Scanner console = new Scanner(System.in); int guess; int num; String name; String Guess; name = JOptionPane.showInputDialog(null, "Please enter …

Member Avatar for NormR1
0
142
Member Avatar for kkjava

HI All, can any one help me how to convert customize date formats like these below "JAN FY2010" "Q1 FY2010" [CODE]DateFormat df = new SimpleDateFormat("?")[/CODE] as i couldnt find any matching date formats to these. Appreciate your help!!!!!

Member Avatar for NormR1
0
159
Member Avatar for plasticfood

[CODE]public static int totalCorrect(String [] studentArray, String [] ansArray){ int numCorrect = 0; for (int i = 0; i < 6; i++){ if (studentArray[i] == ansArray[i]) numCorrect += 1; } return numCorrect; } [/CODE] instead of returning the actual number, it always return 0. here is the whole program: [CODE]import …

Member Avatar for plasticfood
0
129
Member Avatar for TahoeSands

For several weeks, I have been trying to wrap my brain around the concept of the paint(Graphics g) method. I have a pretty good idea how it works, but I am still struggling with the "practical" application of the paint method with respect to OOP. I can write small apps …

Member Avatar for TahoeSands
0
168
Member Avatar for NewOrder

[CODE] public class InnerEx7 { public static void main(String[] args) { Foo foo=new Foo(); Foo foo2=foo.stam(55); foo2.print(); } } class Foo{ String word="bye"; void print(){} // what does this fucntion do. why do i need it if it is empty public Foo stam(final int x){ final int y=10; class Inner …

Member Avatar for NewOrder
0
112
Member Avatar for NotSneaky

I need help with my sort. it will sort first name but when it gets to last name and DOB it wont. Please help me I tried bubble sort and it didnt work. I would like to use bubble sort. import javax.swing.*; import java.util.Scanner; /** * @(#)program 2.java * * …

Member Avatar for Ezzaral
0
102
Member Avatar for kandyhyatt

I'm having a hard time figuring out what i'm doing wrong. Can someone help ? this is the question : In the game of Craps, a "Pass Line" bet proceeds as follows. Using two six-sided dice, the first roll of the dice in a craps round is called the "Come …

Member Avatar for Ezzaral
0
103
Member Avatar for bmxbandit

Hello everyone, How do I use command line arguments from main(String[] args) as user input in java? My problem is that I need to make a program for an assignment. It needs to execute in 2 ways. If no arguments are entered, Ie. java myprogram it opens a menu that …

Member Avatar for NormR1
0
144
Member Avatar for fariya

environment variable1: %JAVA_HOME%\bin;%JC_HOME%\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar; environment variable2: C:\j2sdk1.4.1_07 hav 2 submit few progrms at college using servlets...n getting the errors mentioned abov...plzzzzzz hellllllppppppppp....

Member Avatar for peter_budo
0
106
Member Avatar for vskumar19

What is the difference between String s="abc" and String s=new String("abc");

Member Avatar for ~s.o.s~
0
73
Member Avatar for dangari

Hi all, I am working on a program that will take up Excel files, with columns in a certain order and with specific names, and load the data into a MySQL database table. This I have already achieved. [B]My challenge is how to have an email address where the Excel …

Member Avatar for dangari
0
147

The End.