Programming Curriculum
This is a lesson plan developed by a team alumnus to teach anyone the fundamentals of programming they will need for FRC (FIRST Robotics Competition). We start with the basic Programming concepts and include projects to do on FRC robots with links to our team's corresponding GitHub code and projects for local programs. For a thorough introduction to Java please visit and register with the Edhesive AP Computer Science A course online. It's free and a great resource for learning Java.
Introduction to ProgrammingProgramming is a way to communicate your logic and apply it to a task through a computer or robot. Programming might seem intimidating at first because it's like learning a language. However, it is very similar to English or abbreviated English; if code is written well and has plenty of variables you can get the gist of what it's doing without knowing programming. The most important thing for learning programming is to take it in small pieces and that's what We'll try to do. We'll build slowly, the basic thinking and tools to program like learning the words of a language. Later on, we'll build upon our knowledge and do more complex tasks, like making sentences from our new found vocabulary!
|
Introduction to VariablesBuilding on the programming concept "we get information and do something with it!" we are going to store information. In programming you store information in variables. Variables are extremely helpful because they make code more easily changeable and readable. You'll enjoy them because they basically read like English and so their meaning or what they are doing becomes a lot clearer. Variables in Java, unlike in JavaScript which you'll see, have types; certain kinds of variables need to be stored in certain kinds of variable types, but we won't concern ourselves with that until the next lesson. For now we just want to give you a thorough introduction to variables as a concept.
|
Numerical DatatypesVariables have types. Today we are going to learn about the most fundamental numerical datatypes in Java - int and double The int datatype stores whole numbers (integers) and can store negative, positive, or 0 values. The double datatype stores numbers with a decimal or fraction such as 2.76 or 568.89. A good real life example of a double value you might store is an approximation of pi (3.14), a proportionality constant relating the diameter to the circumference of a circle.
You can convert between integer variables and double variables and there are some useful things you can do with this, but there are some subtleties you need to be aware of when doing this which we will cover. |
Text DatatypesHumans like speaking and naming things! Therefore there are text data types. The "char" datatype can store a single keyboard character or an escape character. The "String" datatype can store multiple characters such as an entire word, phrase, paragraph, or document (if you wanted). Working with these datatypes and making variables of them is essential in Java for making cool programs so get to it!
|
Console PrintingNow we begin writing programs. Now that you now how to store information in variables we can perform operations on those variables and output them to a user. This is what your calculator does. Your calculator is probably made by Texas Instruments, a company worth 59.5 billion dollars. This simple concept of storing information and performing operations on it and outputting it for a user is the basis of many of the programs you will write - so pay attention!
|