35,619 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
114
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
57
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
147
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
135
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
108
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
146
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
135
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
131
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
576
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
303
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
143
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
249
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
283
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
94
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
147
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
102
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
134
Member Avatar for punit.it

hello, iam trying to host jsp/servlet on IIS 7.0 web server and getting HTTP error 404.3: not found for more details open [url]www.scrapmania.co.in[/url] i have no experience in hosting, on googling i get a result to select jsp in scripting supports of parallels helm v4 control panel. but i get …

0
50
Member Avatar for serena5

Hi All, For my FYP I am investigating web-based IDEs. As part of the feasibility study, and primary research, I would like to get your views on what you think about programming online, and if you have ever used it, what was your experience. Here is the link to the …

0
54
Member Avatar for Ankit_Tripathi

Dear Freinds, I want to develop a newspaper website independently.Please Suggest me what can be a right strategy to develop it in J2EE.If we talk in terms of performance and scalability would it be possible to make my project with the help of Servlets and JSPs without using any particular …

Member Avatar for peter_budo
0
67
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
121
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
146
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
164
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
131
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
172
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
115
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
104
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
107
Member Avatar for nikita.chandra

hi ! I am working on a project Online Bus Ticket Booking System. I want to add online payment module. Have no Experience . Anyone can tell me the basic steps .... thanks in advance!

Member Avatar for CBski
0
220
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
150
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
109
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
76
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
151
Member Avatar for lockwater
Member Avatar for mitchneys

can anybody give me a code on how to put an image in a form. i am using a jreator 4.5. i dont know the code..please help me...tnx a lot..

Member Avatar for tong1
-1
85
Member Avatar for jems5

I would like to check user input value against a declared final variable to make sure it does not exceed the final int variable for the purpose of using in a try-catch-finally. [CODE] final int variable = 20; // Variable declared for max allowable int userInput = 0; // Used …

Member Avatar for jems5
0
106
Member Avatar for mitchneys

guys! can you help me convert this code to java language.... this is my code in c++....i need to convert in java.... # include <iostream.h> int num1,num2,sum; double add(double sum); int main() { cout<<"Enter first number"; cin>>num1; cout<<"Enter second number"; cin>>num2; sum=add(sum); cout<<"The sum is: "<< sum; return 0; } …

Member Avatar for mitchneys
0
138
Member Avatar for ANDIEniable

Hi Guys, i'm new to java and i need a code like a student form or employee on how to add, search, and delete a data in an array or list.. i'm very confused and i really need your help.. thanks.

Member Avatar for kvass
0
424
Member Avatar for plasticfood

[CODE]import java.util.Scanner; public class Highest{ public static void main (String [] args){ Scanner kb = new Scanner(System.in); int scores [] = new int[3]; String names [] = new String [3]; int highest = scores [0]; String names1 = names [0]; for (int i = 0; i<3; i++){ System.out.println("enter name and …

Member Avatar for NormR1
0
120
Member Avatar for ambikanair

HI All, I need to submit my feedback form contents to an e-mail id as soon as the user clicks the submit button. How will I implement this in java. I googled and found out that FormToEmail which is a php script does this. But since i Am using netbeans, …

Member Avatar for ambikanair
0
114
Member Avatar for eman 22

I have a problem when I make GUI using SWT. the ptoblem is I want to remove all component except one from the shell at specific event.but I'm not preffered to use setVisible(false) because the big numer of component which will remove . how can I do that?

0
53
Member Avatar for flyingcurry

I have a prime number method here which checks if the user input is a prime number, I've done some stuff to try to make it more efficient, but I am wondering if there is anything else that can be done, maybe even make the complexity class constant? Thanks. Below …

0
110
Member Avatar for xterradaniel

EDIT: Never mind I figured out what to do to get the results I wanted. It came to me less than a minute after finishing my post. Thanks anyway... Hello all, I wrote the required program that I must turn in tomorrow. However I have one hangup, I am supposed …

0
86
Member Avatar for javaAddict

Hi, here is the question: I have 2 textfields in my JSP: [CODE] <s:textfield name=" ...." /> <s:textfield name=" ...." /> [/CODE] Now I went to browser and did: View Source Code, and noticed that around the above tags, there were auto-generated tags that put the above fields into 2 …

Member Avatar for garaki
0
1K
Member Avatar for andyluvskrissy

[code] import java.util.*; import java.text.*; import javax.swing.*; class Lab4Part2{ public static void main (String[] args) { String ex1; Double num, F; final int a=0, b=0; JFrame myWindow=new JFrame(); myWindow.setSize(500,400); myWindow.setTitle("Calculator"); myWindow.setVisible(true); myWindow.setLocation(600,200); ex1=JOptionPane.showInputDialog(myWindow, "Enter an expression"); F=Double.parseDouble(ex1); num=(a+b); JOptionPane.showMessageDialog(myWindow, "The sum is "+num); } } [/code] I need some help …

Member Avatar for NormR1
0
180
Member Avatar for jems5

My program requires that the user input values for an array do not exceed a declared final int variable. To control this I wrote this code to catch and throw exceptions in order to prevent computer from crashing the program. There are two conditions to be handled. (1) Exceeding array …

Member Avatar for dangari
0
146
Member Avatar for tonyfingures

Hey! guys, i need help figurering out how to make this program ran. Jack has decided his student organization is going to sell Oktoberfest shirts at Oktoberfest. In order to compete with other clubs, he wants to offer a 10% discount to anyone who buys 5 or more shirts. Also, …

Member Avatar for JamesCherrill
0
163
Member Avatar for dorotalp91

Write a program that generates a pyramid of numbers from a users input (kbReader = new Scanner(System.in)) for example the number 5 is inputted and the wats printed is... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 help?

Member Avatar for cazio_)15
0
146
Member Avatar for gauravk_bhanot

This is the code of my key listener for a game.The keys move a plank upwards and downwards for two players.The problem is when one player keeps a key pressed then the other key event does not execute.what i want to do is that both players should be able to …

Member Avatar for NormR1
0
193

The End.