Thers a class called BigInt and it has a size and digit. size is the number of digits in the integer that is entered and digit is an array that holds the integer.
theres a method which is supposed to just add one to the BigInt so i figured that i could just add one to the last element of the...
I am learning about the ArrayList class in my java programming II class.
I am wondering why you would specify an arrayList to only contain, for example, strings:
ArrayList <String> arrayName = new ArrayList <String> ();
versus
ArrayList arrayName = new ArrayList ();
in which, to my...
Thers a class called BigInt and it has a size and digit. size is the number of digits in the integer that is entered and digit is an array that holds the integer.
Theres a method in the class called plus which is supposed to add two BigInts together. If there is a remainder the remainder is...
I would like to use Jabref to connect to internet from a windows xp computer.
However, I have to access interent through a proxy which requires authentication.
Although I can pass the ip address and port to java, I didn't find a way to
authenticate. Any ideas?
Thank's
DrDu
Were there oceanic plateau formation for before plate tectonics era? Perhaps later, plateau gave rise to terrenes along west coast of N. America. Might Mars serve as a model of what pre-tectonic era looked like on Earth? Are there plateau on Mars? If not, then this would seem consistent with...
So i haven't done java in about two years, its been a while since I've seen arrays. THe assignment is to fix a program that was given to me. I found one error but in the insertion sort part i can't get it to run the while loop. I can't make any fundamental changes to the program, basically i...
I am getting compilation errors in the following segment of my code:
_underlyingStorage was declared in the following way: private T[] _underlyingStorage = (T[]) new Object[128];
public T next() {
_currentIndex++;
if(_underlyingStorage[_currentIndex] ==...
For the following segment of code, I am getting a null pointer exception when trying to access any value in a list (doubly-linked with dummy nodes) AFTER a null value. For example, if I have the following list of integers:
0, 1, 2, 3, null, 4, 5
and I run the function list.contains(0) or...
i am using dummy nodes for a doubly linked list and trying to get an object at the specified index. for whatever reason, when i test it, i am getting data but it is backwards. for example, when i have a list of integers from 0 to 21, and i attempt to call get(2), i get 19 which is at index 2...
i am trying to remove an element from the back of the list (i.e. the node right before the tail). i am using a dummy head and tail node. the code compiles correctly, but when i try to test it, there is no execution. below is the segment of code that i am referring to:
public Object...
I am writing code for a doubly linked list, but when I try to compile it, I am getting an error when trying to throw the NoSuchElementException() function. Here is the part of the code concerning the issue:
// _size is an integer that keeps track of the number of elements. in this case, i am...
Hi there
I am currently trying to implement Newtons law of gravitation into a planetary model.
I have 2 objects with mass of 500 and 20. The distance between them is 150.
From what I gather from wikipedia I could use the following formula:
GravityField = G * ((500*20)/(150^2))
Where G...
Dunno if anyone have played a massive successful game called "Altitude", it's a multiplayer game, I have no idea what language it is coded, but I want to know is it possible to code a cheap mock up of the game with Java? And distribute it on Android?
"String" in java..
Homework Statement
its a bit conceptual question.
there is a string class which we use to store strings of letters.
1) but we don't create a reference to it,nor we instantiate it.
2) not even a method is invoked mean in printing, we just mention name of string class.
3)...
casting in java...&& wrapper class
Homework Statement
well my question is quite simple.
1..) when a vector is instantiated ,does it needs to have a particular data type like integer,employee... like in case of array or does any object can be put into it irrespective of its name...
example...
The error: "Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
at Buttons.<init>(Windows.java:12)
at Buttons.main(Windows.java:38)
Java Result: 1"
The Windows.java code:
_______________________________________
import...
I am a novice programmer and I need to create an Animation using Java. Basically, this animation needs to consist of moving ellipses on a graph. Does anyone have suggestions as to the easiest way to go about doing this? I've been looking into using java.awt and javax.swing to draw the graphics...
Homework Statement
"Write a recursive Java program that finds the longest increasing sequence in a two-dimensional grid of numbers. A sequence is simply a series of adjacent squares. Squares may not be used twice. A grid might have multiple longest sequences. If an input grid does have...
After learning the basics of Java, what should I be learning about to help me prepare for the rest of a Comp Sci degree?
I am running Mac OS X, so I was thinking of learning my way around the terminal/bash, or something else Unix-based. My ultimate goal is software engineering, so I know...
What is the difference between them? Which of them is used in building websites and which of them is used in designing application for mobile phones and other systems?
I'm suppose to type this in and get a certain error and I did:
http://i56.tinypic.com/2qdyebn.jpg
So the writer says I need to type in three arguments, and his sense of humor brings me to do this:
http://i51.tinypic.com/2i1z138.jpg
I click OK
Then when I click Run again I again get...
I bought a book for beginners and it said "On Windows Vista or Window XP, navigate through Start, Control Panel, System, Advanced (System Settings), Environment Variables. Select the System Variable named "Path" and then click the Edit button. Add the address of Java;'s bin sub directory at the...
I am attempting to write a program to do the work for me. I started in the process by hand and it took about an hour to get through the letter a. So I have a folder with many sub-folders and each sub-folder has at least one sub-sub-folder and then in theses many sub-sub-folders are the...
So I have multiple questions regarding these two programming languages.
1. Which is better to learn first?
2. I recently emailed a possible future university asking what languages they teach. In the email he said "Java rafter than C" Now does that mean mostly Java but C included? Or no C at...
1.Write a Java program that does the following:
a. Creates a Ball class with attributes for color, hardness, and size and instantiates the following Ball objects: golf, baseball, soccer.
b. Creates a display method which can print the current state of the attributes for all objects.
c...
Assignment:
Write a client and server, Java Swing application using socket connections that allows the client to specify a filename to the server in a Textfield and the server send the contents of the text file back to the client if it exists. If the file does not exist, then it should send...
I know this is probably a simple question but I want to make a program that uses an animation but don't know how to display an image like a jpeg in a program. I found a couple answers to this online but don't really know what's going on in the code. Would someone mind writing some sample code...
Homework Statement
Magic squares. An n × n matrix that is filled with the numbers 1, 2, 3, ..., n2 is a magic square if the sum of the elements in each row, in each column, and in the two diagonals is the same value.
Write a program that reads in n2 values from the keyboard and tests...
Homework Statement
Input a list of n integer values into a 1-D array and do the following:
• determine and output the number of positive values and the number of negative values
• update the array values as follow
• if the value is located at an even-numbered subscript, replace the value by...
I'm writing a script that changes the format of a datafile into a more suitable format for us to import it in Origin. The problem is that it only writes until line 2179, but it is supposed to write until it reaches 4096, where the datafile also ends.
public static void main(String[] args) {...
Create a class Product that stores product ID, product name, and price. Using the Comparable interface, create a compareTo() method for your Product class that gives you a default sort order based on product ID.
Create a test application that creates a list of Products, sorts them by product...
Hello there; I have a very short question about client class access:
Suppose in a supplier class an instance variable is declared private (and is used in the constructor), and a void method in the same class (declared public) changes this variable. In the client class, is calling this method...
Develop an application that reads a file of inventory information containing product ID and quantity. An example inventory file:
10401 32
10522 25
10401 1
10402 15
The file can contain several entries for the same Product ID. Your application should accumulate the quantities for...
Java problem ArrayList problem, **URGENT** hard question
Introduction:
You are part of a team working on a software system for a mobile phone company. The team is working on the development of the component that will be used for storing text messages. The initial design has a structure using...
You have been tasked to develop an application that reads customer information from a file to determine in which states you have customers.
The file contains records with customer first name, customer last name, street address, city, and state.
The file could contain many customers living...
Hi
I need to write a program in JAVA which simulates the solar system. I'll be using the Beeman's algorithm seen here: http://en.wikipedia.org/wiki/Beeman%27s_algorithm"
My question is that if I have the vectors for : velocity, acceleration and position how do I decompose them into there x...
Develop an application that reads city, state, and population from a text file.
Example input census file:
Jamestown FL 50000
Domville CO 10000
Jennyboro FL 30000
Lillyville CO 5000
If the population of the city is greater than or equal to 50,000, write the city information to a text...
Develop an application that reads city, state and population entered from the user and writes this information to a file. The application should continuously prompt for this population information until terminated by the user.
Example file:
Jamestown FL 50000
Domville CO 10000
Jennyboro FL...
JAVA Animated Logo **DUE TODAY** HELP!
My instructor has provided the code to use, we were told to simply modify the images for the program to work with our logo. The code comes straight from the textbook.
I have followed the steps of my instructor but when I run the program I get the...
Java Graphics & 2D Help me animate this!
Instructions :
Using Graphics and Graphics2D, create a neon sign for your business logo. Create your logo to include a shape and the name of your business. The logo should flash off and on continuously. You may get as creative as you wish with your...
We are asked to reverse a sentence , example: I am going. ==> .going am I
Attempt:
import java.util.Scanner;
public class Assign2
{
public static void main (String [] args)
{
String line= new StringBuffer().reverse().toString();
String line2 = new...
Ok, Here is the assignment:
Develop a mortgage payment calculator. Design a GUI to enter price of home, down payment, interest rate. Your bank only offers 10, 15, and 30 year mortgages. Use grouped radio buttons to select between 10, 15, or 30 year mortgage. Monthly payment should be...
I started taking a java course at my school and we are required to use macs. I looked for how to open other programs like text edit or the terminal but the code segments I found only worked for java. Is it possible to have a java program open other programs like text edit or the terminal on a...
Write a program that reads four-digit integer as a string , such as 1998 and then displays it, one digit per line, like so:
1
9
9
8
Attempt:
Scanner keyboard2 = new Scanner (System.in);
String integer2= "Input a 4 digit number:";
System.out.println(integer2);
How do I make it read...
/*
* Use Ticket as the superclass. WillCall, eDelivered, and Printed are subclasses Ticket.
* All tickets have event name, date, time, event location, and ticket cost.
* WillCall tickets have booth location attribute.
* eDelivered has an email address attribute.
* Printed has a mailing...
Assignment:
TicTacToe and TicTacToeGame.
The TicTacToe class contains a 3x3 two-dimensional array of integers. The constructor should initialize the empty board to all zeros. It should have a method playerMove that accepts two integers as parameters, the first is the player (1 or 2) and the...
Simple Array assignment, directions as follows:
(Must be implemented using a one-dimensional array.)
Write an application that inputs ten numbers from the user, each number can be between 10 and 100, inclusive. As each number is read in determine if it is a number already entered. If it is...
Java Help!
I have Duty for my Jave class, My teacher needs to disply city and time by Longitude. which I set up to GMT but I have trouble problem. code seems to me work fine, I can't figure out wht's problems. it will be nice to get from you help.
package worldclockdriver;
import...