hey,
I need to rotate a 2d array in such way :
4X4-->
Input Output
1 2 3 4 5 1 2 3
5 6 7 8 1 2 6 4
1 2 3 4 5 3 7 8
5 6 7 8 6 7 8 4
or for odd 5X5-->
Input Output
1 2 3 4 5 6 1 2 3 4
6 7 8 9 10 1 2 7 8 5
1 2 3 4 5 6 7 3 9 10
6 7 8 9 10 1 8 9 4 5
1 2 3 4 5 2 3 4 5 10
can someone help me?
as ...
i have done only loops,if/else,arrays and functions. And im expected to finish this assignment by 5th October 2010. Would be really grateful if anyone could help me with this!!
Topic: Flip’em
Background:
Flip’em is a fun matching game that helps you improve your memory. Your goal is to match each tile with its twin until all the chara...
I know what a static array is and how to use it in Java, but my Prof assigned us a program and for one of the many classes we had to create, he asked us to 'use a static array' in such a way that multiple objects will store their data there.
For instance, if the objects were car garages, then each garage instance would store in a 100x3 ...
I want the database diagram to be designed for the following attributes applying normalization to it. So if anyone knew it please get back to me with answer.
This is the HR Database
ID. Field
1 Employee ID
2 First Name
3 Middle Name
4 Last Name
5 Initial
6 Father's Name
7 Mother's Name
8 Gender(...
I wrote this code in C++ as part of a uni task where I need to ensure that there are no duplicates within an array:
// Check for duplicate numbers in user inputted data
int i; // Need to declare i here so that it can be accessed by the 'inner' loop that starts on line 21
for(i = 0;i < 6; i++) { // Check each other number in the ...
I am developing a game where the user plays a slot machine. The slot machine needs to randomise the 3 different symbols in nine pieces fields, for example the symbols:
A A A
O A O
X X X
I am using a two-dimensional array but I don't know how to randomise the array?
The second problem. I don't know how to compare the symbols in the ...
I am attempting to complete a homework assignment and would like to make an array of data structure and initialise it with names. However, when I try to compile my code I get the following error:
**error C2440: '=' : cannot convert from 'const char [13]' to 'const char'**
I am including my code below. Please advise me what I might be ...
I am working on a uni assignment, which is to be done in C. This is my firs time programming in C, and I am VERY close to having a workable solution, but my code is throwing a Segmentation Fault during runtime and I simply cannot locate the cause.
Here is my code:
#include "./shared.h"
#include "./scheduler.h"
PCB_entry *ready_q...
My question is like the one here.
I'm working on a char list list and I need to check that 1-9 are used once in every list, but also once in every position in the list.
My code looks like this:
infix member
fun x member [] = false
| x member (y::ys) = x = y orelse x member ys;
fun rscheck xs =
let
...
Hello,
I have question quite much related to this one I asked a while ago
http://stackoverflow.com/questions/3743764/place-a-value-in-the-sorted-position-immediately
I wonder if you can use the same approach in that you step backward in a linked list to find the position it should be inserted into.
If it is possible how do you loop a ...
Program: Ones counter
The user will type in an integer.
The program will pass the integer to a function that will count the
number of binary bits that are "1".
Now here is the C+ pseudocode I'm using to translate to MIPS language but when I
tried to use it in my program it won't run. I'm I using the right C+...
I'm attempting to construct a function that will perform a sanity check on the user's response to a number of questions, each of which would ideally be a non-zero integer. How can I construct a function that would be able to accept a parameter of any data type, but only have a single parameter? For example:
bool SanityCheck(<type id> nu...
This code is supposed to skip white space and return one word at a time. A couple of questions on this code: When the code gets to the *word++=c; line I get a core dump. Have I written this line correctly? and is return correct. And Do I need to somehow allocate memory to store the word?
//get_word
int get_word(char *word,int lim){
...
For my assignment I've had to create an ArrayStack, a StackADT, and now I have to make a program to take in a string and output it in reverse.
Now this sounds simple, but I have no idea how to push something into the array. I've been googling the shit out of this and can't find an actual answer that makes sense.
Specifically I'm having...
I have a database with a listing of documents and the words within them. Each row represents a term. What I'm looking to do is to count how many documents a word occurs in.
So, given the following:
+ doc + word +
+-------+--------+
+ a + foo +
+-------+--------+
+ a + foo +
+-------+--------+
+ a + bar +
+-----...
On my homework I have a question/part where I am confused at (can't understand it).
Iv ) The main method calls the printdata() method for each Earthquake object. The printData() method accepts an Earthquake object as a parameter and prints all the Earthquake's idea, including latitude, longitude, magnitude and classification. Remember t...
i'm trying to make a program that reads two English words from the command line, then outputs all possible ways the words can cross eachother. and print an error message if they do not cross. i want to use the charAt and length methods.. not sure where to even start..
here's what i got so far:
public class Cross2
{
public static vo...
I am working on a C assignment for uni, and I've been coding in TextMate and compiling in the command line.
But TextMate wont (or cant) format C code, as it would for say, HTML, Ruby or PHP (using SHIFT + CTRL + F).
Is there a plugin or some other tool I can use to fix my indenting and curly braces for .c files?
...
Hello! I've created a sorted linked list and now I'm trying to figure out how to remove duplicates. I wanted to add code that would do this in the Add method I created but I can't seem to figure it out. I feel like this should be relatively easy but I'm a bit brain dead right now.
In my add method I check the index to see where an item ...
I ama complete novice to C, and during my university work I've come across comments in code that often refer to de-referencing a NULL pointer. I do have a background in C#, I've been getting by that this might be similar to a "NullReferenceException" that you get in .Net, but now I am having serious doubts.
Can someone please explai...