Ask Slashdot: Good Introductory SW Engineering Projects? (HS Level)
New submitter mtapman writes: I'm looking for suggestions on introductory software engineering projects for a high school level student. Assume the student can do basic math (up through Algebra I or Statistics I) but is new to logic and computer science. Each project should take no more than four hours to complete including research, coding, and testing. The intent is to introduce the student to software engineering (and computer science) through practical and fun examples. Classic CS problems are welcome. One of the key criteria is available research/reference material to allow the student to make progress with 30-60 minutes of online research.
Some ideas that came to my mind (not necessarily good ones) are: (1) pick a sorting algorithm and sort a list of ten words alphabetically, (2) write a program to convert characters from lower to upper case, (3) write a program to divide two numbers in two different programming languages and compare the results to determine the differences between the languages.
Some ideas that came to my mind (not necessarily good ones) are: (1) pick a sorting algorithm and sort a list of ten words alphabetically, (2) write a program to convert characters from lower to upper case, (3) write a program to divide two numbers in two different programming languages and compare the results to determine the differences between the languages.
Wrong question. You're just trying to drive down the wages of software jobs.
Sincerely,
Slashdot Consensus
It's a simple board game that can be done in less than an hour if prapared for, of course they can do a lot of extra if they got the talent/time.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion. -- Spazmania (174582)
How about https://projecteuler.net/? They have a ton of problems.
Don't reinvent the wheel. Look for teacher forums where you'll find CS teachers who have found certain exercises are really great teaching exercises. Call other CS teachers at peer schools or schools that are a little better than yours. (You can also go to really great schools, but depending on where you're teaching may have to simplify a bit). Email teacher lists.
The examples most slashdotters think of may be good, but haven't been field-tested in the same way.
Sorting may be interesting to you, but it's dry and rather abstract. If you are working in Java or python, graphics is available, and graphical projects are far more interesting to the average high school student. Animation of any kind (processing is ideal) 3d animation (spinning globe, 14 lines in processing) 2d board games (checkers). Note you are creating a board that only allows legal moves, not playing. Earth-moon-sun system (for those captivated by the spinning globe. You can do more mathematics if students like it. For example primes. Tying it to graphics, the prime number spiral: http://mathworld.wolfram.com/P... http://adastraeducation.org/Pr...
Sorting algorithms are the old staple for a reason, they are generally pretty simple and get the kids thinking about how the data is actually manipulated. Do you need a scratch copy of the entire list or just a buffer of 2 elements? is method X faster than method Y? is this always true? What are the time / memory trade-offs and would this algorithm be suited to a very large data set?
Id be tempted to give them a large data-set to work with an get them to race their algorithms without explicitly walking them through the various flavors of sorting, there will always be 1 kid who already knows what a bubble sort is, but the rest of them can try and work it out on their own.
Here's an idea: Interview five of your classmates about their dream holiday. Write the requirements for a perfect holiday in a form of well-structured essay, identify the commonalities and points of variability, identify and evaluate risks, constraints, and surrounding issues. Abstract and make note of the general themes of the holidays and prioritize the characteristics of the ultimate holiday. Describe an ultimate holiday, and present it to your classmates for critique and comments.
Take a look at CipherSaber.org. It's a simple encryption system based on RC4 that should be possible to write and test in four hours. Learning the basics of cryptography is worth while these days even for beginners. And sending encrypted messages to each other would be more fun than sorting.
I suggest that you keep things simple but useful. I think that regex (don't kill me yet) is useful as a tool to get the students thinking in new ways and open their mind to data collection.
I suggest you use Benford's law (https://en.wikipedia.org/wiki/Benford%27s_law) as an inspiration to statistics and you get your students to collect Annual Reports or whatever random text they can find that have a lot of numbers in them. The goal is to find all numbers and then group the numbers according to the first digit and see if it matches what Benford predicts.
One way to do it is to copy the text to an online regex-editor (https://regex101.com/) and find out how to separate numbers from the text. Then, how to order the numbers and to count them. Finally how to plot them.
It's also fairly easy to do this kind of processing with a simple computer program so your students may have totally different approaches which is good when they present their work.
I suggest you have a default text that they should process in order to verify their algorithm
Do you want to get the student interested in programming or do you want to show what freshman CS students have to put up with? Because I think these are two pairs of shoes, and personally I would get bored after doing even just one sorting or text conversion problem. My suggestion would be to choose something that has a nice visual result, either directly on the command line or after visualizing it with something like gnuplot/matplotlib. One of my favorite "beginner's problems" for potential research assistants with little to no programming experience is to code up a simple diffusion-limited aggregation simulation (https://en.wikipedia.org/wiki/Diffusion-limited_aggregation). The algorithms are simple (less than 100 lines of Python), there is plenty of documentation around, and the results are nice to look at.
Given your requirement regarding online research, the question should be:
"Search the internet for a classic computer science exam or job interview question, then find a matching answer on Stack Overflow. (Bonus points will be awarded if the answer you find is correct)."
The ideas suggested are really dull - has the world really not moved on in 30 years?
I'd suggest tasks that incorporate *real data* from the *real world*. Read a thermometer, get the weather from yahoo's api, or calculate exchange rates using live data: real world problems that are relevant and engaging.
Hello World. In Java. That should put him off CS for good.
Pong. It is a great fun little game that is simple to program. It is easy to expand on once the initial simple game is created.
Sounds like something that Code Kata were designed for.
Decent list of them can be found http://codingdojo.org/cgi-bin/...
portfolio
There will be students who are hungry to learn all they can about programming, those who are slightly interested but will become either the former, or, more commonly by far, students who will never use computers for more than facebook no matter WHAT you attempt to teach them. Without that kind of passion, they really can't fit into the world of future software developers. Maybe code monkeys, but that's not really a career path... Especially if they haven't really shown interest before say, age 10.
I know that this is kind of politically incorrect to say in Slashdot, but Channel 9 has great series of tutorials in beginning programming UWP apps. Instead of tinkering with crusty old algorithms, that could be a fresh platform for the kid to get into the real-life business.
Is LOGO dead? It once was the perfect introductory language. Now get off my lawn!
Chaos maximizes locally around me.
An init system that's just an init system - not 97 other unrelated things.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
I hate to break it to you, but the millennium falcon is not real. (I guess that is what you mean by "Star Wars Engineering project - Han Solo level")
I think doing sorting algorithms, math problems and string manipulation hardly counts as "fun" when it comes to programming. Rather get them to do some ascii animations (walk, wave, punch methods), ascci men, ascci dogs and birds etc. What about simplistic clones of zork? (lots of if else logic, multidimensional arrays perhaps). I have found that to get students (at least younger ones) interested in programming staying away from the more formal cs examples is the way to go. Doing these more challenging game like projects, although slightly harder will eventually incorporate the more formal sorting, searching, string manipulation excercises into them anyway without them being the actual focus. They will be so distracted in that they are making a small game, they wont even notice their learning the formal stuff.
Right a program that calculates gross pay, federal, state social security, and Medicare deductions, and net pay. Extra credit for handling exemptions and filing status. Teaches basic logic for the tax tables, how the tax system works (good life skill), and how to take input and produce output. Can be done in any language, too...
I print, therefore I am.
You don't go into an intro woodshop class and hand the students physics exercises. Why would you intro computer engineering by throwing dry computer science at them? Are you trying to chase good kids away from computing professions??
The biggest mistake educators make with computers has been thinking they have piss all to do with math or science. Sure, at a fundamental level they aren't about anything else. But at a fundamental level my morning omelet is all about particle physics, so yah. :/
The reality is day to day software engineering has massively more in common with shop classes and "maker skills" than it ever does with math or "science". Just like most machinists are just trying to cut and weld steel into things rather than invent a new alloy, most software engineers are just trying to cut and paste code into new program shapes rather than invent a slightly more efficient sort algorithm. Sure, there's a teeny, tiny minority of egg heads doing amazing work on graphic card drivers to make my FPS better in Fallout 4, and I'm very grateful we have them, but the other 99.89% of programming in the world isn't anything so deep.
If you want to jump start kids on software engineering, buy a few cheap Arduinos, LEDs, maybe a few servos, and go nuts. The first for loop that makes an LED blink or a servo wave and they'll be hooked for life...not to mention learn more about actual software engineering then you'd ever have done with the comp sci/math tactic.
My
That taught BASIC, Ada, Pascal.
They have a lot of simple intro projects that dont need some "company" CS web gui, movie set branding or intro movies to show what fun their movie themed gui is.
Re 'write a program to divide two numbers in two different programming languages and compare the results to determine the differences between the languages."
That might just result in seeing something done in 4 lines vs 8 lines or the use of english words in code. A discussion about the amount typing, why english was used... why it was done like that in the past, what is been done now.. what company they know uses what language this decade and why...
Show the origins of other languages, history eg Ada, C, BASIC but then teach and show one language to a good standard.
Domestic spying is now "Benign Information Gathering"
and everything that we usually do IRL that involves computation. For the logic part, try alarm system.
This is a *programming* intro project. SwE projects are hardly shorter than a month of work. Anyway, this "code kata" is excellent to learn 'if then else' constructs, integral division and modulo operator. Cheers
Two areas that I have found not properly covered in most school projects—handling inappropriate input and errors and reading and writing from a file.
I suggest you have them design an input form that can handle incorrect and excess input and write the form data to a file. Make sure they are ready to handle malicious input.
The form should not be long, it should include a field that is numbers only, a field with limited alphanumeric entry (such as M/F or A/B/C or 1/2/3 etc) with code to manage incorrect hits. They need one long field that allows for a greater length in the entry field than the length allowable in the file, this means they may need to manage a means of reducing the input to write to the file while retaining the substance and meaning.
They also need to handle garbage entry, such as a name field with just a bunch of letter strung together at random.
There should be an e-mail address field with appropriate checks to determine if the entry is garbage.
Almost every program will require reading and writing to a file and every program requires some form of error handling. Most software engineering classes I have ever been involved in have not done well in these areas.
Pick up a copy of "Oh Pascal!" and then present the introductory problems to the students to solve in the language of your choice. It is a good introductory textbook irrespective of language.
(1) pick a sorting algorithm and sort a list of ten words alphabetically
Why limit yourself to 10? The difference, on a modern computer, between n^2 and n log n will not show up with that few. If you are going to make them write sort programs, make them sort arbitrary input. Then when they feel confident about their code ask them to sort 10000 words.
Teaching sorting help to better appreciate the quality of good algorithm, and there is nothing better for that than seeing your 'perfectly fine' stupidsort() never returning because the data is so large.
If they seem more of a hobbyist, I would give them a VB.NET cookbook and a copy of the express IDE. The reason why is that VB.NET will hold their hand and that will lead to one of two outcomes if they're the type that is at least warm to the field: either they'll get sick of that hand holding and want something better or they'll realize it's just a tool for them. In the latter case, don't worry. They may go into a field where programming is a supporting skill, but not something they need to be good at on a serious level to succeed.
If they seem a lot more serious, I'd choose Groovy. WHT, you're probably thinking. Groovy? Here's why:
1. Groovy has many of the advantages of Python and Ruby in terms of rapid feedback and coding cycle.
2. Groovy can effortlessly move between a simple scripting language and a full Java replacement.
3. Groovy has a mature tool chain in IntelliJ, Gradle and Maven for serious work later.
4. Groovy occupies a really interesting niche that makes learning Java, JavaScript and Ruby later really, really fast for a beginner.
Project #1: Using the language of choice develop a program to shuffle a deck of cards in the most efficient manner while maintaining a high confidence of random draws. Bonus: Build this program as a library that can be used by later projects to expand their functionality. Project #X: Create a program to utilize your shuffle library that will adequately replicate an existing single player card game. (Solitaire) Continue to build from there until you have a working online casino .. ok.. well maybe not that last part.
-Casey
You're right, this has nothing to do with computer science. But it's not software engineering either, merely programming. Just like making a birdhouse in the woodshop is neither physics nor mechanical engineering, but merely woodwork.
High school students should know what a prime number is. Find all prime numbers from 2 to 1000 could be a fun, little problem. A quick research, and the student will find the sieve of Eratosthenes (https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) and implement it.
In HS, finding the two primes that add up to an even number was the most memorable assignment. The teacher had a bet that anyone who could write a faster program than his would get a prize ... but his was always faster for any number over a million or so. It wasn't until the next semester that I figured out that the key was to only loop until the square root of a factor before deciding it was prime.
Four hours? Above all, programming is about perseverance. Array sorting? Boring. Programming Conway's game of life with text output is a fun array exercise. Root finding using Newton's or secant method. Extra credit for programming Mead and Nelder's algorithm for finding extrema. Makes a nice plot too. Finding statistical moments of data. I recommend using Scheme.
It might be a question of semantics, but you ask for a software engineering project for someone with no real programming experience. I would say that software engineering is far broader than just programming. Start with coding projects and move on to the larger/harder discipline of software engineering. Walk before running, and all that
I've done this several times and a key point in nurturing interest over disdain in students is to place some additional, personalized learning in the project. If the student has a mathematical bent, I usually assign a Monte Carlo simullation of pi. It is amazing to see random "dart throws" and an easy calculation converging to pi, and it lends itself to a quick drawing, followed by a quick outline, followed by pseudo code, followed by short coding -- and it usually requires simple debugging to work out whether you need to use "" or "=". If the student is a tactile learner, find a device project like a Mindstorm kit, so they end up with a physical object to touch and control. And who doesn't need a little self-driving dump truck to distribute handouts up and down the rows? If they are artistic, perhaps explore pixel edge detection to create a line drawing from a photo. They will come away with keen insight into how images are stored and displayed. The key is that they use coding to DO SOMETHING THAT THEY PERSONALLY FIND VALUABLE. If you don't do this, then it will be just like forcing them to memorize the multiplication tables or diagramming sentences. Most students aren't inspired to go back to those particular assignments on their own. Our goal is to build internal interest so they will become life-long learners. One more thing I have done in small classes is to do a team project. (I did one with TI calculators.) you can negotiate who gets what subroutine and do all the preliminary teaching and organizing on the whiteboard and then turn the subroutines over to the students. When they transfer all the subroutines between themselves and see it all run, they feel like they have really done something, since the teacher didn't GIVE it to them. They also have to learn to aggressively test individually and then to debug as a team.
They are good exercises.
They're copypasta programming.
One of my favorite exercises to give students at that level is to hand them a MUD codebase and ask them to make some simple modifications. As a "software engineering" rather than a pure "programming" exercise, it's a fun example of something with a good bit of architectural complexity that can nevertheless be broken up into small chunks that make sense for entry level students - and who doesn't like games?
For simple procedural stuff, do exercises off of Project Euler.
Then move on to games. These can start simple, for example, writing a poker or blackjack program that runs in the console. Then move up to simple graphical games. Put together a simple framework they can use, to get them started. Or take an existing framework, but it's really better to roll your own: it will be a lot smaller, because it is focused on the exercises you want to do, and you will understand it better as well.
Enjoy life! This is not a dress rehearsal.
POP3 is a simple, basic email download protocol. Shouldn't take more than a few hours to write one from scratch. The specs are easiky available, and will serve as a good introduction to writing free software based on Internet standards.
Why limit yourself to 10? The difference, on a modern computer, between n^2 and n log n will not show up with that few.
Because with that few, you can step through the program from beginning to end, even on paper. A much better chance to find out why something goes wrong, and not just that it crashed or produced wrong results.
If you are going to make them write sort programs, make them sort arbitrary input.
No. Two point six times no. Real life data is not arbitrary. Different search functions work with different efficiency for different data.
Preface: I'm a mechanical engineer by trade. I went back and decided to audit some of my undergraduate classes to refresh my memory I realized there aren't any good 'toolboxes' for any of those classes. AeroPython is a good graduate level class for Aerodynamics-Hydrodynamics with Python but there's nothing more basic.
Last night I decided to cram Kindergarten -> Statics into one module just so that I could build on top of it for Mechanics of Materials.
It is in no way complete but it served a purpose, here's just an excerpt from what I threw together:
class Shape2D(object):
def __init__(self,area=None,perimeter=None):
self.area=area
self.perimeter=perimeter
class Circle(Shape2D):
# This could be a lot cleaner, but it works.
def __init__(self,diameter=None,radius=None,area=None,circumference=None):
# By doing this, we can define these as symbolic in the future.
# aka, solve for the unknown.
d, r, A, c = sympy.symbols("d r A c")
circ_eqn1=sympy.Eq(2*r,d)
circ_eqn2=sympy.Eq(pi*r**2,A)
circ_eqn3=sympy.Eq(2*pi*r,c)
if diameter is not None:
self.diameter=diameter
self.radius=sympy.solve(circ_eqn1.subs(d,diameter),r)[0]
self.area=sympy.solve(circ_eqn2.subs(r,self.radius),A)[0]
self.circumference=sympy.solve(circ_eqn3.subs(r,self.radius),c)[0]
return
@property
def I_0(self):
return 1/4*pi*self.radius**4
However going forward I can define a circle and use it in anything I need. I can add a length and make it a tube. Revolve it and make it a sphere.
Don't teach them something completely foreign, have them make a module/class for something they know rather well and then as step 2 'automate' something about it, make it programmatic.
There is very little of interest or educational value that can be done in 4 hours and what does exist is pretty much guaranteed to put a student off to software development as much as similarly-geared math courses. Your best bet would be to architect something that could be done in a quarter by a professional and drag it out over the course of a semester or year. Pick a project they would immediately understand the value in (an IM client/server application for instance) and then break it down into pieces they can understand and follow along with. If you do it well they should get sucked into it any everyone with the aptitude for software development in the class will likely finish within a month or two while spending the rest of the time polishing it off or adding neat features. Maybe even pick multiple projects and let students pick whichever they are most interested in.
Code doesn't translate well to strict coursework, that's why pretty much all CS majors suck at it and quality software engineers tend to be self-taught. The trick is inspiring them to spend all night for several nights fiddling with things until they work, but being careful not to force it and drive them away.
First off, stop calling this software engineering, because it isn't. No more than a potato gun is rocket science.
This is an into computer programming assignment, but it sure as hell isn't engineering, and it sure isn't "software engineering".
Engineering is a discipline, and involves far more complexity than what you're describing. In many places it's also a licensed profession like "doctor" where you can't just slap engineer on your title.
Don't do yourself or your students the disservice of going around saying "yarg, I'm teaching teh software engineering". There's enough self-aggrandizing titles in the industry as it is without pretending a high school "learn to code" project is anything resembling "engineering".
Lost at C:>. Found at C.
Don't oversell what you're doing as "introductory software engineering". If your students are high school level and "new to logic and computer science" then what you should be doing is teaching them an introduction to programming. That is a fine and worthy goal right there. Software engineering is usually a college-level subject or even a degree in itself, teaching already-capable programmers how to design and build complex and robust real-world systems; much of the material revolves not around programming at all but SDLC process and other things that will be irrelevant (and boring) to computer-naive high schoolers. Not to be too precious about it, but the terminology matters; would you advertise an introductory high-school physics course on friction and statics as an "introductory civil engineering"?
Create a deck of cards, shuffle it, deal a hand of poker adn determine what hand it is.
Don't blame me, I voted for Kodos
While you might be trying to make the course sound cool calling this Software Engineering is totally inappropriate. If you teach a person to apply a bandaid it isn't introductory medicine its first aid. Engineering is a licensed profession with regulatory bodies and legal responsibilities and entails a much higher level of training than the programming equivalent of adding two numbers together.
Sorting algorithms are boring. Get a couple of Raspberry Pi. Introduce them to Python scripts (10 lines of code first) and GPIOs for LED blinking. Then maybe display stuff on a cheap 16x2 LCD. For less than $100, then will get the idea, and perhaps have a kick to it, and want to do more.
Arduino/Teensy or similar cheap micro that has easy interfaces to simple devices.
Then, a problem like making change in a vending machine. Buttons for 1,5,10 cents in, Blinky lights for what gets fed back (1,5,10)
there's a lot of different ways to solve the underlying problem (state machines, outright calculation, etc.)
There's also opportunity to make abstracted classes/modules for the interfaces (GetMoneyDeposited(), ReturnChange())
As others have noted, some sort of source code repository is nice. But realistically, for a single 4 hour class, it seems a bit overkill.
Whatever the exercise there must be something to physically take away, and perhaps titivate later.
'Draw a graph' might start with rows of stars bashed out on a teletype... which then needs !'s for the horizontal scale and +'s for the vertical scale... and then the scales may need to be scale to fit the data. Of course by now you're drawing symbols on a pixel map then converting it to a matrix printer. Then instead of a fixed X axis you move to X-Y (or scatter) on a virtual drawing surface that gets expressed on a laser printer.
(I put the teletype in there for fun, but there are plenty of tech limitations around today.)
I'm a bit worried about the 'go and research it' bit. I'm all for 'use the internet to help crack specific problems, steal code etc.' but it's your job to be right with them while they're trying to get their ideas together and then to work. When they're floundering you've got to show them the way so they can move on.
This circuit is really cheap and easy to build. I've built it twice now, and even with Radio Shack last minute trips for parts I'd forgotten, it was still cheap.
http://www.swharden.com/blog/2013-04-14-simple-diy-ecg-pulse-oximeter-version-2/
The circuit doesn't take long to make using a breadboard - no soldering required. There's a parts list on the site.
For the Python grapher, I think I used pygame to get a context to do graphics. I can't remember what API I used for sound card input. Basically, I polled the sound card mic port as often as I could - each time I asked the sound card for the mic value, it's giving the voltage between electrodes (which are pennies). This gives you the heartbeat or muscle firings, etc, whatever it is you have the pennies on (you'll put them on the surface of your skin for instance). Don't worry - if you're using 3 AA batteries, there's very little power in the system to shock you - the circuit is using an op-amp to amplify tiny variances in voltage at the skin's surface.
For the chart, I just made a dot for every voltage value given from the sound card (y being the vertical axis representing the voltage value, and x being the time). Each time I got a new value, I moved all the other dots one x to the left, so I had a scrolling graph. Writing the Python code took me longer than the circuit and was more intellectually challenging (not much, Python is really easy to code in).
A number of fairly simple mathematical problems lend themselves also to visual representation, which many find appealing. For instance, start with building Pascal's triangle, then display it as an image by choosing some way to map numbers to colors. Once you've done this, similarly visualize the triangle modulus some different integers - as shown here: http://code.jsoftware.com/wiki... . Doing this while extending the triangle to very high numbers can lead to discussions about the limitations of floating-point representation and other topics.
Another project that can start simply and become as complex as you want to make it is something like diffusion-limited aggregation - https://en.wikipedia.org/wiki/... - which also lends itself well to visualization and requires non-trivial array-handling.
Of course, the calculation and display of the Mandelbrot set also lends itself to any number of enhancements.
Build a simple cashier GUI for a fast food restaurant, try VB.NET to make it easier for a first timer. Or build the GUI for them. Labeled buttons, colour coded sections, textbox display of price...etc. If you have a touchscreen available, use it.
This was my final project in HS. It was a brilliant "aha!" moment when I really saw how this could be used in the real world.
I remember one I had in HS that I enjoyed, a program to convert an arbitrary number in one number base to another (Base ten to octal, binary to hex, base7 to base 12, etc). I remember the program itself is actually fairly small and simple, though does need some complex math. Source code is also fairly easy to find on Yahoo/Google.
Takes the mystery of how the shell and c interact.
More complicated things like a sort have algorithms.
The other way is a single board computer which gives wire wiggling capability.
Arduino, RasPi, etc come to mind.
Starting with a running, useful system like a QuadCopter controller and tweaking it is another possibility to keep the more advanced folks interested if they don't want to teach the rest of the class for you.
First off: avoid the algorithm and math problems. The one or two geeks in the class will love them, the rest of the class will be turned off from programming for the rest of their lives. I have a Ph.D. in CS and still hate those types of problems (ok, I have a love/hate relationship with those types of problems - i love them, but hate using them for pedagogical purposes).
That said, the single best intro to programming/software engineering project I had was a graphics programming project when we barely knew how to program. Our professor gave us a small library that had functions like "create_window()", "draw_rect()", "clear_screen()", "get_input()" and had us do a series of exercises that put objects on the screen, moved them around, and then refactored into our own graphics library. Some of the more advanced students made simple games.
From a software engineering perspective, this taught a number of important lessons early on:
- Code reuse/trusting third party code (we had a library for the complex stuff - if you can stop NIH syndrome before it starts, you've already won) ;) )
- User interfaces (we had to get some input from the user to decide what to draw)
- Event loops (software does not live in a vacuum, despite what the functional guys want you to believe
- Debugging/iterative development (no one's project worked the first time)
- Teamwork (do this as a team, have different members write different parts to learn how to interface with other programmers... save pair programming for later)
- Refactoring/code organization (how to recognize when you've wrote the same code for each shape and move that into a function)
- That you can do cool looking things easily with software (never underestimate the power of a graphics to get people excited about computers)
This was in 1992, so we used X windows on Sparc stations and wrote everything in C.
In 2016, here's how I'd do the same project:
- Use (simple) Javascript (get over any biases you might have)
- Stick with simple functions and introduce hash tables/dicts as a general purpose container. Don't do objects (esp in JS, since there are too many ways to do them)
- Provide a library that creates an SVG canvas (use this as the graphics area)
- Create a few related elements like a text box or buttons for controls and user input, but do this via your library
- Have a mechanism for callbacks/closures (don't tell them what they are yet and lose them, just show them how to use them)
- Do it entirely in the browser with a simple text editor (this is a development environment everyone has on their computer already, IDEs are a course on their own)
- Have some exercises that use the interactive developer interpreter
- For the advanced students, give them a library call for loading remote data and have them change their graphics in response to it
In addition to the stuff we learned, this also:
- Introduces the browser as a development/rapid prototyping platform
- Gives students a basic idea of how web content gets made
- Teaches some basic networking
- Gives the advanced students a platform to get creative with
Good luck!
-Chris
Don't be afraid to challenge them. One of the most important aspects of programming and life in general is to learn how to fail and persevere, iterate until you get it right.
So stuff like: (2) write a program to convert characters from lower to upper case is not quite enough. [foostring.upper()]
Make them write their own utilities. Stuff like 'write a program to find and eliminate duplicate files in a directory.', 'write a program to scrape a web page for a specific piece of info', etc. Stuff that will teach them loops, file I/O, basic OS file operations, string comparisons, etc.
And make them do it in Python.
If there is one discipline to serve as a common root for the fundamentally different learning experiences of "computer science" and "software engineering" in the sense that is meant in the posts above, regular expressions. Regular expression syntax is absolutely not object-oriented and does not share any resemblance to natural human language, which makes the experience more like dealing with individual bits and numbers as in computer science, but still abstract and relatively informal. Regex may be the most widely applicable scripting skill to have. A finely crafted regex exercise could segway nicely into a computer science exercise working with datagrams.
Have the students write a paper on the difference between Computer Science and Software Engineering.
the growth in cynicism and rebellion has not been without cause
I had a lot of fun with this over the holiday season: http://adventofcode.com
It's twenty-five simple but interesting programming challenges. Day 1 is a simple "count the number of open and close parentheses in a string." Later days include "generate MD5 hashes until you find one that starts with five zeroes," "generate 50 iterations of Conway's Game of Life," "solve a Traveling Salesman problem for Santa," and even "simulate an RPG and find the best strategy for beating the boss." Each day has two parts; solve the first to unlock the second. Several of the challenges involved recursion, but in general they cover wide ground. Some people solved both parts within five minutes of each day's puzzle becoming available, but for those of us who didn't care about the leaderboard, an hour's work was usually plenty to get it done. (Students without experience would take a bit longer.) Also, the input for each day's challenge was different for each user - there were probably only a handful of possibilities, but it meant that you couldn't always just copy someone else's answers without doing the work yourself.
I think you'll find a lot of great material here. Pick a few of the days to explore with your students; teach them how a software engineer would attack the problem. Try solving it with different languages and compare how each language would do it. Demonstrate how you could optimize code to find the solution faster (especially in the "Game of Life" and "Look and Say" challenges).
Also, there was a great Reddit community that shared solutions in various languages, and lots of people put their code on GitHub. Some people played "code golf" and came up with amazingly terse solutions. I used the Advent of Code to teach myself Swift (my solutions are at https://github.com/bskendig/advent-of-code); my code was more verbose than it should have been but I usually solved each problem in fewer than 100 lines.
How about that? Just call in an external library and use Python, make a program to select frequency.
"SW Engineering Projects? (HS Level)"
Star Wars projects? Han Solo level?
CS - Captain Solo? Chancellor Supreme? Cade Skywalker? Cham Syndulla?
games are always better for teaching. have them program mastermind, and other real-world logic-based games. They'll learn the logic of programming from the logic of reality.
Then get the kid to have fun modding games and learning through that.
Get them to program a virus that will disable the shields of an invading army of aliens by planting it in the mothership. Jeff Goldblum did it in something like 15 minutes.
Look if you're going to start out you really need to introduce them to Boolean logic first and foremost. That is your lifeblood in computer science. Start with the basics - true/false, if/else then go to simple compound statements with or/and/xor/nand and show them basic truth tables for evaluating them. From there you can build out. And you should have them working on very simple projects.
If this is in a classroom environment where they will be doing actual homework and such your entire first week will be devoted to getting them to set up a basic build environment and have them do simple I/O. They needn't understand all the ins and outs, but they should be able, after one week, to build a simple "Hello World!" program that asks for input from the keyboard and prints the results back to the screen.
After Boolean logic you can start branching out. A really good goal to work towards is having them build out a text-based "Connect-4" style game. This gives them something they can actually show off and lets you build incrementally on a wide swath of programming topics. Start with loops - like how would you print out a row of empty squares on the command line? Then expand that to nested loops - how would you print out a 2d game board of empty squares? Now they can get an introduction into states - is it red's turn, black's turn, or is the game over? How do we keep track of which squares have a red or black piece in them? Oh wait, it has to occupy the lowest square on the board, how do you think we could do that? Now how and when do we check for a game over condition?
You can work collaboratively on the Connect-4 project with them throughout the semester as a teaching tool and assign side projects highlighting the topics you want them to learn along the way. For their individual final project you could have them make a Tic-Tac-Toe text-based game.
Depending on how fast they progress you could move on to more advanced topics - like showing them how to do a Depth First Search on the Connect-4 board to check for connected chains, modifying the Connect-4 game to be of arbitrary size/shape/connections for a win, and maybe some lessons on Object Oriented Programming by abstracting the game into its own class. Or maybe even introduce them to graphics programming by starting to make a graphical version of Connect-4 using the text engine as a base (the background structures are identical, all that really changes is how you draw the gameboard and how input is done).
And if you decide to show them sorting the best thing I can recommend is start with all the cards from one suit in a deck of cards. Then demonstrate how various sorting algorithms go about sorting. Remember - human sorting is typically a variation on insertion sort, that one will probably make the most intuitive sense to them, even though bubble/selection is easier to code up. This works well even transitioning into n*log(n) algorithms because you can at least visually show them the heap structure in heapsort and how it heapifies, the split buckets and merge process in merge sort, or the pivoting and splitting in quicksort. And don't get me wrong, I think sorting algorithms are fundamental to a good CS education, but they are kind of an advanced way to start. Usually that's a Sophomore CS class when you start learning about algorithm design and analysis (and it's often merged in with an introduction to data structures).
Have them do a spreadsheet that uses both formulas and pivot tables.
This should not have to be said but Software Engineering IS NOT Programming. Based on your description you want to teach them computer programming. Change the course name.
Write a program to extract links from an html page to a text file and another program to get the urls. Lots of different approaches so they can be creative, not too dry, and lots of websites to choose from.
Found the Perl programmer!
Building a chess engine is a good programming exercise. A board with 64 squares, six types of game pieces, and 16 pieces per each side shouldn't be too hard to program. Implementing the rules for each game piece can be tricky, especially more obscure plays (i.e., castling with king and rook or promoting pawns to queens). Another step into the rabbit hole is to create an A.I. opponent. You can do that without looking at any of the academic literature from the last half-century on programming the game of kings.
All you need is a Raspberry Pi. Inexpensive and ready to go Linux platform. Programming is a snap and real world controls are at your fingertips. As well as World wide support and suggestions. As well as Teacher lesson plans etc.
What could be better?
RAH
An introduction to basic electronics? Most of these kids can assemble a circuit by following a diagram. But they get lost if the circuit doesn't work, lack the knowledge to troubleshoot the circuit, and flood the comment boards with requests for the correct circuit and/or PCB design file. Some kids think the solution for any electronic problem is to throw in a Raspberry Pi or Adrunio board into the mix.
A good introductory SW engineering project? I assume you've already done basic maintenance projects and such before and are looking for something entirely new. So i'd suggest starting out with a very small droid. If you keep the functionality limited it should be pretty cheap and simple to construct and program.
After that i think there are two paths you could take. Since you'll already have experience with motivators it should be simple to scale up a little and create some kind of vehicle. I would suggest a small one person speeder. Alternately if you're willing to branch out into high energy physics you could try to create your own blaster.
And if you're really ambitious and willing to learn both fields you could eventually work up to building your own fully armed and operational X-Wing! After which you'll have mastered all the basics and from that point on the sky's the limit!
(And don't get fooled! Some people might try to convince you that building a lightsaber is so easy that any man-child could do it. However along with requiring special skills that apparently aren't tought to the general public it also requires very rare and expensive materials of the highest quality. I assure you that if in a fit of petulant rage you try to create one without adequate training, using whatever leftover bits of crystal you're able to find lying around, you'll just end up with some crackling, sputtering piece of crap that will vent waste plasma all over the place and won't even be able to hold a coherent beam.)
This Space Intentionally Left Blank
Have them write a program based on Benford's Law. The task combines statistics and programming. The results are interesting, too. Have them find a real dataset online and run it through their program to determine how likely fraud was involved in producing it. I wrote just such a program--it should be tiny--and evaluated population per county in Texas. Was legit! Also have them create their own fraudulent dataset and show that it is fraudulent via their Benford's-Law program.
Walk them through the Monty Hall Problem (https://en.wikipedia.org/wiki/Monty_Hall_problem) - they won't believe the solution. Then make them write code to simulate the problem and tally the probability seen empirically. Should be a very modest amount of code but pretty fun for them.
I taught an intro to programming course years ago and having them convert an Arabic number to Roman numerals was one of my favorites.
There are lots of CS constructs that come into play including number and string manipulation, looping constructs, if/then logic, etc.
They also get to see that there is more than one way to solve the problem and that some solutions can be far more elegant than others.
Average Intelligence is a Scary Thing
If this is for Software Engineering, then you shouldn't be touching computers until later.
Get paper, pencils, bread, peanut butter, jelly, and whatever else you like.
Give the paper and pencils to the students.
Tell them to write instructions to you to make a sandwich.
As they turn the instructions in, follow their instructions EXACTLY. For example, if the first step is to put the peanut butter on the bread then you pick up the unopened jar of peanut better and drop it from a height onto the unopened loaf of bread. When someone says to spread the peanut better on the bread, feel free to only smear it on the outside crust instead of on one of the flat sides. When you're done following their instructions, give their sandwich back to them. Depending on how you want to do it, you could have them watching you follow their instructions or perform the instructions where they can't see it (white box vs black box).
If they are able to write the exact steps, then you can get creative depending on how well they did. You can split them up into groups and each group does a section of the steps (like breaking programs into modules), then you attempt to follow the modules in whatever order they give you. Don't tell them the groups can't work together, but also don't tell them they can. Make sure the modules are broken up in a way that they won't succeed unless the groups work together. The point being is they'll need to work together to interface their sections of the instructions.
Don't forget to add or remove a requirement while they're working.
If you want them to learn software engineering, try this:
- find a fun exciting simple project on Github. Or write one.
- challenge the class to:
-- download the source code (requires installing git and learning how to use it)
-- build it (requires build tools and learning how to run them)
-- run it (make it do something fun)
-- find a bug in it (make sure it's got bugs - e.g. a calculator that adds 2+2=5)
-- raise a bug report (requires finding the bug repository and writing it up)
Next week, get them to fix the bug.
The week after, you can start the whole requirements/stories/changes journey.
Give them a routine to draw a point on the screen at x,y coordinates. Then give them a pair of coordinates and have them draw a line between them. Ask them to do this with no multiply or divide in the loop. Requires a short bit of research, then implementation of a well known algorithm. This is sort of the most useless, today, yet enlightening programming as it teaches a different way to approach problems. Get them to then explain why it works. Circles then become a more complex yet graspable follow-on.
We've got 15 years of programming problems (and 10 years of working solutions) that we used for our annual high school-level programming competition: HP CodeWars. The problems start very simple and progress to "an hour and 100+ lines to solve" with the higher point values. All of them are available on the website at http://www.hpcodewars.org under the 'Sample Problems' heading.
We spend a long time every year generating a new problem set that hopefully touches on a lot of different programming topics without requiring specific language usage or a lot of library dependencies. Note that our winning teams (3 people to a team, using a single computer and keyboard) have generally solved n-1 or n-2 of these in three hours...
Write a simple flexible task scheduler (todo scheduler, essentially) for scheduling time-limited activities in the day.
Just something fun to make more optimal use of limited time in the day.
One that lets you define:
Task groups, with type (exercise, learn, relax, etc)
Tasks in those groups (simple, complex, exhaustive exercise)
Duration (multiple if better, like 15, 30, 60 minute segments, with priority for each, based simply on larger numberin field=higher chance logic)
Store these in a file format, like INI, CSV, XML, JSON or similar simple formats.
Write a basic UI to do these tasks.
Optional command-line support. (Interface more optional, gotta love a nice CLI)
logbook for each task to keep track of activity in those tasks.
Optional labeled pages for logbook so you can keep track of different items in a related task. Saves on task bloat, cuts down 'learn [language]' from the number of languages to one. Easier to manage too. More flexible as well! You might feel like learning some German over Japanese that day.
From there you can expand in many directions.
Covers datetime, UI (GUI and CLI), file IO, file formats, some basic stats, inheritance.
Not too hard to do if you lay out the needs logically.
Plus, it might even help most people bring order to their day, even here!
Yes, HS level.
You are cancer. This is why ten years from now we will keep complaining about ignorant idiots who happen to infect the worlds codebase with crap, "developers" who cannot tell the difference between a pointer and an integer and appalling security vulnerabilities. Programming cannot happen right before a solid understanding of the fundamentals of computing and computers is taught. NO MORE "SIMPLE" INTRODUCTIONS TO PROGRAMMING, PLEASE!
For me, learning to solve the ACM ICPC problems was always enjoyable and challenging especially at a HS level. Several archives of prior year problems can be found using a quick Google search. I especially like how most of these problems are based on a known simple input sequence and known simple output sequence. Algorithms are at the heart of most programs these big data days and therefore the study of them should be encouraged. I agree that they can turn some people off so a mixed approach (graphics, web, DB, and algorithms) will likely work best.
Great question and welcome to IT!
I have a pretty crazy history with computers which started with self assigned projects and self appointed challenges at 11 years old.
First, I bought 101 Basic Programs by David Ahl available here: http://www.atariarchives.org/b... and spent a summer typing those games into a basic interpreter running on an Atari 600xl. There were MANY games in this, which was my attraction, but the real learning came when i didn't like the game's mechanics and changed them to suit myself, with the sheer volume of tedious typing led to a lack of attention which introduced errors - and helped me actually learn the logic of the code by figuring out why it was breaking down and where.
Now to be clear, the programs you proposed are - shall we say - like watching paint dry - tremendously boring - and code doesn't have to be like this. You have a whole generation of game players who - if you simply introduced things they would be interested in - mechanics of gameplay - whether that's physics and having them draw a pixel that falls at a certain rate, or it's introducing collision detection, or it's introducing scripted dialog and response systems to the traditional 'hello world' stuff, or it's applied fractal graphics (fractals are actually quite easy to implement), or it's making logical changes in a text based adventure - games are my suggestion and advice to ANYONE teaching programming for the first time.
Optimization, in my opinion, such as fast sorting algorithms for a text search are wonderful and all, but teach the student how this is applied to the real world, and have them build a portion of a scripted response system so they understand how dialog responses work in a game and methods to make these more effective. Teach them not just the tool, but at least ONE strategy and method to apply that tool.
Now for self development, once I input all those programs... I got into practical joking.
So I taught myself how to code to create practical joke programs that made it look like a hard drive was being reformatted - a program I would place on an unsuspecting target's machine while they were at lunch. I created another practical joke to make it look like a digital computer screen had lost it's vhold. Another practical joke would periodically pop up 10 notepads on the desktop. And yet another practical joke program - chug and slug - would chew through memory or slow the system to a crawl. From there, I took up TCP/IP programming because I wanted to remotely send a friend's computer a difficult to locate message which would have his computer moo like a cow. I taught myself SMTP and POP and how to build a generic SMTP /POP proxy server because I was interested in a girl at work and needed a way to seamlessly intercept communication that she (or anyone else in the office) couldn't detect. I taught myself how to hack into other machines to install my practical jokes and to 'net send' messages from my boss's machine to a friend of mine - and tell him to come to my boss's desk.
Programming - in large part - can be one of two things: It can be a way to simply do a job - like a hammer to the carpenter - which makes programming horribly dull for most - or it can be a creative means for expression - which is what made it so much fun and lucrative for me for years.
My advice is to challenge yourself, and your students - the practice and art of having fun. Give them non destructive challenges to achieve.
Practical jokes AND games make for wonderful ways to express and to learn this skill and find yourself in great demand.
. . . there is no such thing as a "software engineer".
There are half a million of these supposedly fictional beings. It may be time to get off the soap box.
http://www.bls.gov/oes/2008/ma...
Check out Robocode, it's a game where you write simple java code to control a tank in 2d. You can then battle your robot against your friends. The great part about it is that you can make a working AI with really simple code, stuff like turn until facing enemy, if facing enemy drive forward. If facing enemy shoot straight ahead. If you know enough trig, you can try to lead your shots, try to dodge, etc. We did this once at a computer science camp I went to in highschool and it was AWESOME. The other thing that's great about it is that since they're competing with each other, they wont get too discouraged. Everybody's bot is going to be a twitchy mess, so even barely working ones can win matches. This works best as a mult-day things, since the kids can learn from each other and refine their bots over time.
I was involved with a research meta-analysis during my graduate coursework and we found that students are overwhelmingly more receptive to learning programming when they have something visual that they can use to associate the code that they write to something actually happening. We didn't look at what kinds of problems or what visual output works best, but my opinion is that you could start with something like Lego Mindstorms (which has/had a drag-and-drop interface that can be used to arrange blocks of logic) or do some kind of video game programming. I learned via a tool called Jeroo [1] which was basically a simple video game that required input via programming rather than from controllers. You could also take some kind of open-source simple video game, remove some chunks of code, and have the students re-implement the code that was removed. You can use this as a building exercise, so they get to build their own video game that they can play by the time that the course is over. [1] - http://home.cc.gatech.edu/dorn...