Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
~3K People Reached
Favorite Forums
Favorite Tags
c x 15
java x 13
c++ x 6
Member Avatar for atramposch

[CODE]public Node<E> remove (int index)[/CODE] i need to recursively implement this method. Node<E> nodes contain two fields, next (a reference to the next node in the linked list) and element (a reference to the data it contains) [CODE]public E element; public Node<E> next;[/CODE] Do not worry about the checking for …

Member Avatar for atramposch
0
2K
Member Avatar for atramposch

Imagine a windows paint program that draws a square. I wrote some code to do the following: A vertex change may make a square bigger or smaller (or unchanged if the vertex value is the same). You must adjust the other vertices, as necessary, to keep the shape a square. …

0
62
Member Avatar for atramposch

Ive written these two methods but they are giving me lots of problems. [CODE]public int indexOf(Object element) 128 { 129 for(int i = 0; i < list.length; i++) 130 { 131 if(list[i] != null && list[i].equals(element)) 132 { 133 return i; 134 } 135 } 136 137 throw new IndexOutOfBoundsException(); …

Member Avatar for Taywin
0
86
Member Avatar for atramposch

I'm writing an indexOf method for a class called BasicArrayList. i have two private instance variables an Object[] called list, and an int called size. [CODE]public int indexOf(Object element) 67 { 68 for(int i = 0; i < size; i++) 69 { 70 if(list[i].equals(element)) 71 { 72 return i; 73 …

Member Avatar for atramposch
0
134
Member Avatar for atramposch

I wrote this code to find the mode of an array of values. [CODE]double mode (double * array, int numItems) { int j, i, maxRepeats = 0; double mode; for(i = 0; i < numItems; i++) { j = 1; while(array[i] == array[i+j]) { ++j; } if(j > maxRepeats) { …

Member Avatar for Adak
0
105
Member Avatar for atramposch

I wrote this function for an assignment. It utilizes dynamic memory, which grows and shrinks as needed. I wrote it like this at first: [CODE]int user_input (int * array, int intSize) { printf("Please enter any number of integers (80 characters per string max), enter an empty string to signal input …

0
82
Member Avatar for atramposch

[CODE]void user_input (int * array, int intSize) { printf("Please enter any number of strings (80 characters per string max), enter an empty string to signal input completion\n\n"); int i = 0; int j = 0; int arrayMax = MAXARRAY - 1; char input[81]; while (input[0] != '\0') { printf("->"); i …

Member Avatar for Shankye
0
157
Member Avatar for atramposch

I wrote a short piece of code to give me a .dat file for use in another program. But i cant figure out what is wrong. I run on a mac, and use Xcode. [CODE]#include <stdio.h> #define ARRAYSIZE 1500 #define BINDATA "file://localhost/Users/Hub/Desktop/231A4binData.dat" int main (void) { int i; double dblData[ARRAYSIZE]; …

Member Avatar for Ancient Dragon
0
165
Member Avatar for atramposch

i know there is probably a trick for this in C that i do not know, but i attempted to write my own function for finding the mode of an array of data (As large as 1500 doubles). Heres my crack at it. [CODE]void mode (double * array, int numItems) …

Member Avatar for atramposch
0
98
Member Avatar for atramposch

So does this code adequately satisfy this question? Write a function named tokenize() that will receive the following parameters: a char * to the string to tokenize, and a char * [] that will receive pointers to all of the tokens generated, in their order of generation. The function will …

Member Avatar for Ancient Dragon
0
87
Member Avatar for atramposch

I have no syntactical errors, but i cant figure out why this wont work. Heres the code. [CODE]#include <stdio.h> #include <string.h> #include <ctype.h> #include <math.h> int main (void) { char str[100]; int i = 0, line_count = 0, len = 0, alpha = 0, lower = 0, upper = 0, …

Member Avatar for Taywin
0
241
Member Avatar for myk45

Hello, i have 2 small doubts regarding pointers. 1)im trying to defererence 4 bytes as shown, and im initializiing each byte using a char pointer. But im getting runtime errors. Code [CODE] char a = 65; char *ptr = (char *)malloc(4); int *ptr1; ptr = &a; ptr1 = &a; *ptr …

Member Avatar for myk45
0
171
Member Avatar for atramposch

Heres the assignment. 1. Declare a string, e.g. char str[81]; 2. Input a string from the keyboard (spaces included) using the (while statement while( while (str[i] = getchar() != '\n' ) adjusted so that it only inputs a certain number of characters ( in the above example that would be …

Member Avatar for gerard4143
0
147
Member Avatar for atramposch

supposed to declare a string of a certain size (eg. char str[81]) Then input a string from the keyboard (spaces included) using the while (NOT, gets(), or fgets()) technique (while ((str[i] = getchar()) != '\n')) adjusted so that it only inputs a certain number of characters (in the above example …

Member Avatar for Ancient Dragon
0
151