So, I was wondering if there was anyone involved or wanting to get into programming in the playground, and just had a few questions:
- Where are you and what are you doing in terms of programming? Employment, education or in your spare time?
- What language or languages are you using primarily at the moment? What's your favourite, and why?
- Where do you hope to go with your programming? Any plans for the future, or just waiting to see if anything of interest comes along?
- Any projects, personal or otherwise, you're in the middle of? Anything you're really focused on?
- What environment do you work/prefer to work in? Netbeans/Eclipse/Command line and a text editor?
- Any problems that are driving you mad? A piece of code not compiling right, or being off by one, or one little syntax error in a sea of code? Not quite grasping the logic of a particular piece of code?
For myself:
- Doing a 8-ish month course on java at the moment, and I've done a year of computer applications before.
- Java is pretty much my bread and butter at the moment, but I have some skill with html(yes I know it's not a programming language. Hush.:smallredface:) and I've been peeking into in C and C++ lately.
- Hoping to get a full time job as a fully certified programmer, though methinks that's a while off.
- Apart from the odd random idea such a coin counter or dice game in java, I've been seeing about doing something in Danmakufu, like this, though I'm still quite a novice that regard. I'm also hoping to eventually develop a small roguelike game, though the notion of it rather terrifies me.:smalleek:
- I started with compiling and running on the command line on linux, and I'll die with the command line, though I'm trying to get used to Netbeans at the moment.
- I'm having a rather annoying problem with Java; for most of my old code from college, I had used the console commands to read in strings/ints/etc from the user on the command line. I've only recently started coding again, but for the life of me I can't find out how to set up or import the console util, or the graphics util for some of my other code for that matter; this is regardless of whether I use command line, Eclipse or Netbeans. Any help would be much appreciated.
So yeah, any programmers in the playground? If so, speak up.:smallbiggrin:
Oh, and I may randomly post interesting bits of code, if people need them, or if there's something about them bugging me; things like this:
Code://Works as planned when tested, values come out
//correctly. Originally thought a while loop was
//needed, but realised that wouldn't be the case when
//using the / and % arithmetic operators. Works for
//values above 99, just giving out more 50's. Unsure
//if a restriction is needed on the money entered,
//but an if statement could be used.
public class Change //
{
public static void main(String[] a) //main class
{
System.out.println("Enter amount of cents: "); //gets user to input amount of money in cents
int centsx = Console.readInt(); //code to translate 1 euro = 100 cent could also be used
int cents50 = (centsx / 50);
//First line finds the value to print out. Eg, if 99 cent, this will print 1.
int cents50Remain = (centsx % 50);
//Second line finds the remainder to send to the next line. Eg if 99 cent, this will divide by 50,
//and send remainder(49) to next line of code.
int cents20 = (cents50Remain / 20);
//Uses the remainder from the above line to repeat the First line for the 20cent value.
int cents20Remain = (cents50Remain % 20);
int cents10 = (cents20Remain / 10);
int cents10Remain = (cents20Remain % 10);
int cents5 = (cents10Remain / 5);
int cents5Remain = (cents10Remain % 5);
int cents2 = (cents5Remain / 2);
int cents2Remain = (cents5Remain % 2);
int cents1 = (cents2Remain / 1);
int cents1Remain = (cents2Remain % 1);
System.out.println("50: " + cents50); //These print out of the number of each coin that was calculate
System.out.println("20: " + cents20);
System.out.println("10: " + cents10);
System.out.println("5: " + cents5);
System.out.println("2: " + cents2);
System.out.println("1: " + cents1);
//More organised when grouped together, as opposed to
//int cents50 = (centsx / 50);
//int cents50Remain = (centsx % 50);
//System.out.println("50: " + cents50);
//A while or for loop may be possible to use here with a break; command. Will have to try out.
}
}