Alright, this is a sort of dual-purpose question. The main thing I hope to take away from this is more knowledge of multithreading. I am a complete newbie when it comes to multithreading, and this is my first actual attempt to do anything in multiple threads. The other thing I hope to take away is some help with a piece of homework that ...
Hey guys , thanx for the previus help.....
This time it's homework meaning they want me to make a highscore that shows playername,score (tries it took) and time.
Basically it wants:
To write a game in which a user is to guess a random number between 1 and 1000. The program should read a number from the keyboard, and print whether the gu...
while (n >= 1)
n /= 2;
I am unable to get the Big-O notation for this
...
Ok so I have a function named resize, which takes a source array, and resizes to new widths and height. The method I'm using, I think, is inefficient. I heard there's a better way to do it. Anyway, the code below works when scale is an int. However, there's a second function called half, where it uses resize to shrink an image in half. S...
The original code i wrote uses these arguments:
int m = size of sorted list 1
int n = size of sorted list 2
int A[] = sorted list 1
int B[] = sorted list 2
int C[] = merged list of 1 and 2
I was asked to add this code to an existing file that uses these different arguments:
IntVectorIt start1
IntVectorIt end1
IntVectorIt start2
...
Example 1
/**
*Program Name: Cis36L0411.java
*Discussion: Class -- Data Members ONLY
* Method Members ONLY
*/
class Cis36L0411
{
public static void main( String[] args )
{
DataOnly data1 = new DataOnly();
System.out.println( "DataOnly\tLIMIT\t\t" + data1.LIMIT );
System.out.print...
Lets say you have an array of size 1,000,000 with randomly generated elements and you want to use quicksort to sort the array. In order to speed up quicksort, it would make sense to stop recursing when the array gets small enough, and use insertion sort instead. In such an implementation, the base case for Quicksort is some value base > ...
i need to write a eclipse java program that asks a user to input a word and then reads the word and then displays if the word contains any capitial letters.
...
Please explain to me the recursion process step by step using F7.
I just can't correlate the return with flow of control.
#include<stdio.h>
#include<conio.h>
void t_of_h(char, char, char, int);
void main()
{
int n;
clrscr();
printf("Enter no of DISC in Tower of Hanoi : ");
scanf("%d",&n);
printf("\nTower of Hano...
Currently I am studying Standard Template Library (STL).
In this program I am storing some long values in Associative Container and then sorting them according to unit's place (according to the number in unit's place).
Code :
#include <iostream>
#include <set>
#include <functional>
using namespace std;
class UnitLess
{
public:
...
I have this homework which required to print asterick to make draw a triangle.
When drawTriangle(0);
*
When drawTriangle(1);
*
**
When drawTriangle(2);
*
**
* *
****
when drawTriangle(3);
*
**
* *
****
* *
** **
* * * *
********
when drawTriangle(4);
*
**...
Possible Duplicate:
Which is the first integer that an IEEE 754 float is incapable of representing exactly?
Firstly, this IS a homework question, just to clear this up immediately. I'm not looking for a spoon fed solution of course, just maybe a little pointer to the right direction.
So, my task is to find the smallest positi...
I am trying to read a text file in java, basically a set of questions. With 4 choices and 1 answer. The structure looks like this:
question
option a
option b
option c
option d
answer
I have no trouble reading it that way:
public class rar{
public static String[] q=new String[50];
public static String[] a=n...
IF F6 base hex is a signed 8-bit integer, how much does it represent in decimal?
...
Hi,
I need to represent these mathematical equations in code and to solve them:
2x = 3y
3y = 4z
2x + 3y + 4z = 1
Please advise.
Thanks,
Oz
...
This is the assignment:
Write a program that determines the number of spaces in an input line. Read in the line into a string. Next use the charAt( ) method in a loop to access the characters one by one.
The code I have thus far:
import javax.swing.*;
import java.lang.Character;
public class Assignme...
For a hw assignment, I need to setup a JTable in Swing, and populate the table's contents via a custom model class that extends the AbstractTableModel. My questions regarding this overly complicated process are many fold, but I'll try and keep it simple.
My first step is to get data into the model right? When I was using a JList (I coul...
Hi all, I was just studying up on my Java in preparation for an exam and I ran into a sort of problem with uninitialized int/Integer values.
class A
{
int x;
Integer y;
static int z;
static Integer z2;
public A(){}
}
Lets say I initialize an object of Class A. A a = new A();
I've tried th...
I got this question as an assignment:
Packages/Naming
We have created lot of packages and defined classes and interfaces in them. We have also discussed the point we have to remember while naming them. In this assignment we will see how important naming is.
Please change the package names in your previous assignment such th...
I wrote a switch statement that I have to put with another but I'm not sure how to. This is the one I'm trying to put with the other switch statement.
import java.util.Scanner;
public class Main
public static void main(String[] args) {
String input;
char name;
Scanner keyboard = new Scanner(System.in);
...