Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~8K People Reached
Favorite Tags
java x 57
php x 3
Member Avatar for GeekTool

Hello, i am now trying to draw a tree with stars using for loop. I find a code for this but i did not get the logic of the code. Please can anybody explain it to me ? The code is below: public class DrawingTree { public static void main(String[]args) …

Member Avatar for GeekTool
0
2K
Member Avatar for GeekTool

I am trying to choose a string out of 4 strings randomly, and to show this string on the console. How can i do it ? For example, there is a question, if user answers it correctly, then the console will display one of the strings that i chose. I …

Member Avatar for GeekTool
0
202
Member Avatar for GeekTool

Hello, i want to write a program that will help an elementary school student to lean multiplication. For this, i use random object to produce two new positive one-digit integers. For this, i have coded this, but then got confused of the scope issue. Here is the code so far: …

Member Avatar for NormR1
0
155
Member Avatar for GeekTool
Member Avatar for GeekTool

In the book i use, a craps game is the project. Here is the code: import java.util.Random; public class Craps { private static final Random randomNumbers = new Random(); private enum Status { COUNTINUE, WIN, LOST }; private static final int SNAKE_EYES = 2; private static final int TREY = …

Member Avatar for ~s.o.s~
0
3K
Member Avatar for GeekTool
Member Avatar for GeekTool

public class ForLoop { public static void main(String[] args) { String writtenStuff = "Hello i am bucky bucky"; int otherNum = 0; int length = writtenStuff.length(); int i; for (i = 0; i < length; i++){ if (writtenStuff.charAt(i) == 'b') continue; } }//end method }//end class Here is my code, …

Member Avatar for GeekTool
0
106
Member Avatar for GeekTool

public static void main(String[] args) { String searchMe = "Look for a substring in me"; String substring = "sub"; boolean foundIt = false; int max = searchMe.length() - substring.length(); test: for (int i = 0; i <= max; i++) { int n = substring.length() int j = i; int k …

Member Avatar for deceptikon
0
489
Member Avatar for GeekTool

Ffirst of all, i have just achieved to code a program that counts the chosen letters. ( For example, i wanted it to count how many 'p's exist in the string. ) Now, for example i want to code a console application that extracts only the ones that are not …

Member Avatar for stultuske
0
237
Member Avatar for GeekTool

public class ForLoop { public static void main(String[] args){ String writtenStuff = "someone was here!" + "here i am!"; int numP = 0; int length = yazi.length(); for (int i = 0; i < length; i++){ if (yazi.charAt(i) != 's') continue; ++numP; }//for end System.out.println("the total number of the letters …

Member Avatar for GeekTool
0
124
Member Avatar for GeekTool

I use a book to learn Java ,and this book contains making a difference question in each end of the chapters. I finished chapter 5, which is all about if and switch statements and operands such as bitwise and logical and loops. Now, it asks me to create a quiz …

Member Avatar for stultuske
0
129
Member Avatar for GeekTool

In this code i did not understand something. In one class, a variable is declared as private, but then this value is used in another class. import java.awt.Graphics; import javax.swing.JPanel; public class DrawRect extends JPanel { private int choice; //user's choice of which shape to draw. public DrawRect (int userChoice){ …

Member Avatar for GeekTool
0
126
Member Avatar for GeekTool

> I have asked this question before, but i think i could not totally understand the diffefence between bitwise and logical operands. According to the book i am using to learn java, the bitwise operands can change the value and this is described as side effect. Also, in bitwise operands, …

Member Avatar for GeekTool
0
124
Member Avatar for GeekTool

Hello all you guys, First of all, i am done with Html and CSS as i said in the article title. Now i want to learn a language like PHP, Coldfusion, .Net etc. to make dynamic web sites. According to what i have heard from my friends, php is the …

Member Avatar for veedeoo
0
178
Member Avatar for GeekTool

>> I googled the dinference between bitwise and logical operators, but i could not understand exactl what it is. Can you simply explain ?

Member Avatar for NormR1
0
559
Member Avatar for GeekTool

import java.util.Scanner; public class SwitchStatement { private String courseName; private int total; private int gradeCounter; private int aCount; private int bCount; private int cCount; private int dCount; private int fCount; public SwitchStatement(String name){ courseName = name; } public String getCourseName(){ return courseName; } public void displayMessage(){ System.out.println("Welcome to the grade …

Member Avatar for wen_cai
0
230
Member Avatar for GeekTool

can anybody explain with details how to calculate the factor of a number ? i m trying to do this with while statement. how can i do this ? please...

Member Avatar for TrustyTony
0
136
Member Avatar for GeekTool

package newsatranc; import java.awt.BorderLayout; import java.awt.Color; import java.awt.ComponentOrientation; import java.awt.Cursor; import java.awt.GridLayout; import java.awt.event.InputEvent; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.util.Map; import java.util.TreeMap; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JToolBar; import java.awt.Dimension; public class NewSatranc extends JFrame { private static …

Member Avatar for NormR1
0
257
Member Avatar for GeekTool

double population = 7000000000; long population2 = 7000000000; > > I have to write down world population, so i used both double and long primitive types. However, both of them says that this number is out of range. What can i do with this? i made a google search but …

Member Avatar for sabbib
0
151
Member Avatar for GeekTool

import java.util.Scanner; public class Interest { public void determineInterest(){ Scanner input = new Scanner(System.in); double amount; double rate1 = 0.05; double rate2 = 0.06; double rate3 = 0.07; double rate4 = 0.08; double year; double principal = 1000; System.out.println("Please choose your bank below:\na)Ziraat Bankasi\nb)Halk Bankasi\nc)Is bankasi\nd)City Bank"); String bankname = …

Member Avatar for NormR1
0
258
Member Avatar for GeekTool

for (int year = 1; year <= 10; year++){ amount = principal * Math.pow(1+rate, year); principal = amount; System.out.printf("%d%20.2f\n",year,amount); for (int year = 1; year <= 10; year++){ amount = principal * Math.pow(1+rate, year); System.out.printf("%d%20.2f\n",year,amount); // what is the difference between these two?

Member Avatar for prnjn
0
129