637 Topics
| |
I am trying to sort an ArrayList of Strings using the Merge Sort algorithm. However, I am having an error where it occurs on line 67 **`result.set(i,right.get(r));`** Where I get the IndexOutOfBoundsException. I have tried printing out the index of the result, and it seems to be that I am … | |
i need help with if statement. for some reason its not working right and i dont know why. i never goesinside 2nd if statement. i i want to go inside this if statement - if left_var value is "2x" //for loop iam start with x. b = 'x' and b-1 … | |
lets say i have a i have a char array char left_var[] //-33x-4x+x this char left_var array has the value of "-33x- 4x+ x" and result should be "-33-4+1" and store in another array called in another word iam trying to get rid of x's and if there is only … | |
URGENT: guys i really need your help with this. I have been debugging my program for days but it doesn't seem to be improving this is the code for the table layout: <table border="1" id="COT_Table" onclick="getTableID(this)"> <td rowspan="3" scope="row">COT</td> <th colspan="4" scope="col">SFAL</th> </tr> <tr> <td colspan="2" scope="col">Temperature</td> <td rowspan="2" scope="row">vol … | |
Hello I am currently working on this code and the code can be runned well from 100-10,000 random elements after that the heap sort says stack over flow, im thinking the recursive calls are the cause of this, so please healp public static void MAX_HEAPIFY(int [] A, int i, int … | |
| So my java class is a joke, and we're expected to learn how to do our assignments via the web...I'm a hard worker, but I'm just not good at this. [Assignment pic](http://oi50.tinypic.com/aw3zx2.jpg) There's the assignment image. I think i got how to do the first part with the adding random … |
I'm trying to write a method that displays the contents of a hashmap on screen. This hashmap contains Strings and an array of int for every String. I've put the String aspects of the hashmap into an arraylist and I'm trying to use another method to print the arrays for … | |
| I have a C++ application that I want to make more flexible and user-friendly. It currently contains seven nested for-loops, and part of the new flexibility is that this number will become variable (between two and twenty, say). What is the easiest way to achieve this? |
| Hey bros. I made a program that prints out random numbers in a linked list. I want to have the index number next to each of the random numbers in the list. I guess for example like: 1 25 2 123 3 56 ect. Here's m program so far, and … |
Hello, I am writing code that mimics the game Mastermind. The computer randomly comes up with a code based on the "colors" RGBOY. The user has ten guesses to guess what the code is. Right now my code displays the secret code at the beginning just so I can test … | |
Hi, I'm trying to sort a list of names in c++ (first name and last name). I'm running into a couple of problems with my code. I'll post the code first then state my problems. #include <iostream> #include <stdio.h> #include <cstring> using namespace std; const int numNames=3;//this makes the code … | |
I'm trying to seem if(t3.alive) is not ever entered. It successfully goes through t1 and t2 if statment but skips over three. I've tried the do while, while (like seen). I would think if t3 is still alive the loop would still go then once it's not, its out but … | |
Hola code gurus, I’m wondering if there’s a way to use a string to access a specific item in a matrix of int[X]. I have a program which uses enums as iterators to reference a large amount of data. To select an item in the matrix, the user will enter … | |
Write a java program that will open a file, read each of the records from the file, use that data to populate a two dimensional array and write the sorted data out to a new text file. Define a class named [B]Munge[/B] which will do all the 'heavy lifting' in … | |
Hi! I made a program that accepts random numbers, create a binary tree from it, then traverse it using in-order, pre-order and post-order traversal. The program is working well but my instructor added something else, when the user input numbers, it should be arranged just like an actual tree. The … | |
hello, I am lik 98% done with this assignment where the user enters a number, and then it will output if you guessed the right number, or if you have any matching digits, so for example, the if the random number is 24 and the user inputs 20 it should … | |
Ok now i am having a retarded issue im sure. but here is what is supose to happen is n is not allowed to be more than 5 but when i run this and enter in 5 i get a blank space and when i enter 1-4 i get the … | |
Hello, I am in the process of creating a program that accepts random numbers, put them in an array and sort them using different types of sorting algorithms. I then passed the array as an argument to the "BubbleSort" function, however, when I try to call the array in the … | |
Hello all I have a bunch of aggregate elements within my array. This array is for vertex positions in OpenGL. and I need to make a switch without having to bind more data to OpenGL. To do this I must put an if statement within the array or a booleon … | |
hello everyone, I am recieving this compiler error stating that `else if(input%100 || input%10 == rndNum%100 || rndNum%10)` this line ^ gives me the error error: bad operand types for binary operator '||' was hoping someone could explain this error to me if possible, also any advice would be greatly … | |
So the program I'm writing should count how many of each individual vowel is in the program and then print that. I'm basically stuck with while and conditional statements. I think my if statement is where I've gone wrong. I'm not sure how to have it read the letter properly … | |
I wrote a simple program to take input till the char array is filled up. But i seem to be getting a problem during runtime that the program takes input continuously and never stops. Pls help in identifying the problem.(there were no errors during compiling) [CODE] #include<iostream> #include<string> using namespace … | |
Is it possible to loop an if-else statement? How would such a thing be coded. Basically, this code allows the user to enter a value for a month. If it's not from 0-12 it asks the user to enter a new value. How could I get that to go through … | |
I have a Product class that is the parent of 3 other classes; Books, Movies, Music. And the Product class connects to the Store class that holds the Store's location. If I need to find a certain Product I have to traverse the list of each the Store class and … | |
Hello, I am a beginner at programming and I am having some trouble finding the error in my code(pasted below). I am first trying to come up with a (1) function to evaluate integers at a given power.(2) A function to check if an integer is a perfect number. I … | |
Hi all, I have a situation where am using String conditions(say if(name.equalsIgnoreCase(Arathy)). I want to replace this if-else loop with Switch cases..What way i can do to accomplish this? | |
Hi! I'm writing a program in C++ where the user is asked to enter a list of ten names and cities of residence in the format <firstname> <Surname> <city>. I then have to sort the list by city and then in each city group alphabetically by name, using Bubblesort. I'm … | |
Hi, I'm writing a program in C++ to ask the user for a list of ten names and cities of residence in the format <firstname> <Surname> <city>. The amount of spaces between each doesn't matter as I will be using isspace. then i have to sort the list by city … | |
Having trouble getting the QuickSort to work in this code. I turned off the counter for now, just trying to get the sorted array to display correctly. This is the results I get from the code: This program keeps track of the number of comparisons required to to sort a … | |
Wassup Guyz, I got this laptop Toshiba Satellite and everytime i play games the screen freezes in every 15 sec. Pls Help me Out=) Pc: Processor:AMD Turion X2 Ultra Dual-Core Mobile ZM 80 2.10Ghz Ram:4GB System:Windows 7 64 bits |
The End.