32,204 Topics
| |
[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; … | |
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"; … | |
| 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 … |
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 | |
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 … | |
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 | |
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, … | |
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 { … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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(); … | |
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 … | |
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? | |
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 … | |
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. } | |
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: … | |
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 … | |
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 … | |
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? | |
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 … | |
[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); … | |
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 … | |
[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")) … | |
I just wanted to know what famous algorithms that you should have in hand? or be familiar with? or That is always used? | |
[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 … | |
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.. | |
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 … |
The End.