176 Posted Topics

Member Avatar for rayden150

kiparsky, if you do the same arithmetic to both loops, you can reduce the work by this program has to do by 3/4.

Member Avatar for jon.kiparsky
0
317
Member Avatar for miney

write anything as an answer to your ii question. do your best, and I am sure someone will help you. it's a norm here to only help those that show effort. you haven't shown any. sorry bud!

Member Avatar for bibiki
0
214
Member Avatar for Neversleepin

line 29 of your code contains an assignment operator (=), while I believe you intended to have a comparison one (==) check whether that helps. plus, lines 12 and 13 contain brackets, they are either unnecessary or the bracket on line 13 should have been somewhere else.

Member Avatar for bibiki
0
1K
Member Avatar for bibiki

hey there, I have the following code: [CODE] import java.io.*; public class Karakters{ public static void main(String[] args) throws IOException{ FileWriter in = new FileWriter("karakters.txt"); PrintWriter outfile = new PrintWriter(in); char x = 'A'; for(int i = 0; i < 300; i++){ System.out.println((i + 1) + " " + (char)(x …

Member Avatar for bibiki
0
4K
Member Avatar for bibiki

I am working on this exercise: Write an application that asks its user to type a complete sentence on one line. The application then displays in the console window the words in the sentence, one word per line, less any punctuation. I have the following code: [CODE] import javax.swing.*; import …

Member Avatar for bibiki
0
148
Member Avatar for bibiki

I have the following code as taken from the book I read from: [CODE] import java.awt.*; import javax.swing.*; /** Frame1 is a frame with a label and a button */ public class Frame1 extends JFrame { /** Constructor Frame1 creates a frame with a label and button */ public Frame1() …

Member Avatar for kramerd
0
202
Member Avatar for Yutxz

it's all fine I suppose, you just need to give the method some parameters! you declared the variables in the header of your multadd method... whenever you write something like int x, or double some, you are declaring a parameter... hope this helps

Member Avatar for Yutxz
0
139
Member Avatar for bibiki

I have the following code: [CODE]import java.util.*; public class Final{ private double guess = 1; public Final(double x){ root(x); } public double root(double b){ double rez = -1; if(Math.abs(guess*guess - b) < 0.001){ rez = guess; } else{ guess = (2/guess + guess)/2; rez = root(b); } return rez; } …

Member Avatar for JamesCherrill
0
77
Member Avatar for bibiki

Can someone please explain why is the following code outputting some Chinese instead of breaking down the string passed in the function into an array. [CODE]<?php // define URL $url = "http://www.somewebsite.com:80/community/columns/trog/article.php?id=79&page=2"; // parse URL into associative array $data = parse_url($url); // print URL components foreach ($data as $k => …

Member Avatar for FlashCreations
0
106
Member Avatar for bibiki

hey there, I have two pieces of code that I expected would behave the same. However, what I noticed is that one of them works fine, the other does not at all. I need help from someone experienced to explain what's going on under the hood. the code that does …

Member Avatar for NormR1
0
138
Member Avatar for bibiki

hey there, I have the following code: [CODE] String[][] candidates = new String[4][3]; for(int i = 0; i!=4; i++){ for(int j = 0; j!=3; j++){ switch (j){ case 0: {candidates[i][j] = JOptionPane.showInputDialog("Give name of candidate " + i);} case 1: {candidates[i][j] = JOptionPane.showInputDialog("Give address of candidate " + i);} case …

Member Avatar for bibiki
0
102
Member Avatar for mobay

I see the post is old already but I am sure info remains relevant so I wanted to add something: I absolutely agree with Smartx21 regarding MALWAREBYTES. I used it and it worked excelently - one can get it for free online. In addition, I used CCleaner. After having used …

Member Avatar for bibiki
0
183
Member Avatar for bibiki

what's up? I have the following php code: [CODE]<?php //chose the file $file = 'C:\Program Files\EasyPHP-5.3.2i\www\test\dump.txt'; //open the file in writeable mode $data = fopen($file, 'w'); //add the new element to it fwrite($data, $data.'gagi'); //close the file fclose($data); ?>[/CODE] I expect it to keep whatever is in the file and …

Member Avatar for bibiki
0
58
Member Avatar for bibiki

hey there. I have been struggling with separating classes in java and figuring out what methods go in what classes. when i build my apps in one file, i do them right, but when i try to separate classes, i mess up. like for example: I have these two classes: …

Member Avatar for quuba
0
198
Member Avatar for bibiki

hey there, I am trying to install ubuntu 9.10 in my pc. as instructed, I burned the iso file I took from ubuntu site into a cd and restarted my computer. after that, I was promted for the language I want to use. I chose english, then when offered four …

Member Avatar for AreopaQ
0
212
Member Avatar for HelloMe

you have name = CharSet.next() perhaps what you need is CharSet.nextInt()

Member Avatar for HelloMe
0
115
Member Avatar for Aisha25

you can do that without a loop. there is a formula I dont remember. however, here you have the code with the loop. [CODE]public class Interest{ public static void main(String[] args){ double x = 0; for(int i = 1; i<4; i++){ x = (x +100) * 1.00417; } System.out.println(x); } …

Member Avatar for kvass
-1
816
Member Avatar for jino

try this: string convert_uuencode ( the coded version of your pic/text ) I took from php.net manual. I hope that to be of any help! update: my bed!!

Member Avatar for jino
0
184
Member Avatar for jtodd

use this for generating a random integer between 104 qand 108: [CODE]x = (int)(Math.random()*4) + 104;[/CODE] explanation: the Math.randon() generates a number between 0 and one (including 0 excluding 1). when you multiply the rezult by four, you get any number between zero (inclusive) and four (exclusive). Add to that …

Member Avatar for jtodd
0
128
Member Avatar for Vikijo

one thing you might want to consider is that when you built up the list of weather options from which to chose, you created two separate input lists. as a result, one may select both, bad and good wether. in that case, the isset($_GET['good'] would return true even if both …

Member Avatar for bibiki
0
135
Member Avatar for bibiki

hey there. first off, i hope i posted my question in the right forum. second, i thank you in advance for an answer. i have two short batch files: 1. shutdown - s - c "my message" - t 20 i expect this to shut down my computer in twenty …

Member Avatar for gerbil
0
162
Member Avatar for Aisha25

I have the code that works: [CODE]//I took out your first line as it seems unnecessary. plus, it did not work with the line in the code //package windchilltemperature; import java.util.Scanner; public class WindChillTemp { public static void main(String[] args) { double OutsideTemperature = -58; //here, in the following two …

Member Avatar for BestJewSinceJC
0
991
Member Avatar for lindanilou

I am new to this forum, and out of desire to contribute, I want to let you know that the best way to ask help is providing some code you have written. otherwise, you won't get other people do it for you. I wrote the code for two people and …

Member Avatar for bibiki
0
86
Member Avatar for bibiki

hey there, I have the following code: [CODE]import java.awt.*; import javax.swing.*; public class TabelaEShahut extends JPanel{ public static void main(String[] args){ new TabelaEShahut(); } public TabelaEShahut(){ JFrame f = new JFrame(); f.setSize(500, 500); f.setVisible(true); f.setTitle("shah"); f.getContentPane().add(this); } public void paintComponent(Graphics g){ g.setColor(Color.white); g.fillRect(0, 0, 700, 700); g.setColor(Color.red); g.fillRect(50, 50, 400, …

Member Avatar for bibiki
0
347
Member Avatar for bibiki

Hey there, I have the following code: [CODE]public void paintComponent(Graphics d){ int gjeresia_e_kornizes = 800; int lartesia_e_kornizes = 800; d.setColor(Color.white); d.fillRect(0, 0, gjeresia_e_kornizes, lartesia_e_kornizes); d.setColor(Color.red); d.fillOval(105, 70, 250, 350); try { Thread.sleep(2000); } catch (InterruptedException e) { } d.setColor(Color.blue); d.fillOval(150, 170, 50, 20); d.fillOval(270, 170, 50, 20); try { Thread.sleep(2000); …

Member Avatar for bibiki
0
275
Member Avatar for bibiki

hey there. I am new to php and just out of curiosity I am trying to build an html table using nested while loops. I expect the following code to produce a table, but it is not doing so. [CODE]<html> <table border="1"> <?php $r=1; $rows = 5; $c = 1; …

Member Avatar for bibiki
0
800

The End.