No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I need to combine two bits in the same array so that I can display the TCP source and destination. With my code I pull in all the information from the packet and go to work on all of the individual parts. Here is my TCP section [CODE]TCP_source = eth_buffer … |
|
I have to read in a file and do dot product calculations on two arrays but I get an error whenever I try to run it. Here is my code, [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { FILE* input; FILE* output; int product=0; int length=0; int* … |
|
So I converting a decimal value into hex, but I need to print it out from an array. I'm not sure where to go from here. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> int hexa = 16, deci, quotient, p; void dec2hex(unsigned int x, char hex[]) { for (p = … |
|
I am writing a toString method where a it returns three integers. If any of them are less than ten I have to add a zero before the number. For example if I had the variables 5, 6, and 2 it would read 05:06:02. I really can't figure out how … |
|
I am writing a toString method for my Nursery class but am having trouble getting everything working properly. I have to go through the ArrayList and call the toString method for each individual tree and then the sum for all of the trees prices. Here is what I got so … |
|
I have two constructors that are pretty much exactly the same except that one also takes in a boolean value. I want the constructor with four parameters to the call the other one in order to get the the first three. Here is what I have so far. [CODE] public … |
|
In my tree class the user can set the fall color of whatever tree they choose, but it's not taking the colors I type in when I test it. [CODE]import java.awt.Color; public class Tree { private String treeSpecies; private int treePrice; private Color currentColor; private Color fallColor; private int treeAge; … |
|
Okay, so I wrote a method that goes through the arraylist checks if the items has the maximum value, which is ten, and returns it in a new arraylist. I got that method to work, but I am having trouble writing the test class for it. It keeps returning false. … |
|
Okay, so I made a method that will take a Track with the MAXIMUM_RATING, which is 10 and make an another ArrayList for those tracks with the highest rating. [CODE] public ArrayList allTracksWithMaxRating() { ArrayList<Track> maxRatingTracks = new ArrayList(); int i = 0; while (i < tracks.size()) { if (tracks.get(i).getRating() … |
|
Okay so my loop is supposed to check if an item in the ArrayList has the MINIMUM_RATING value which is 1. It does that just fine, but the problem starts when there is more than one item with the MINIMUM_RATING value in it. I need it to stop at the … |