32,204 Topics

Member Avatar for
Member Avatar for KunioUnio

[CODE]package lottery; import java.util.*; import java.util.ArrayList; public class Lottery { public static final int REGULAR_NUMBERS = 7; public static final int EXTRA_NUMBERS = 3; public static final int MAX_NUMBER = 39; public static final int TOTAL_PRIZE = 50; public static double winning; public static double cost; public static int round; …

Member Avatar for stultuske
0
265
Member Avatar for TigerTeck

Grade2 Class.... [CODE]public class Grade2 { public Grade2(double input) { Grade = input; } public String getLetterGrade() { if(Grade==(4.0)) message="A+"; else if(Grade>=(3.85)&&Grade<=(3.99)) message="A"; else if(Grade>=(3.7)&&Grade<=(3.8499999)) message="A-"; else if(Grade>=(3.01)&&Grade<=(3.3)) message="B+"; else if(Grade>=(2.85)&&Grade<=(3.00)) message="B"; else if(Grade>=(2.7)&&Grade<=(2.8499)) message="B-"; else if(Grade>=(2.01)&&Grade<=(2.3)) message="C+"; else if(Grade>=(1.85)&&Grade<=(2.00)) message="C"; else if(Grade>=(1.7)&&Grade<=(1.849999)) message="C-"; else if(Grade>=(1.01)&&Grade<=(1.3)) message="D+"; else if(Grade>=(0.85)&&Grade<=(1.00)) message="D"; …

Member Avatar for TigerTeck
0
142
Member Avatar for mehnihma

I have a problem with case sensitive input my options are s and b and how to make a program when I input capital B or S to continue? [CODE] // options for selling and buying stocks System.out.println("\n"); System.out.println("Options as single upper or lower case character : "); System.out.println("\tB to …

Member Avatar for mehnihma
0
150
Member Avatar for StephNicolaou

Hey guys, I've seen very limited examples out there about this unsupported function, however I am sure there must be a quick method to get this done with the Affine Transform ? Any ideas appreciated. Cleo

Member Avatar for mKorbel
1
4K
Member Avatar for danthevan

Well I was an old vb.net programmer,but not very professional and so with Java. I know the basics stuff how to think and how/why to write variables, methods, functions, threads, networking using streams or packets, and even I can write a database program which retreive records and insert records in …

Member Avatar for JamesCherrill
0
203
Member Avatar for sk8ergirl

how can I find mode in java using arrays, if statement or for loop I have another question I want to ask the user to input number and then draw triangle like this [url]http://www.thebestdata.com/FileArchieve/2434_File1_1.PNG[/url] how can I do this

Member Avatar for sk8ergirl
0
339
Member Avatar for musikluver4

I have been doing java for almost 3 years now, am just starting to learn Objective-C as of this past June. Been writing a few programs on my own and writing programs for the exercises in 2 very cool Cocoa/objective-c books. My question is how do I, coming from Java, …

Member Avatar for anilkumar-m
0
266
Member Avatar for siddiqui_1985

hi everyone, as title said all, i need actually to find a vowel(a,e,i,o,u) in a string. it counts how many vowels are in the string that's fine but i need to find a vowel too.. any idea how to achieve this ? [code]import java.io.*; import java.lang.*; public class VowelsExample { …

Member Avatar for stultuske
0
714
Member Avatar for mike2828

my program works fine but i dont know why when i debug the program the shapes are coming out without me pressing the buttons [CODE]import java.applet.*; import java.awt.*; import java.awt.event.*; public class AnAppletWithButtons extends Applet implements ActionListener { Button button1, button2; int r, g , b; Color color; boolean drawLine …

Member Avatar for mKorbel
0
145
Member Avatar for ckwolfe

Hello I have a simple issue that is not a compilation or runtime issue, but an aesthetic problem that I can't find a function for. Basically I've created a GUI window that visually represents a game board for my Reversi gameboard. I've implemented the GUI and the Reversi gameplay and …

Member Avatar for mKorbel
0
6K
Member Avatar for greatcornholio

Hi all, Im new to java, and im working with j lists importing data from sql server. Thing is that i can import the data from the sql tables, but for some reason it does not refresh properly. Thing is that when the frame is opened the list is filled …

Member Avatar for mKorbel
0
239
Member Avatar for StephNicolaou

Hey guys, I've drawn a grid, and I have a label contatining a picture. Whenever I change the location of this label, the grid dissapears until I resize/move the frame. Any suggestions on best method to buffer these grid lines? They aren't going to be moving graphics or anything like …

Member Avatar for StephNicolaou
0
152
Member Avatar for Lendaanx

Need help getting my add, save, search, modify, delete buttons to work I can get them to show up in the GUI but pressing them does nothing. I need the save button to save file to index.dat in folder c:\\data\ folder and create that folder if it doesn't exist [CODE]import …

Member Avatar for JamesCherrill
0
155
Member Avatar for amture101

hey guys, I'm making a small app that make a Jable and saves the table model then loads the table model and set it to the table interface and both saving and loading is in seperate frames. [CODE] // Saving the info String ufname = Fname.getText(); String ulname = Lname.getText(); …

Member Avatar for amture101
0
128
Member Avatar for subone

Hi I have this problem where I tell the user to prompt 10 integers separated with spaces. And then I have to output the same numbers the user entered and then output max and min numbers. So How can I get the maximum value of these multiple integers? This is …

Member Avatar for JeffGrigg
0
258
Member Avatar for kelvin924

The user input four integer numbers in same line,for example,4857 After the input, I would like to place the four numbers into array The result ,array[i] = j i is the position , j is number of input. how to do it? must require to use substring? any other solutions?

Member Avatar for hiddepolen
0
95
Member Avatar for overrated

I need help with incrementing my score. I tried ++wins..., wins++..., wins += 1..., wins = wins + 1... and so far nothing works. I just keep getting 0. My main class: import java.util.Scanner; public class Test { public static void main (String [] args) { Rock game = new …

Member Avatar for JamesCherrill
0
119
Member Avatar for pikalife

What should I write within a while loop that allows me to keep on divding a number by 2 until it meets certain conditions. for example while(condition) { //what should i write here to have a double that divides by 2 until it meets the condition. }

Member Avatar for JamesCherrill
0
159
Member Avatar for StephNicolaou

Hey guys, I've constructed the main class to refer to a variable in it and I receive a stack overflow error. Any suggestions on the causes of this error, I've used this method previously and have not got this before. [code] In other class: MainClass class = new MainClass(); errors: …

Member Avatar for JamesCherrill
0
204
Member Avatar for lele07060

I tried to compile the program and I got these two errors and I do not know what they mean. (Lab4 is the name of my program by the way) Lab4.java:22: incompatible types found : java.lang.String required: double double fedwithHolding = "FedTax * GrossPay"; Lab4.java:26: incompatible types found : java.lang.String …

Member Avatar for hiddepolen
0
147
Member Avatar for cecsFTL

In this project I'm suppose to use a old project and create a menu for it. Basically "Create a menu system so that the user may choose between the various Roach functions (create roach colonies, breed and spray roaches and get the current number of roaches). Make sure you display …

Member Avatar for cecsFTL
0
383
Member Avatar for plasticfood

my program includes pictures and audio, do i have add that to my project and then create a jar file? or i just have to include the source file and that's it?

Member Avatar for plasticfood
0
176
Member Avatar for ttamilvanan81

Hai i have using the checkbox in for loop. I need the urgent help from anyone, for example in the loop there is having 5 checkbox if i checked 3 of the ckeckboxes and 2 of the checkboxes are unchecked. I need to get the values for checked checkboxes and …

Member Avatar for stultuske
0
537
Member Avatar for hannah shrn j

[code]class node { public int data; public node LC,RC; public int shortest; } class minleftist { node root = null; public void insert() { int newelt=0; try { System.out.println("Enter the element:"); DataInputStream din=new DataInputStream(System.in); newelt=Integer.parseInt(din.readLine()); } catch(Exception e){} node temp = new node(); temp.data=newelt; temp.LC=temp.RC=null; temp.shortest=1; if(root==null) root=temp; else root=melt(root,temp); …

Member Avatar for JeffGrigg
-1
258
Member Avatar for StephNicolaou

Hey guys, I'm drawing a grid using the nested for loop with draw line method. Any tips on getting this in the center of my screen? I am currently using the getWidth and getHeight methods of my center panel but it is still drawing in the top left corner. It's …

Member Avatar for StephNicolaou
0
241
Member Avatar for TigerTeck

[CODE]public class Card { public Card(String cardValue) { input = cardValue; } public String getDescription() { if (input.length() == 2) { if(input.substring(0,1).equals("A")) first = "Ace of "; else if(input.substring(0,1).equals("2")) first = "Two of "; else if(input.substring(0,1).equals("3")) first = "Three of "; else if(input.substring(0,1).equals("4")) first = "Four of "; else if(input.substring(0,1).equals("5")) …

Member Avatar for TigerTeck
0
308
Member Avatar for chiiqui

I just wanted to know what famous algorithms that you should have in hand? or be familiar with? or That is always used?

Member Avatar for JeffGrigg
0
234
Member Avatar for rotten69

[CODE]public static void main(String [] args){ ArrayList<String> list1 = new ArrayList<String>(); list1.add("ABC"); list1.add("123"); ArrayList<String> list2 = method(list1); list2.add("ABC"); list1.add("123"); System.out.println(list1); System.out.println(list2); } private static ArrayList<String> method(ArrayList<String> list) { ArrayList<String> result = list; result.remove("123"); return result; }[/CODE] Could anyone explain this code to me? why it gives me the same result …

Member Avatar for JamesCherrill
0
190
Member Avatar for vidhya33

Hi.. I need a java program to find out the bandwidth in LAN.. Please help me in solving out this problem soon... Thanks in advance..

Member Avatar for JamesCherrill
0
97
Member Avatar for Stjerne

Hello guys, Sorry for the title, it should be Renting bicycle program XD Can't edit XD I've got a task from my school. I've to create a new computer system for Oslo City bikes. The Oslo City Cycle bike racks at various locations around Oslo where people with valid bike …

Member Avatar for Stjerne
0
826

The End.