32,199 Topics
| |
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] … | |
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? | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 ?? | |
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 … | |
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 … | |
[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"); … | |
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); … | |
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 … | |
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!!!!! | |
[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 … | |
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 … | |
[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 … | |
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 * * … | |
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 … | |
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 … | |
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.... | |
What is the difference between String s="abc" and String s=new String("abc"); | |
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 … |
The End.