Assignments and Challenges

Post them here!

  • (5 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5

62 Replies - 73160 Views - Last Post: 26 May 2014 - 11:18 AM

#46 dtg715  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-May 10

Re: Assignments and Challenges

Posted 26 May 2010 - 10:56 PM

I have done an assignment (similar to this) and I have lost some marks too...The main issue of my solution was the concurrency control... :dead:

This post has been edited by dtg715: 26 May 2010 - 11:07 PM

Was This Post Helpful? 0
  • +
  • -

#47 raine36  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-June 10

Re: Assignments and Challenges

Posted 11 June 2010 - 08:57 AM

I have a question regarding one of the problems on the CodingBat Java practice problems that were posted in this thread a while ago. Here's the practice problem:

/*
We want to make a row of bricks that is goal inches long. We have a number of small bricks (1 inch each) and big bricks (5 inches each). Return true if it is possible to make the goal by choosing from the given bricks. This is a little harder than it looks and can be done without any loops.

makeBricks(3, 1, 8) → true
makeBricks(3, 1, 9) → false
makeBricks(3, 2, 10) → true
*/

This is the starting code you are given:

 
public boolean makeBricks(int small, int big, int goal) {

}



Now, tell me if I'm reading this wrong, but it seems to me that the third example call to makeBricks should return false. From how I understand it, it says there are 3 small bricks (of 1 inch in size) and 2 big bricks (of 5 inches in size) for a goal length of 10 inches. Obviously, the 3 small bricks and 2 big bricks will reach 13 inches in length, therefore returning false.

I have two ideas regarding this. My first is that I'm reading it wrong and that the question is asking for something other than what I think. My second is that the question might be assigning a minimum length to goal and that all rows that reach longer lengths are acceptable. That would make the third call to makeBricks return true, as shown in the example. Anyone care to enlighten me?

Lastly, if I should have put this post somewhere else, I apologize.

*EDIT* I understand it. I can choose any number of bricks from the given assortment. So, in that third call, I'm given the 3 small bricks and 2 big bricks but can choose how to use them to reach a goal of 10 inches.

This post has been edited by raine36: 11 June 2010 - 09:02 AM

Was This Post Helpful? 0
  • +
  • -

#48 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: Assignments and Challenges

Posted 06 August 2010 - 04:57 AM

Ohhh some great resouces and challenges here, I will have to check them out. Here is something to add to the list:

UC Berkeley's CS 61B data structures course using Java is pretty good. The homework and projects for the course can be found here.

The complete set of lectures to go along with the homework(38 in all) can be found here.

I have been following along and doing the homework on and off when I have spare time(which has been sparse lately). The prof is great imo, great resource for those that want to learn on their own.
Was This Post Helpful? 0
  • +
  • -

#49 codecutter  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 26-January 10

Re: Assignments and Challenges

Posted 16 August 2010 - 02:35 PM

Here is one for you all. Pseudocode. I am in college for Computer Information Science and I feel dumb because I can write real code in VB2008 in Windows Based applications. Pseudo code is an outline for real code (for those who didn't know). I can not stand writing in fake code. I have to do it for my classes. I am rambling....... Good day.

My last post made no sense, I apologize. I feel dumb because I am not able to grasp the idea of fake code. I get stuck on writing the fake code because I can not run a program and test the result to be able to fix the problems. I am just beginning the whole programming as a college student scene.
Was This Post Helpful? 0
  • +
  • -

#50 Nikitin  Icon User is offline

  • D.I.C Regular

Reputation: 56
  • View blog
  • Posts: 264
  • Joined: 02-August 10

Re: Assignments and Challenges

Posted 16 August 2010 - 04:36 PM

View Postcodecutter, on 16 August 2010 - 01:35 PM, said:

I feel dumb because I am not able to grasp the idea of fake code.


The idea is to suppress language-specific details to be able to focus on the problem at hand. It's a great technique of dealing with complexity - which is a major issue that computer science deals with.
Was This Post Helpful? 1
  • +
  • -

#51 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,424
  • Joined: 28-November 09

Re: Assignments and Challenges

Posted 21 August 2010 - 09:05 PM

http://ocw.mit.edu/c...mputer-science/

MIT == love
Was This Post Helpful? 0
  • +
  • -

#52 guahguahmonster  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 68
  • View blog
  • Posts: 209
  • Joined: 29-August 07

Re: Assignments and Challenges

Posted 27 August 2010 - 03:30 AM

Oi, anyone still updating this thread? Got a few links.

Facebook puzzles
Code Chef
Was This Post Helpful? 1
  • +
  • -

#53 developerNumberOne  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-October 10

Re: Assignments and Challenges

Posted 27 October 2010 - 03:21 PM

Assignment

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#54 honeybeemel1969  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 43
  • Joined: 24-January 11

Re: Assignments and Challenges

Posted 26 January 2011 - 09:44 PM

View Postsalindor, on 03 November 2008 - 06:44 PM, said:

Whenever I am teaching someone for loops, I always give them the following assignment.

Construct the following geographic patterns:
x
xx
xxx
xxxx


xxxxx
xxxx
xxx
xx
x


____x
___xx
__xxx
_xxxx
xxxxx


xxxxxxxxxx
xxxx__xxxx
xxx____xxx
xx______xx
x________x


You are only allowed the following print (you can always modify for a different langauge other than c/c++) statements:
printf('x');
printf('_');
printf('\n');


The first two patterns are only allowed one printf('x') and one printf('\n') statement
The second pattern is only allowed one of each printf statement
The final pattern only allows two printf('x') and one printf(' ') and printf('\n') statement

Normally I tell them to use a space instead of an underscore, but I was having a strange problem with the space on the second triangle where one line refused to respond like everything else.

Salindor


I like this one. If you want a real challenge, though, you could do it like the assignment I just had (thought it was a little much for week 4 of my first programming class, but maybe not). Allow the user to determine the number of rows in the tree pattern...use stars for the tree (instead of the underscores you have above) and spaces for the white space around it. Prompt for the number of lines and reprompt if the user enters a number that is not allowed (we limited to 1 through 30, inclusive). The number of stars in each line is equal to that line's line number plus the line number of the preceding line. So, if I was on line 5, then I would have 5+4 stars on that line. After the tree is made, prompt the user to decide whether to make another.

This is an awesome assignment to learn loops. I used FOR, WHILE and DO...WHILE loops. It was way fun. Here is a link to the code if you want to check it out (yes, I wrote this...It might not be elegant, but it works. :) ) http://www.dreaminco...oops-asterisks/
The code I wrote is in post #12.

View Postcodecutter, on 16 August 2010 - 02:35 PM, said:

Here is one for you all. Pseudocode. I am in college for Computer Information Science and I feel dumb because I can write real code in VB2008 in Windows Based applications. Pseudo code is an outline for real code (for those who didn't know). I can not stand writing in fake code. I have to do it for my classes. I am rambling....... Good day.

My last post made no sense, I apologize. I feel dumb because I am not able to grasp the idea of fake code. I get stuck on writing the fake code because I can not run a program and test the result to be able to fix the problems. I am just beginning the whole programming as a college student scene.


dude! I can't write pseudocode either. Instead, I use flow charts. My prof doesn't care how we get the right answer as long as we actually do get the right answer. Have you tried just writing it as if it was step-by-step instructions? Isn't that pretty much what pseudocode is? (You could make a flowchart and then translate it to fake code.....)
Was This Post Helpful? 0
  • +
  • -

#55 -=m0n1k3r=-  Icon User is offline

  • D.I.C Regular

Reputation: 16
  • View blog
  • Posts: 250
  • Joined: 10-February 10

Re: Assignments and Challenges

Posted 03 February 2011 - 12:13 PM

My way of dealing with pseudocode is either creating my own new language with a straightforward syntax or just pulling up a shell in something like IDLE python and running some code through it.

Side note -- if your program isn't sequential you can't do step-by-step for it. It works great until you have to deal with modules or functions.

This post has been edited by -=m0n1k3r=-: 03 February 2011 - 12:15 PM

Was This Post Helpful? 0
  • +
  • -

#56 ThePawnBreak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-April 11

Re: Assignments and Challenges

Posted 04 June 2011 - 09:33 AM

http://www.pythonchallenge.com/

I found this yesterday, it's tons of fun!
Was This Post Helpful? 0
  • +
  • -

#57 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 391
  • Joined: 04-January 11

Re: Assignments and Challenges

Posted 08 June 2011 - 06:02 PM

I am a graduate of a dual major course of BS Applied Mathematics with Information Technology. I say the hardest programs I created are those in Mathematics.

IT programs usually involves company systems which mostly just include updating and deleting from database. Computations tend to be simpler.

But in Mathematics, there's a lot of Mathematical equtions to program. The most practical ones are those that compute for insurance in Actuarial Mathematics. It's not that hard though.

The more difficult ones are those in Numerical Analysis and Calculus.

I created programs before converting types of notations, then computing for Newton's Advancing formulas and other formulas in numerical analysis.

In calculus,I created a program computing using Newton's Approximation. The user inputs an equation then the program computes for the roots, the maxima, and minima. Then it graphs the roots.

I had no idea of GDI+ that time so I had a hard time creating the graph but I was really glad to finish it.

I had just a problem regarding infinite loops since there are a lot of conditions to consider in difficult formulae such as the Newton's Approximation and I was really glad to solve it.

If you have seen a difficult to solve math equation or an equation which repeats solutiion several times before getting the final result, try programming it. I am sure it will be really challenging.
Was This Post Helpful? 0
  • +
  • -

#58 :(D):(P):  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-March 11

Re: Assignments and Challenges

Posted 05 September 2011 - 11:48 AM

http://codingbat.com/
Its fun if you are a beginner and helps with the easy things.

:withstupid:

But this is for everyone so use it and learn.
Do not worry if you are new, everybody starts somewhere!

As far as I know the site features Java and Python.
High level languages

This post has been edited by :(D):(P):: 05 September 2011 - 11:51 AM

Was This Post Helpful? 0
  • +
  • -

#59 zombieMadMonkey1971  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 74
  • Joined: 01-October 11

Re: Assignments and Challenges

Posted 14 November 2011 - 08:37 PM

I'm racking my brain over this question for C++ "a Typically header files contain the specifications of classes, prototypes of functions and constants." Is this True?
Was This Post Helpful? 0
  • +
  • -

#60 murume  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 49
  • Joined: 21-June 11

Re: Assignments and Challenges

Posted 10 October 2012 - 03:25 AM

View Postajaymatrix, on 17 May 2008 - 05:42 AM, said:



I was about to post requesting for beginner stuff in C when I was your post. I haven't really gone through all the stuff but I'm liking SPOJ already.
thanks very much
Was This Post Helpful? 0
  • +
  • -

  • (5 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5