Hey guy, I was just thinking about making a simple Java text-based game. You know, the ones where you do everything in the command prompt or terminal and no GUI involved. I want to make something that a person can make and "account" where the pass and username are both saved in a text file since...
How to display days in order for my clock :
Thursday, 12:00 pm
Thursday, 2:30 pm
Friday, 12:15 am
Friday, 12:15 am
Thursday, 2:30 pm
Saturday, 2:30 pm
I don't know how to do that. Con some pody help me out?
I have problem in this code ,I couldn't figure out method to display days...
I'm trying to program a java simulation of some particles in a box. Anyways I want to initialize the particles with random velocities such that on average they're distributed around some velocity.
To do this I was thinking about using the nextGaussian() method.
Anyways I was initializing...
I need to write a program utilizing LU decomposition of a matrix in Java without using any linear algebra libraries so I was wondering if anyone can give me some pseudo-code or a link or something. I know you're supposed to post your attempt, but I literally have no idea what I'm doing. This is...
Homework Statement
So, I'm writing a class that builds a maze using disjoints sets, and need to find the edges shared by the cells in the grid.
Find the edges, not including boundaries, of an h by w grid of squares.
For example a 2x2 grid
+--+--+
| 0 |1 |
+--+--+
| 2 |3 |
+--+--+
has...
hello all, I was given an assignment on arrays, here is the task:
Write a program that inputs an array of 10 integers from the user, and removes the duplicate array elements. You may assume that all the integers are between 0 and 100, and you may input them from the user however you wish. The...
I want to add all odd numbers in a number n(ie if n=123456, then i am lookin' for 1+3+5=8)
I have written a small program and it won't work i don't know why!How do i solve my prob?
public class Odd
{
public static void main(String[] args)
{
int n = 3; // just set n to any number...
Hello.
I have this JAVA code, I have to change only class "LS", so that program gets sum and displays it. But I don't know how to get command line arguments to LS class (I need them in "??", to get sum). Can anyone help? :)
public class S
{
public static void main(String[] args)...
I am currently taking a computer science II class in high school, in which we use java, and my teacher does not really know how to go about teaching and when she tries to help usually makes things worse. Does anyone know of any sites to help teach/reinforce the java language?
Title kind of explains what I'm trying to do here. I know exactly how radix sort is SUPPOSED to work but I just don't have a clue how to go about coding it.
Basically what I am asking for is some java based pseudo-code just to get me in the right direction.
I'm specifically sorting an...
I have an array of doubles that is too large (i.e. it is of length 10, but only indices 0 to 6 are filled).
I want to trim it, and am having problems with the line
for loop{
if(array[i] == null{//THIS LINE
action
}
}
It says that "the argument type == is undefined for types double...
I have been given the task to write a program that does some basic math and numerical integration on numbers. Those numbers are stored in a .xls file. I have looked online and have seen the Apache POI and whatnot, but I have some serious problems stemming from my total lack of knowledge:
How...
Ok, so I have been asking a lot of java related questions this past week or so. Now, I have yet another one.
My program takes a bunch of input in the form of arrays of doubles, and prints it out to a comma separated csv file for use in a spreadsheet. However, when I try to open the file, I...
I have a string of the form "int,int,int,int" and I want to extract each of those ints into a variable that is an int. I have no idea where to even start (I am learning Java as I make a program for an internship, and my searching has yielded nothing).
Thanks,
Nkk
In school I'm in a class AP Computer Science where we learn java. In the past few weeks I have learned the basics of java which came very easy to me. Now I want to know what can I do to my programs to make them stand out? What should I strive for, least amount of lines or looks the best(we...
I have a java program in Eclipse, and was wondering how to make it such that i can take a file or two onto another computer and run the program without the Eclipse GUI (i.e. as you would run/install a normal program). I am hopelessly lost from googling, as I understand nothing.
What is the...
I have a rather large list of classes that are have created and rather than compiling the classes that are needed with the main code I would rather use import. The problem is I do not know how to make that reference.
My end goal is to have a package called someClass and a file named...
Hey there,
For an Electrical Engineering candidate, will you suggest to learn C++. I am currently know Java and i am thinking about learning C++ by taking an elective course in my university. What do you think? Is it worth to take that course also can C++ help me in my career as an electrical...
im starting a project from an Ebook that seems to be missing a line or two or something. Can someone suggest what should be here? I added the ending parsing since it was one of the more obvious missing things.
import com.sun.j3d.loaders.*;
import...
Java help ! (how to not to use if statement)
My teacher asked the user for an integer and converted it into a number in base N, where N was a value between 2 and 9, inclusive. Expand this program to allow values of N between 2 and 36, inclusive, where digits representing the numbers 10, 11...
Hi, I'm trying to get it so that when the program initiates, if the random number is greater than 3, I turn left. here is what I have in summary;
int rt=3;
Random ra = new Random();
for (int c = 6; c <12; ++c);
{
}
if(rt<ra)
{...
So, I'm new with the JAVA, and I am trying to import the properties of one file, into another. it looks like this-
the executible file will connect to a subclass file (called subclass1), but subclass1 is a subclass to another class file (parentclass)
the parent class will give details...
I've been doing homework all day. I can't seem to figure out how to fix this. I dunno...maybe I'm depressed.
So, in my attempt to build a simple shooter (kinda like pong, only you shoot at each other), It seems all my problems root from this error;
Shooter.java:9: Shooter is not abstract and...
Hi
I wanted to make a program that would check if a number if it was an integer or not in Java. here's the source code:
import static java.lang.Math.*;
public class gcd {
public static void main(String [] args) {
double a = 1;
double b =1;
double c = 1...
Hello!
I installed java developers' kit today, but in c:\program files by mistake. I wanted to change it to c:\, so initially I just cut-pasted it. It didn't work, so I uninstalled it (add or remove programs in control panel). However, when I tried to delete the "java" folder in c:\, it said...
Can you please suggest some good books a learning Java and electronics?
I have learned C++ and I plan to learn Java now.
I also want to begin learning electronics by myself.
Thank you
Elixer
I just took my final for Data Structures and there was a question on it dealing with linked lists. A part of the question really threw me off. It looked something like this:
public class Node
{
int contents;
Node next;
}
public class LinkedList
{
Node head, tail...
For my final project I need to code a program to handle a bookstore. Because the Java console isn't meant for stuff like this I decided to make my own UI.
The inventory, reports, and cashier section each get their own tab.
Each tab has a console output screen, a box showing what you just...
1.Homework Statement + Homework Equations
Hello,
I really need your help, because I'm a Java newbie and I've got stuck in this Java homework.
I should implement class ObjectCounter, which has to include two methods:
// increase the counter for given object
public void add(Object o)
//...
I have an assignment where we have to use loops to print quarter diamond patterns.
I don't really need help with the actual coding, since the prof basically gave us a pseudo-code as a hint, but in the pseudo-code there is a variable for the number of rows and columns.
I have been searching...
I'm taking a class on Java programming. I'd like to install Java on my home PC. According to our class' website I am supposed to
But there is no download link on this page. There is a message on that page that says
I don't want to learn more. I just simply want to install Java. If this...
Homework Statement
So, I'm creating a 2d graphical simulation of orbiting bodies.
Right now I'm just working with 2 bodies, one stationary, but I would hope to extend this program to be able to include any number of moving bodies and have them interact accordingly.
After combing...
I have just created a Java native wrapper for my fast Walsh Hadamard transform and O'Connor Transform code. I am getting 2000 65536-point WHT's per second and 540 65536-point OCT's per second. That is about as fast as you will get without resorting to Nvidia CUDA or whatever.
The code is...
Dear Computer People,
I know nothing about Java. What I understand what "Java script" means is something that one can paste into an html document or web page. What I have is a Java script code that displays a day count since 1922 December 18. Here it is.
<script>
var montharray=new...
Homework Statement
First of all this isn't for homework. I am trying to create a Java program that will test me on the German language for my German class; however, I do not know how to get the umlauts, accents, and other special characters to show up. Do I need to import a language handler...
public boolean search (String lastNameSearch) {
LinkedListNode<T> current;
current = first;
boolean found = false;
ExtPerson person = (ExtPerson) first.info;
while (current.link != null) {
if ((person.lastName.toLowerCase().equals(lastNameSearch.toLowerCase()))) {...
So my algorithm compares a node that needs to be inserted with the current linked list set. it goes from first (which contains the lowest integer) and moves forward until it hits null or when the key trying to be inserted is no longer greater than the nodes being compared to.
My input of 23...
I am having some trouble with the Java Scanner to read input from the keyboard.
I am trying to keep my input cleaned up and secure, so I am checking for the right type and value, and clearing the input buffer if it isn't. I also restart the prompt loop if it isn't right, so they can try again...
What is Instance, Empty Constructor ... in Java
How come will return false I put in 2 same name it should return true ?
Teacher p1= new Teacher("Nelson");
System.out.println(p1);
Teacher p2= new Teacher("Nelson");
System.out.println(p2);
System.out.println(p1.equals(p2));
it...
Java Program Helpers Come in Please !
Homework Statement
I am writting a program which asks the user to enter his email adress, and then prints - according to five conditions - if his address is valid or not .
1. there should be exactly one @ in the address he enters.
2. there should...
Hi guys,
I'm trying to figure out a way to split up integers so I can do addition the old school way in Java.
E.g.:
1234
1234
+_____
2468
So you know start at the 4's and then add them up and move left etc.
Does anyone have any ideas on how I access the different digits of...
I'm attempting to write a relatively simple method. It needs to search through a String for any characters that are not specifically 'A', 'I', 'O', and 'C', returning false if it runs across any other characters besides those four. The string I'm processing could be hundreds/thousands of...
Hi
I'm selecting courses for University right now. I have two options for my computer programming course. I can selected either two programming classes (one fall, one winter) that is designed for beginners with no prior programming experience or I can selected just one class (which is an...
Hi all!
This may have been previously posted before but check it out! Just discovered this today. It's really cool. Great for getting an intuitive feel for what is happening in circuits. Try hovering over the components to get simulation info of each component...
Homework Statement
The question is thus:
e = even digit
o = odd digit
eo
x ee
-----
eoe
+eoe
-----
oooe
Which is just the expanded multiplication of the numbers eo and ee, with eoe and eoe being the partial products and oooe being the product. The question is to find...
Hey guys, so the second half of my first year comp sci course is winding down, and the exam is fast approaching. The problem is that our "text" for Comp Sci 102 (second half of first year comp sci) is a collection of notes by one of the professors in the department. After comparing his section...
Can some one help please, i am trying to reinstall Java after a problem, i have removed all the old program from add/remove center and used system mechanic to check registry etc,
but when i try to download java it gives me error 25099, i have tried the off line version but that is the same, i...