Newbie Coders Chat

Announcements Posted on
How helpful is our apprenticeship zone? Have your say with our short survey 02-12-2016
    Offline

    3
    ReputationRep:
    (Original post by Tootles)
    There's nothing like a newbie thread to masturbate your ego, is there? :rolleyes:
    Well of course I have to brag... This is TSR..... Plus wasn't my post beneficial? Now people know that if they are stuck, then they can come to me with their problem (granted that it's in a language I know). I would also like to take this time to present a very simple algebraic expression:

    Offline

    3
    ReputationRep:
    (Original post by john2054)
    All of this writing about coding in java, but no actual programs! I am disappointed! I have also been learning it for a week, and here are my first three programs to get you started with!

    public class HelloWorld { public static void main (String[] args) { System.out.print ("Hello, World"; }}

    public class Robot { String name; Robot (String name) { this.name = name; } void speak (String msg) { System.out.println(msg + name); } public static void main (String[] args) { Robot r = new Robot("debbie"; r.speak("hey there! It's me... "; Robot b = new Robot("bob"; b.speak("My name is... "; } }

    import java.util.Scanner;public class Wheel { double radius; Wheel (double radius) { this.radius = radius; } double getCircumference () { return 2 * Math.PI * radius; } double getArea () { return radius * radius * Math.PI; } public static void main (String[] args) { System.out.println("Please provide a real."; Scanner s = new Scanner(System.in); double d = s.nextDouble(); System.out.println(d); Wheel w = new Wheel(d); System.out.println(w.getCircumfe rence()); System.out.println(w.getArea()); }}

    See if you can figure out what they do?
    Great format... Do you expect anybody to actually read that? Pastebin it please?
    Offline

    2
    ReputationRep:
    I suppose I'll introduce myself for the fun of it, even though I'm a professional-level graduated programmer.

    I'm also (re-)teaching myself programming because it's been a few months ago I last programmed (at my internship corporation). Unless you are a gifted programming and logic genius (like my internship partner was), you need to constantly keep up your skills, or you will lose those skills almost entirely (like me). The IT industry is a lifelong learning one.

    Right now I'm busy studying something else that has more priority, but on my todo list is the following:

    - medium-advanced Java, C#, .NET technologies (there are a lot of those, including WCF, Web API,..)
    - communication languages such as XML, JSON
    - web frameworks such as KnockoutJS, Ember, AngularJS (even though that's a crappy language, there is a lot of demand for it on the IT market)

    My goal is to finally get rid of my medium-novice status and grow affinity for programming, even though inherently I don't understand logic (I'm an artist by heart). My biggest goal is to get a job with my skills. I just graduated from a Bachelors in Computer Science, but man have my skills weakened. I need to get back on the boat and start actively re-studying and re-practicing all of this.

    Stage I'm at: I'm probably a medium-advanced programmer, depending on how you look at it, like my professor said: "Computer scientist with great potential". I know most of the advanced things you can do with programming as well as software engineering: enterprise design patterns etc.

    Furthermore, I know too many technologies to sum up. I'll just list a few:

    - Java, C#, PL/SQL, SQL, C/AL, VB .NET, WebAPI, Entity framework, JSON, XML, HTML5, CSS3, JS, servlets, JSP, struts, AngularJS, Android, Spring, Hibernate, distributed systems

    If anyone has any programming problems concerning Java or C#, feel free to ask me for assistance.

    Happy learning!
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    All of this writing about coding in java, but no actual programs! I am disappointed! I have also been learning it for a week, and here are my first three programs to get you started with!

    public class HelloWorld { public static void main (String[] args) { System.out.print ("Hello, World"; }}

    public class Robot { String name; Robot (String name) { this.name = name; } void speak (String msg) { System.out.println(msg + name); } public static void main (String[] args) { Robot r = new Robot("debbie"; r.speak("hey there! It's me... "; Robot b = new Robot("bob"; b.speak("My name is... "; } }

    import java.util.Scanner;public class Wheel { double radius; Wheel (double radius) { this.radius = radius; } double getCircumference () { return 2 * Math.PI * radius; } double getArea () { return radius * radius * Math.PI; } public static void main (String[] args) { System.out.println("Please provide a real."; Scanner s = new Scanner(System.in); double d = s.nextDouble(); System.out.println(d); Wheel w = new Wheel(d); System.out.println(w.getCircumfe rence()); System.out.println(w.getArea()); }}

    See if you can figure out what they do?
    So, from what I can read, your program is like this:

    1) You have a HelloWorld class with a main block that accepts commandline arguments. It prints "Hello, World" to System.out.

    2) You got into learning about classes and Object-Oriented programming and you made a Robot entity, that has a name, a constructor that takes a name and sets it as the Robot's name.

    Then you have a private method named 'speak' (denoting an action) that defines the Robot's behavior. Executing this method makes the Robot say whatever message was passed in as well as whatever name was passed into the constructor.

    The Robot is then responsible for its own execution, so a main method has been added. A new Robot instance named "r" called "debbie" is created, the speak method is executed upon that instance and the line "hey there! it's me..." is passed into it.A new Robot is created with instance name "b" and his name is "bob". His speak method is executed and the line "My name is..." is passed in.Consequently, the debbie robot will say "hey there! it's me...debbie" and the bob robot will say "My name is...bob".

    Furthermore, we see the use of Java's specialized I/O Scanner class from the Java util package. A Wheel class is defined with a radius attribute.A constructor is defined with one argument 'radius', which will define the Wheel's radius.A function called getCircumference returns a double with the outcome of the local calculation.A similar function getArea() is created.

    Then, the Wheel defines the main method, in which the program starts by asking the user to provide valid input. A Scanner will then be responsible for reading that input (as it reads what comes into System.in). A double is defined, representing whatever valid double was passed in by the user and this is then printed out to the user.

    Lastly, a Wheel instance named 'w' is created using this provided double. The Wheel's dimensions then get printed out using the calculations on that double.
    Offline

    2
    ReputationRep:
    (Original post by kishette)
    I want to learn how to code, but the vast amount information online makes my head hurt. I tried teaching myself HTML and CSS, but am only at the basic level tbh...
    Babysteps, babysteps..
    Offline

    3
    (Original post by Aklaol)
    Well of course I have to brag... This is TSR..... Plus wasn't my post beneficial? Now people know that if they are stuck, then they can come to me with their problem (granted that it's in a language I know). I would also like to take this time to present a very simple algebraic expression:



    Please never forget that I am superior than you. <3333.
    20 years C and C++ experience, have designed and implemented (via simulation) my own instruction set over a weekend, and wrote a VT100 control library - over another weekend.

    Also a real programmer can parse code in any language, even ones they don't know, and can pick up new languages in less than a day.
    Offline

    3
    ReputationRep:
    I want to make a skype group for python once university starts. We would be able to contribute ideas, create new things and possibly build something innovative. If you are interested please send me a private message
    Offline

    3
    ReputationRep:
    (Original post by Tootles)
    20 years C and C++ experience, have designed and implemented (via simulation) my own instruction set over a weekend, and wrote a VT100 control library - over another weekend.

    Also a real programmer can parse code in any language, even ones they don't know, and can pick up new languages in less than a day.
    I think its appropiate to introduce BrainF here.
    Whats it print toots ?
    ++++++++[>+>++>+++>++++>+++++>++++++>++++ +++>++++++++>+++++++++>+++++++++ +>+++++++++++>++++++++++++>+++++ ++++++++>++++++++++++++>++++++++ +++++++>++++++++++++++++<<<<<<<< <<<<<<<<-]>>>>>>>>>.<<<<<<<<<>>>>>>>>>>> >>---.+++<<<<<<<<<<<<<>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>> >----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>> >-.+<<<<<<<<<<<<<<>>>>.<<<<>>>>>>> >>>>>>>>-.+<<<<<<<<<<<<<<<>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<>>>>>>>>>>>>>>++ .--<<<<<<<<<<<<<<>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<>>>>>>--.++<<<<<<.
    Offline

    3
    ReputationRep:
    (Original post by Tootles)
    20 years C and C++ experience, have designed and implemented (via simulation) my own instruction set over a weekend, and wrote a VT100 control library - over another weekend.

    Also a real programmer can parse code in any language, even ones they don't know, and can pick up new languages in less than a day.
    Not if it's extremely low level, ie. Assembly, or if it's like BrainF.

    As for your second statement, it really depends what language it is, and how different it is from their current language(s).
    Offline

    2
    ReputationRep:
    #include <iostream>
    using namespace std; //you might not like it written this way?
    int main ()
    {
    cout << "HELLO WORLD! What language do you think this is?";
    return 0; //I know that it's not necessary to do return 0 anymore
    }
    Offline

    3
    ReputationRep:
    Code:
    public abstract class Robot<T> where T:SpeechEngine
        {
          protected void Initialise(T engine){
              engine.Initialise();
              Console.Out.WriteLine("Initialising robot");
          }
        }
    
    
        public interface SpeechEngine {
             void Initialise();
        }
    
        public class AlexaVoice:SpeechEngine
        {
    
            public void Initialise()
            {
                Console.Out.WriteLine("Initialising Alexa speech engine");
            }
       }
    
        public class SiriVoice : SpeechEngine
        {
    
            public void Initialise()
            {
                Console.Out.WriteLine("Initialising Siri speech engine");
            }
        }
    
        public class MrRobot : Robot<SpeechEngine>
        {
            SpeechEngine voice;
    
            public MrRobot(SpeechEngine voiceArg){
                voice = voiceArg;
    
            }
    
            public void Greet()
            {
               Initialise(voice);
               Console.Out.WriteLine("Hello world");
            }
        }
    
    
        class Program
        {
    
            static void Main(string[] args)
            {
     
                MrRobot alexa = new MrRobot(new AlexaVoice());
                alexa.Greet();
    
                MrRobot siri = new MrRobot(new SiriVoice());
                siri.Greet();
                Console.ReadKey();
            }
        }
    Wonder if anyone can understand whats going on with this c# robot. Need to be sharp on your c# and OOP for this one.
    Maybe one for 57 as its using advanced language features.
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    I suppose I'll introduce myself for the fun of it, even though I'm a professional-level graduated programmer.

    I'm also (re-)teaching myself programming because it's been a few months ago I last programmed (at my internship corporation). Unless you are a gifted programming and logic genius (like my internship partner was), you need to constantly keep up your skills, or you will lose those skills almost entirely (like me). The IT industry is a lifelong learning one.

    Right now I'm busy studying something else that has more priority, but on my todo list is the following:

    - medium-advanced Java, C#, .NET technologies (there are a lot of those, including WCF, Web API,..)
    - communication languages such as XML, JSON
    - web frameworks such as KnockoutJS, Ember, AngularJS (even though that's a crappy language, there is a lot of demand for it on the IT market)

    My goal is to finally get rid of my medium-novice status and grow affinity for programming, even though inherently I don't understand logic (I'm an artist by heart). My biggest goal is to get a job with my skills. I just graduated from a Bachelors in Computer Science, but man have my skills weakened. I need to get back on the boat and start actively re-studying and re-practicing all of this.

    Stage I'm at: I'm probably a medium-advanced programmer, depending on how you look at it, like my professor said: "Computer scientist with great potential". I know most of the advanced things you can do with programming as well as software engineering: enterprise design patterns etc.

    Furthermore, I know too many technologies to sum up. I'll just list a few:

    - Java, C#, PL/SQL, SQL, C/AL, VB .NET, WebAPI, Entity framework, JSON, XML, HTML5, CSS3, JS, servlets, JSP, struts, AngularJS, Android, Spring, Hibernate, distributed systems

    If anyone has any programming problems concerning Java or C#, feel free to ask me for assistance.

    Happy learning!
    One thing i'd say looking at that list is don't spread yourself too thin.
    WCF or WebAPI.
    Entity VS Hibernate.
    Knockout,Angular,Ember

    All big technologies competing with eachother

    Don't try learn them all theres not enough time in the world and its a waste of time just pick one(obviously do your research so its an educated decision) Then learn the others as needed.
    Offline

    3
    (Original post by _gcx)
    Not if it's extremely low level, ie. Assembly, or if it's like BrainF.

    As for your second statement, it really depends what language it is, and how different it is from their current language(s).
    Most languages' syntax are ultimately derived from Algol through C or some such-which, so it isn't really a challenge.

    Except if it's PL/M. I think Kildall was on drugs.
    Offline

    2
    ReputationRep:
    (Original post by INTit)
    One thing i'd say looking at that list is don't spread yourself too thin.
    WCF or WebAPI.
    Entity VS Hibernate.
    Knockout,Angular,Ember

    All big technologies competing with eachother

    Don't try learn them all theres not enough time in the world and its a waste of time just pick one(obviously do your research so its an educated decision) Then learn the others as needed.
    I needed to be good at both of them to graduate because both Oracle and Microsoft are in my undergraduate program. That is of course logical, because universities want to bring value to the IT market and so, students have to be versatile in their baggage.

    If only it were that simple to make a choice. At my internship, there were projects with Angular, then we would be thrown on other projects with Knockout, and the story goes on.
    It's of course a fact that in the IT world you have to specialize, for there are many sub-specializations on offer.

    I don't really like programming, but I'm glad I have a good foundation.
    Offline

    2
    ReputationRep:
    Code:
    // Using a C# feature called 'generics' because you see the use of the type 'T' between the less than and greater than signs. The 'where' expression: this forces that a certain generic paramater T has to conform to something, in this case you can only pass in SpeechEngine types (where T is a type). This promotes less errors because you can't pass in the wrong type or call a wrong method.We want to make this class abstract so that you can't instantiate a Robot. We want the Robot class to contain the commonalities shared by its children classes.
    
               public abstract class Robot<T> where T:SpeechEngine
        {
          protected void Initialise(T engine){ // A generic and flexible Initialise() method. It's protected so that only child classes can call it.
              engine.Initialise(); // We call the Initialise() method of whatever SpeechEngine variety (type) was passed in. We see below that this prints out a SpeechEngine-specific text.
              Console.Out.WriteLine("Initialising robot";); // Whenever we call the Initialise(engine) method, "Initialising robot" will be printed to the console output.
          }
        }
    
    // Whatever uses the SpeechEngine interface, must have an Initialise() method. Again, this way you are promoting less errors (for example, forgetting to call that method, or giving it a different, non-standard name).
        public interface SpeechEngine {
             void Initialise();
        }
    
        public class AlexaVoice:SpeechEngine // An Alexa Voice is a Speech Engine
        {
    
            public void Initialise() // Mandatory implementation, therefore conformity and standardization. We are using the method that we got from the interface we inherited.
            {
                Console.Out.WriteLine("Initialising Alexa speech engine";);
            }
       }
    
        public class SiriVoice : SpeechEngine // The same goes for the Siri Voice
        {
    
            public void Initialise()
            {
                Console.Out.WriteLine("Initialising Siri speech engine";);
            }
        }
    
    // MrRobot is a Robot that has a SpeechEngine. Seeing MrRobot extends the Robot class (inherits it, and therefore inherits its members)  As you can see, MrRobot is the class we want to actually instantiate because it has no 'abstract' keyword restricting it from instantiation
        public class MrRobot : Robot<SpeechEngine>
        {
    // interface for polymorphism: which voice do we want? Conceptually, we are saying that a MrRobot robot has a speech engine that belongs to it (composition, like an engine belongs to a car). 
            SpeechEngine voice; 
    
            public MrRobot(SpeechEngine voiceArg){
    // When we create our MrRobot, we also give it a speech engine 
    voice = voiceArg; // Our robot will have the passed-in SpeechEngine variety so that it will greet us in that voice.
                voice = voiceArg; 
    
            }
    
            public void Greet()
            {
    // We call our SpeechEngine's Initialise(voice) method that we got through inheritance from our Robot class, who has access to the SpeechEngine's Initialise(T engine) method
               Initialise(voice);
               Console.Out.WriteLine("Hello world";);
            }
        }
    
    
        class Program // Our main program that will execute our logic that we put together
        {
    
            static void Main(string[] args) // The main entry point that will cause the compiler to locate it and execute our program
            {
     
                MrRobot alexa = new MrRobot(new AlexaVoice()); // We create a MrRobot that gets passed in a new AlexaVoice anonymous instance.
                alexa.Greet(); // We ask alexa, a MrRobot, to greet us with its AlexaVoice SpeechEngine
    
                MrRobot siri = new MrRobot(new SiriVoice()); // We do the same for the SiriVoice
                siri.Greet();
                Console.ReadKey(); // We read the next key that the user types into the console. This is a way to artificially pause a running program because the program waits until the user presses a key.
            }
        }
    I wrote my comments to the code in my quote above.

    Technically, what's going on here is ultimate flexibility by use of interfaces and generics and an added bonus of coding error prevention. Why generics? Because we want to let other developers specify for themselves what type our classes are going to be, but more importantly, because we don't want runtime errors due to incorrect casting/type boxing. For example, without generics, we would be forced to specify the type T at compile time: if we make a Robot of type string, the developers that would use our Robot class would have to cast each of our strings to integers, in the case they would want to use integers, but I'm getting too much into detail here.

    Basically, we created a general Robot class for a MrRobot class to inherit and we want it to not just be any robot, but we want it to have a Speech Engine, so that it can talk. We create two robots, Alexa and Siri, and we have them greet us, each with their own specialized greeting.

    I hope that's enough explanation for now.
    Happy coding.
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    So, from what I can read, your program is like this:

    1) You have a HelloWorld class with a main block that accepts commandline arguments. It prints "Hello, World" to System.out.

    2) You got into learning about classes and Object-Oriented programming and you made a Robot entity, that has a name, a constructor that takes a name and sets it as the Robot's name.

    Then you have a private method named 'speak' (denoting an action) that defines the Robot's behavior. Executing this method makes the Robot say whatever message was passed in as well as whatever name was passed into the constructor.

    The Robot is then responsible for its own execution, so a main method has been added. A new Robot instance named "r" called "debbie" is created, the speak method is executed upon that instance and the line "hey there! it's me..." is passed into it.A new Robot is created with instance name "b" and his name is "bob". His speak method is executed and the line "My name is..." is passed in.Consequently, the debbie robot will say "hey there! it's me...debbie" and the bob robot will say "My name is...bob".

    Furthermore, we see the use of Java's specialized I/O Scanner class from the Java util package. A Wheel class is defined with a radius attribute.A constructor is defined with one argument 'radius', which will define the Wheel's radius.A function called getCircumference returns a double with the outcome of the local calculation.A similar function getArea() is created.

    Then, the Wheel defines the main method, in which the program starts by asking the user to provide valid input. A Scanner will then be responsible for reading that input (as it reads what comes into System.in). A double is defined, representing whatever valid double was passed in by the user and this is then printed out to the user.

    Lastly, a Wheel instance named 'w' is created using this provided double. The Wheel's dimensions then get printed out using the calculations on that double.
    Correct 571. I today finished work on my latest project, which is more or less my own code, as opposed to those other three which were ready made progs. And It runs in drjava like a dream, with no runtime errors. However when i attempt to upload it to vocareum, it fails on all counts apart from style i think. So there is something wrong with either a, the code b, the layout c, the filename or d, my use of the input software. I am praying that the problem is d, and a simple system refresh, or other easy tweak will sort it out. But I have already submitted it twice, and got zero marks the first time, and only a couple on the second. Have a look at the program and see if you can spot any obvious factors which would cause it to fail the online mark scheme in this way, thanks!

    import java.util.Scanner;public class AboutMe { public static void main (String[] args) {Scanner s = new Scanner(System.in);System.out.pr int("What is your name?"; String myName=s.nextLine();System.out.p rint("What school do you attend?";String mySchool=s.nextLine(); System.out.print("How old are you?"; int myAge=s.nextInt(); System.out.println("My name is "+myName+", I attend "+mySchool+" and I am "+myAge+" years old.";String input = s.next();s.close(); }}

    http://pastebin.com/iVZGVs3h
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    Code:
    // Using a C# feature called 'generics' because you see the use of the type 'T' between the less than and greater than signs. The 'where' expression: this forces that a certain generic paramater T has to conform to something, in this case you can only pass in SpeechEngine types (where T is a type). This promotes less errors because you can't pass in the wrong type or call a wrong method.We want to make this class abstract so that you can't instantiate a Robot. We want the Robot class to contain the commonalities shared by its children classes.
    
               public abstract class Robot<T> where T:SpeechEngine
        {
          protected void Initialise(T engine){ // A generic and flexible Initialise() method. It's protected so that only child classes can call it.
              engine.Initialise(); // We call the Initialise() method of whatever SpeechEngine variety (type) was passed in. We see below that this prints out a SpeechEngine-specific text.
              Console.Out.WriteLine("Initialising robot";); // Whenever we call the Initialise(engine) method, "Initialising robot" will be printed to the console output.
          }
        }
    
    // Whatever uses the SpeechEngine interface, must have an Initialise() method. Again, this way you are promoting less errors (for example, forgetting to call that method, or giving it a different, non-standard name).
        public interface SpeechEngine {
             void Initialise();
        }
    
        public class AlexaVoice:SpeechEngine // An Alexa Voice is a Speech Engine
        {
    
            public void Initialise() // Mandatory implementation, therefore conformity and standardization. We are using the method that we got from the interface we inherited.
            {
                Console.Out.WriteLine("Initialising Alexa speech engine";);
            }
       }
    
        public class SiriVoice : SpeechEngine // The same goes for the Siri Voice
        {
    
            public void Initialise()
            {
                Console.Out.WriteLine("Initialising Siri speech engine";);
            }
        }
    
    // MrRobot is a Robot that has a SpeechEngine. Seeing MrRobot extends the Robot class (inherits it, and therefore inherits its members)  As you can see, MrRobot is the class we want to actually instantiate because it has no 'abstract' keyword restricting it from instantiation
        public class MrRobot : Robot<SpeechEngine>
        {
    // interface for polymorphism: which voice do we want? Conceptually, we are saying that a MrRobot robot has a speech engine that belongs to it (composition, like an engine belongs to a car). 
            SpeechEngine voice; 
    
            public MrRobot(SpeechEngine voiceArg){
    // When we create our MrRobot, we also give it a speech engine 
    voice = voiceArg; // Our robot will have the passed-in SpeechEngine variety so that it will greet us in that voice.
                voice = voiceArg; 
    
            }
    
            public void Greet()
            {
    // We call our SpeechEngine's Initialise(voice) method that we got through inheritance from our Robot class, who has access to the SpeechEngine's Initialise(T engine) method
               Initialise(voice);
               Console.Out.WriteLine("Hello world";);
            }
        }
    
    
        class Program // Our main program that will execute our logic that we put together
        {
    
            static void Main(string[] args) // The main entry point that will cause the compiler to locate it and execute our program
            {
     
                MrRobot alexa = new MrRobot(new AlexaVoice()); // We create a MrRobot that gets passed in a new AlexaVoice anonymous instance.
                alexa.Greet(); // We ask alexa, a MrRobot, to greet us with its AlexaVoice SpeechEngine
    
                MrRobot siri = new MrRobot(new SiriVoice()); // We do the same for the SiriVoice
                siri.Greet();
                Console.ReadKey(); // We read the next key that the user types into the console. This is a way to artificially pause a running program because the program waits until the user presses a key.
            }
        }
    I wrote my comments to the code in my quote above.

    Technically, what's going on here is ultimate flexibility by use of interfaces and generics and an added bonus of coding error prevention. Why generics? Because we want to let other developers specify for themselves what type our classes are going to be, but more importantly, because we don't want runtime errors due to incorrect casting/type boxing. For example, without generics, we would be forced to specify the type T at compile time: if we make a Robot of type string, the developers that would use our Robot class would have to cast each of our strings to integers, in the case they would want to use integers, but I'm getting too much into detail here.

    Basically, we created a general Robot class for a MrRobot class to inherit and we want it to not just be any robot, but we want it to have a Speech Engine, so that it can talk. We create two robots, Alexa and Siri, and we have them greet us, each with their own specialized greeting.

    I hope that's enough explanation for now.
    Happy coding.
    Can you tell me how to use pastebin correctly? I have located the site, and copied the code, but it just shows the url link, and not the actual code itself. What am i doing wrong??
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    Can you tell me how to use pastebin correctly? I have located the site, and copied the code, but it just shows the url link, and not the actual code itself. What am i doing wrong??
    I find it strange because you already posted a correct pastebin sample.
    I'm not sure what problem you are having. Could you tell me more? Maybe you already figured it out.

    As far as I know, you use pastebin like this:
    1) Go to http://pastebin.com/
    2) Click inside 'New paste', paste your code inside there
    3) Choose a particular syntax highlighting for your language
    4) Choose how long you want your post to be valid on the site (Expiration)
    5) Choose a title for your paste
    6) Click create new paste (you might be required to fill in some captcha first)
    Offline

    2
    ReputationRep:
    (Original post by Craghyrax)
    How well does javascript prepare you for other kinds of programming?
    Javascript (scripting; i.e. writing interpreted code to run inside a single execution engine such as a browser or a NodeJS instance) prepares you for other kinds of programming (i.e. writing compiled code) in the sense that it lets you first play with basic programming concepts first such as loops, conditions, variables in memory, control structures,.. and so on, before you move on to more difficult concepts such as Objected-Oriented Programming. Once you have those simple constructs down, you can move to a programming language; it's a way to ease yourself into programming, but it's only a choice. For example, I started with Java; I read a book from A to Z, I read my syllabus and I used the javadocs. I also had a look at the conceptual overview.
    Simon Allardice gives a short explanation on it, here.

    n.b.: Javascript works internally very different from Java, so if you get crazy (arithmetic) results, don't be too surprised. The language itself was written in a couple of days.

    As for the question 'how well' it prepares you: it prepares you for basic programming concepts. For more advanced concepts, you'll need to use a programming language.
    Offline

    2
    ReputationRep:
    It's been a while for me since I used the Scanner class, but I compiled and ran your code and I received no errors. Line 17 might be redundant, as you tell the Java compiler to wait for input before it closes the program, but you aren't further expecting any input, but maybe you just wanted the program to pause. I just typed in some random character followed by enter and the program closed as expected.

    Did you compile and run the code already?

    n.b.: the file name of your program has to be AboutMe.java
 
 
 
Write a reply… Reply
Submit reply

Register

Thanks for posting! You just need to create an account in order to submit the post
  1. this can't be left blank
    that username has been taken, please choose another Forgotten your password?
  2. this can't be left blank
    this email is already registered. Forgotten your password?
  3. this can't be left blank

    6 characters or longer with both numbers and letters is safer

  4. this can't be left empty
    your full birthday is required
  1. Oops, you need to agree to our Ts&Cs to register
  2. Slide to join now Processing…

Updated: November 25, 2016
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Today on TSR
Poll
Would you rather have...?
Useful resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Quick reply
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.