homework

MouseMotion Sensor Method Call

I have encountered a problem, for which no matter how long I study the API's of the class and superclasses, I can not figure out. Suppose I wish to design a sort of a game where the mouse motion controls the motion of a block that is used to bounce a ball, which then destroys multi colored bricks. How do you specifically make the block...

How to get the actual address of a pointer in C?

BACKGROUND: I'm writing a single level cache simulator in C for a homework assignment, and I've been given code that I must work from. In our discussions of the cache, we were told that the way a small cache can hold large addresses is by splitting the large address into the position in the cache and an identifying tag. That is, if you h...

Unresolved external symbol error in c++

I am trying to do a simple hw problem involving namespace, static data members and functions. I am getting an unresolved external symbol error Error 1 error LNK2001: unresolved external symbol "private: static double JWong::SavingsAccount::annualInterestRate" (?annualInterestRate@SavingsAccount@JWong@@0NA) SavingsAccount.obj S...

using a JOIN in an UPDATE in SQL

Hi, I'm having trouble formulating a legal statement to double the statuses of the suppliers (s) who have shipped (sp) more than 500 units. I've been trying: update s set s.status = s.status * 2 from s join sp on (sp.sno = s.sno) group by sno having sum(qty) > 500; however I'm getting this error from Mysql: ERROR 1064 (4200...

Intel IA-32 Assembly

I'm having a bit of difficulty converting the following java code into Intel IA-32 Assembly: class Person() { char name [8]; int age; void printName() {...} static void printAdults(Person [] list) { for(int k = 0; k < 100; k++){ if (list[k].age >= 18) { list[k].printName(); } } } } My ...

RMI-applets - Cannot understand error message

In a simple RMI game I'm writing (an assignment in uni), I reveice: java.rmi.MarshalException: error marshalling arguments; nested exception is: java.net.SocketException: Broken pipe at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:138) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Remot...

Use method not defined in Interface [Java]

Hello World, I have an assignment and i got a library including an interface class. [InfoItem] I implement this class [Item]. Now i am required to write a method watchProgram(InfoItem item) [other class, importing InfoItem], which (as shown) requires an InfoItem. The passed parameter item has a variable 'Recorded' [boolean] which i w...

PHP - How to add stuff from a database into a newsletter?

Hey guys. I need help for a project for school. Essentially, I need to write a program that sends newsletters. I can send the newsletters and stuff, but the main issue I'm having is that the newsletter needs to contain things that are contained in a database. How exactly do I draw those things and put them into a newsletter? The bulk of ...

Algorithm to create a x-ray image from a volume

What is the algorithm to create a x-ray image using ray-tracing from a 3-d volume? ...

error C2059: syntax error : ']', i cant figure out why this coming up in c++

void display_totals(); int exam1[100][3];// array that can hold 100 numbers for 1st column int exam2[100][3];// array that can hold 100 numbers for 2nd column int exam3[100][3];// array that can hold 100 numbers for 3rd column int main() { int go,go2,go3; go=read_file_in_array; go2= calculate_total(exam1[],exam2[],exam3[]); ...

c language:make fgets to keep taking input until I press enter twice?

hi I would like to ask how I would modify this code for the question: (It only accepts one input then prints it out. I want it to keep going until I hit enter (\n) twice. #include <stdio.h> #define MAXLENGTH 1000 int main(void) { char string[MAXLENGTH]; fgets(string, MAXLENGTH, stdin ); printf("%s\n", string); return ...

Finding a pattern within a string variable in C#

Ok i'm working on a project for a 200 level C# course, we are required to create a heads or tails project. Basically the project is setup so that the computer will guess randomly up to 5 times, but on the sixth time it will look into the playersGuessHistory variable setup as a string to see if it can find a match for a pattern of 4 entir...

What is procedure to calculate physical memory address?

How can we calculate the physical memory address generated by the following segment: offset pairs (both are hexadecimal values). a. 0010:0200 b. 0100:DFAD c. DADD:6727 Please explain in detail ...

retrieve the 2 highest item from a list containing 100 000 integers

Hi everyone, How can retrieve the 2 highest item from a list containing 100 000 integers. You do understand without having to sort the entire list. ...

implement SIMD in C++

I'm working on a bit of code and I'm trying to optimize it as much as possible, basically get it running under a certain time limit. The following makes the call... static affinity_partitioner ap; parallel_for(blocked_range<size_t>(0, T), LoopBody(score), ap); ... and the following is what is executed. void operator()(const blocked...

Write a program which works out which is the lowest priced computer in an ArrayList of computer objects.

Hello everybody! I am trying to study some java and cannot get my head around this question! Any help would be really appreciated and would help me in further studies! Thank you so much in advance! Eoin from Dublin, Ireland. ArrayList of Objects Write a program which works out which is the lowest priced computer in an ArrayList of comp...

Why is setscheduler not forcing need resched

I noticed that in Linux kernel 2.4 setscheduler doesn't force need_resched. Why is that? is it just some convention, or does that happens somewhere else? ...

implemented a program that generate non transferable licence

Hello, I'm taking a security class and required to implement a licensing server that send licenses that are non -transferable. I have no idea how to do that, could you please give me some of your ideas. Regards, ...

Swapping names using indexOf and substring and compareTo

I am having trouble understanding how to use the indexOf() and substring() and compareTo() methods to flip people's first name with their last name in an array. ...

Finding the best person in an array

I have an array called Names[5] and one called scores[5][5]. Each row corresponds with the name in the respective index. I need to find the highest score in the scores array and return the name that corresponds with it. This is what I have so far: int high = 0; for(a=0; a<5; a++) for(b=0; b<5; b++) if(high<scores[a][b]) ...