PDA

View Full Version : can you help




hena
Jun 26, 2008, 04:18 AM
hello can you helo i am hena please if you can help me to solve this project
project :
1. Consider the C-like code below. What values do the last three lines print out? If it’s printing an address, tell me what variable’s address it is printing. Assume that the “print” statement “does what you’d expect” - it prints out the value of the address or variable after it.


int p[20];
for (i=0; i<20; i++)
{p[i] = i;}
int *mypointer = &p[0];
print *mypointer;
print p;
print p[3];


2. Processor P1 has a 1GHz clock, and processor P2 has a 2GHz clock. They have completely different instruction sets, but they both execute exactly 1 instruction per cycle. Which processor has better performance and why? You must explain your answer to get credit.




3. Write a MIPS assembly program that reads a string of integers and computes whether it (the number represented by the entire string) is prime or not. Assume the string of integers has no more than 5 digits.


4. Write a MIPS assembly program that sorts, in ascending order, all of the characters that are provided as inputs (sorting is done by ASCII code). Assume you won’t get more than 100 characters. Some inputs may repeat. The pseudo-code for your program is below.



Mac Player
Jun 26, 2008, 04:54 AM
1) Firsts prints prints 0, second the address of p, third prints 3.

2) With different instruction sets it's impossible to compare.

robbieduncan
Jun 26, 2008, 05:23 AM
Do your own homework/course work. Seriously: if we answer this what will you have learnt? Nothing that's what. I'm reporting this in the hope that the thread gets closed.

Blue Velvet
Jun 26, 2008, 05:28 AM
I'm reporting this in the hope that the thread gets closed.

This doesn't break any forum rules and it's probably best to just ignore it.

Darkroom
Jun 26, 2008, 05:30 AM
damn... i wish i could afford to study programming...

robbieduncan
Jun 26, 2008, 05:39 AM
This doesn't break any forum rules and it's probably best to just ignore it.

Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:

Enuratique
Jun 26, 2008, 06:11 AM
Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:

I feel you, bud.

mcgomer
Jun 26, 2008, 06:37 AM
Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:

Its worse than that, they go into management and end up being decision makers on how to implement projects. :D

lee1210
Jun 26, 2008, 10:22 AM
Computer Architecture was one of the best courses I took in my undergrad CS program. I would never imagine trying to get around the work. If you don't like CS, there's always MIS or other such degrees that aren't as technically rigorous. If you really have no idea, and you have read the book (Sounds like Patterson and Hennessy) thoroughly, you should speak with the professor or a TA to get help with this. Asking us to do your homework is no better than just copying it from someone else.

Download spim here:
http://pages.cs.wisc.edu/~larus/spim.html

And build it for your OS X machine (I assume you have a mac since you're posting here). Then get to work writing the MIPS ASM.

As for the first two questions, I don't believe you even made an attempt.

-Lee

foidulus
Jun 26, 2008, 12:42 PM
Fair enough. It just makes me very angry that people who cheat and lie their way through life like this may end up getting qualified and giving my industry a bad name when they are found to know nothing :mad:

Just give bad advice :p

To the op, your program prints "Do your own homework!" in an infinite loop :p

jeremy.king
Jun 26, 2008, 01:28 PM
Do your own homework/course work. Seriously: if we answer this what will you have learnt? Nothing that's what. I'm reporting this in the hope that the thread gets closed.

While I agree with you completely and respect your presence in this forum, you seemed to have no real issues doing someone else's job (http://forums.macrumors.com/showthread.php?t=504818) for them. I commend you on insisting that the OP learn Cocoa 101, but you still provided a lot of code fixes...I don't really see the difference and try to avoid both situations.

robbieduncan
Jun 26, 2008, 01:33 PM
you seemed to have no real issues doing someone else's job (http://forums.macrumors.com/showthread.php?t=504818) for them

Whilst I see your point entirely, I think that is a very different set of circumstances. In that case the individual has clearly made some effort, was asking for help with a specific part of their existing code, not for the whole thing to be done for them and has gone on to prove that I was right: they have solved further problems on their own and have put the effort in. In that case it appears that something has been dumped on them unasked and they are trying their hardest. In this case it appears that someone has signed up for this and is not trying at all.

jeremy.king
Jun 26, 2008, 01:38 PM
Whilst I see your point entirely, I think that is a very different set of circumstances. In that case the individual has clearly made some effort, was asking for help with a specific part of their existing code, not for the whole thing to be done for them and has gone on to prove that I was right: they have solved further problems on their own and have put the effort in. In that case it appears that something has been dumped on them unasked and they are trying their hardest. In this case it appears that someone has signed up for this and is not trying at all.

I guess I looked at as students don't get paid $$$ as a result from our help, programmers do.

robbieduncan
Jun 26, 2008, 01:45 PM
I guess I looked at as students don't get paid $$$ as a result from our help, programmers do.

Lol, that's a good point. Maybe I should setup a little side business. Your basic Cocoa problems solved, $50 an hour :D