Jump to content

Hey guys Im quickly getting the hang of this but want some small challenges that I can try and ov...


G+_Dean T
 Share

Recommended Posts

 

This is called "FizzBuzz".

Do a for loop from 1 to 100 and for each number, ouput to the console.:

 

If the number is divisible by 3, output "Fizz"

If the number is divisible by 5 output "Buzz"

If it is divisible by 3 and 5, output "FizzBuzz"

If it is none of those, output the number to the console.

 

So it should output 

1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13,

14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz,

26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ...

Link to comment
Share on other sites

I think we have learnt enough to do some simple coding. what I am now writing is very basic where I ask the user for two integers then use a function to return their sum (very basic compared to what others are posting here but fun for a real beginner like me).

 

Eventually i was think about trying to write a game where you guess a number -> Enter a max value, enter a min value then the code creates a random number and the user guesses it with prompts like Higher, Lower etc. It could even calculate the number of turns.

 

from the simple coding we have done so far this will be a real challenge for me but not too difficult. Do post back what you eventually code.

Link to comment
Share on other sites

I ended up making a love calculator. Do you remember when you were kids (maybe still are) and you have a crush on someone, you would write both names down and compare how many letters appear in the word loves then calculate a percentage of how well suited you were for each other. Well I did that. I have my fingers crossed it gets shown as I have worked for hours on it and I have only been doing c# for a week using c101!

 

You can see my code here http://pastebin.com/5Wv3gwp5

Link to comment
Share on other sites

 Share

×
×
  • Create New...