176 Posted Topics
Re: kiparsky, if you do the same arithmetic to both loops, you can reduce the work by this program has to do by 3/4. | |
Re: 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! | |
Re: 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. | |
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 … | |
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 … | |
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() … | |
Re: 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 | |
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; } … | |
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 => … | |
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 … | |
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 … | |
Re: 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 … | |
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 … | |
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: … | |
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 … | |
Re: you have name = CharSet.next() perhaps what you need is CharSet.nextInt() | |
Re: 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); } … | |
Re: 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!! | |
Re: 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 … | |
Re: 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 … | |
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 … | |
Re: 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 … | |
Re: 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 … | |
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, … | |
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); … | |
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; … |
The End.