Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,899 members, 7,802,904 topics. Date: Saturday, 20 April 2024 at 02:49 AM

Programming Projects/assignments: Get Your Code... - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Programming Projects/assignments: Get Your Code... (1623 Views)

We need programming projects to mess with and provide solutions / Simple Programming Projects For Beginners / Programming Projects (individual) (2) (3) (4)

(1) (Reply) (Go Down)

Programming Projects/assignments: Get Your Code... by skydancer: 10:18pm On Jul 11, 2011
Alright, I believe this won't be too much, but just for the fun of it, I want to do this. If you have any programming project or assignment, just post it here. I write mostly in C#, but a little of CPP, VB, Java and Python so at times if you have really tough stuff, you might have to figure out how to translate it to your own language tongue

I hope this thread serves as a learning resource hub for both beginning programmers and even advanced programmers like me in Nigeria, and the rest of the world cheesy

Let the coding begin  cheesy
Re: Programming Projects/assignments: Get Your Code... by Mobinga: 11:42pm On Jul 11, 2011
Write a code to calculate n factorial. In any language. Thanks wink
Re: Programming Projects/assignments: Get Your Code... by skydancer: 12:27am On Jul 12, 2011
@Mobinga:

using System;

namespace Factorial
{
class Program
{
static void Main()
{
//declare and initialize integer for our downwards multiplication
Console.Write("Enter number to get factorial for: "wink;
//recieve and store value
int total = Convert.ToInt32(Console.ReadLine());;
//create a for loop to loop downwards from n to 1
for (int i = (total - 1); i > 1; i--)
{
//multiply current total with reduced value
total = total * i;
}
Console.WriteLine("The answer is : {0}", total);
}
}
}


@omo_to_dun:
Hmm, the 'coding arrogance' is quite strong here. I understand you, but I think you should think a little bit more positively.
Re: Programming Projects/assignments: Get Your Code... by Mobinga: 12:32am On Jul 12, 2011
Right!
Does c# support total *= i; instead of total = total * i; ??
Re: Programming Projects/assignments: Get Your Code... by skydancer: 12:59am On Jul 12, 2011
Yeah, but am not really used to it.
Re: Programming Projects/assignments: Get Your Code... by Mobinga: 10:35am On Jul 12, 2011
Javac
  
psvm{
int factorial = 1;
for (int i = 5; i>=1; i--){
System.out.println(factorial*=i);
}
Re: Programming Projects/assignments: Get Your Code... by Fayimora(m): 5:52pm On Jul 17, 2011
CLEANED UP
Re: Programming Projects/assignments: Get Your Code... by iGravity(m): 8:33pm On Aug 03, 2011
Java is too much noise - too verbose.

Consider this,


def fib n
    (n <= 0) ? 1 : fib(n - 1) + fib(n - 2)
end
puts fib 15


Exponentially slow but elegant. Dont try to use this for any n > 400, you may sleep before the result comes on. For faster algorithms, consider memoizations or dynamic programming
Re: Programming Projects/assignments: Get Your Code... by Mobinga: 12:03am On Aug 04, 2011
iGravity:

Java is too much noise - too verbose.

Consider this,


def fib n
    (n <= 0) ? 1 : fib(n - 1) + fib(n - 2)
end
puts fib 15


Exponentially slow but elegant. Dont try to use this for any n > 400, you may sleep before the result comes on. For faster algorithms, consider memoizations or dynamic programming

What lang?
Re: Programming Projects/assignments: Get Your Code... by Fayimora(m): 1:39am On Aug 04, 2011
[size=15pt]dats Ruby. Funny enough your Java code can get reduced aswel. The ternary operator is the only thing making it short which exists in other languages. tongue [/size]
Re: Programming Projects/assignments: Get Your Code... by matrix4u(m): 4:36pm On Aug 05, 2011
Kudos to you guys. You are wonderful. Although we are taught Programming languages in our Schools but without more explanation from you guys, we cannot do it alone. For all the NACOSSITES in the the house i greet you all.
Re: Programming Projects/assignments: Get Your Code... by jimmy2009: 7:02pm On Aug 07, 2011
im greatful to see thiss heeeeeeeeeeee
Re: Programming Projects/assignments: Get Your Code... by Makavelis(m): 3:27pm On Aug 11, 2011
Who can implement Android's Toast widget in JavaME?
Re: Programming Projects/assignments: Get Your Code... by matrix4u(m): 7:48am On Aug 12, 2011
Write a consoled based program that can compute the factorial of any given number in Java

(1) (Reply)

Which Language/framework Is Recommended For Startups? / Free Script For Scrambling Php Distributed Codes (obfuscator) / How Can I Create A Good Software Company That Will Flourish In Nigeria?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.