How can I improve these online java programming puzzles I wrote for my (middle/high school) students? [closed]

I’m teaching some middle and high school students programming right now, and I found that some of them really liked online programming puzzles. So I created http://www.kapparate.com/coder/ , and right now there’s 4 categories of puzzles.

All the puzzles are set up right now so that variables are pre-initialized, and the user plugs in some code in the middle.

For example, the problem might say these are pre-initialized:

int x = ????;
int y = ????;
int z;

and then the program might ask the student to write the final line of code: z = x + y;.

Now I know I could go a long way in improving the usability of this site (like having an area that lists the pre-defined variables), but I was wondering if this concept seems sound. I know some sites have kids fill in functions, but not all of my students know what functions are yet, and I’m trying to introduce online programming puzzles before that.

2

You could mix your code and English a little better. It’s one of those hassles that StackExchange has tackled pretty well. You could develop a system like here and highlight any text which is to be taken as code. Also, use a different color for mathematics, because = means different things if the context is mathematics or C.

You have side lessons within the problems. In that second question you introduce and explain the mod op. Put that in it’s own paragraph or link to an aside. Or, honestly, just link it.

The actual problems are kinda buried in those paragraphs. I read through a couple and when I got to the end I had no idea what I was trying to solve for. Feel free to have background explanation (which is, you know, the educational part), but try to clearly state the problem.

And things like: “You may search the internet for the appropriate equation to use.” shouldn’t have to be stated. Programmers have access to the Internet. Not letting them search for solutions is as archaic as expecting them to write their solutions in pencil.

A standard form for the incoming variables and expected results would help.

A personal nitpick is the use of vague and terse variable names. If you’re going to teach programming, teach them to use variable names which make sense.

So, taking a crack at rewriting one of your questions:

Complex Numbers: In mathematics, the square root of a number is X if X times X results in the number. However, the square root of negative one is known as “i”. i has the properties such that i*i = -1. Complex numbers are written as the sum of their real and imaginary parts. Thus, 3+2i is a complex number with 3 and an imaginary part 2i. These complex numbers obey standard algeberic rules for adding and multiplying equations with variables. Thus, (3+2i)*5 = 15*10i. Additionally, `(a+bi)*(c+di) = a*c + a*d*i + c*b*i + b*d*i*i, which simplifies to (a*c-b*d)+(a*d+c*b)*i. Further reading: “complex numbers”, “multiplying imaginary numbers”, “the FOIL method”, “multiplying complex binomials”

Problem: Write a function that solves (a+bi)^2.

Input:
int realPortion; //Range: any value

int imaginaryPortion; //Range: any value

Output:
realPortion should store the resulting real portion of the equation.
imaginaryPortion should store the resulting imaginary portion of the equation.

Edit

//You do not need to create double a, or double b

The word is “declare”. You declare variables. They’re going to run into that later and it’s good to stay consistent.

hmmm, something about these implied variable declarations still bugs me. I dunno, maybe you want to explicitly show the code that comes before and after?

void Divisibility_Test()
{
  int x;
  int y;
  boolean xIsDivisibleByY;

(text box for students to type in)

  evaluate(xIsDevisibleByY);
}

Also, I think I have a philosophical issue with #7 which uses casting to an int to round off a double. I can’t say it doesn’t work. Or that it’s wrong per se.

This would be above and beyond, but I imagine if you churn through enough impressionable youths you’re going to hit those naturally gifted ones which plow through this. If you had challenging bonus questions you might be able to light up some inspiration and get them interested. Things like computing the Fibonacci sequence, constructing markov chains, a bot that can play checkers.

Best of luck. Teaching children to code is a daunting task and it’s largely up to them. All you can do is lay out the path. Thinking back, there were an awful lot of pitfalls and hours of frustration. …of course, that implies anything has changed.

2

There was a site a while ago (it is dead now) called codingkata.org. The Java katas on there had a problem description and then you used a maven archetype to get the project and implement the given method signatures. There were then unit tests that ran over your code when you ran mvn test that told you whether you passed the kata or not.

Doing something like this would introduce your students to the concepts of maven (which is used heavily in the Java world) and get them used to using it to setup projects, manage the pom and run unit tests.

It would also force them into learning about functions and going from this is my problem to this is my solution all within the safety of knowing that it can be automatically checked.

They can also use their favourite IDE/text-editor/etc. to implement the code as they see fit too.

I would also work on the description of your problems too; I found them hard to read personally.

Some good answers already. Just a few insights:

  • Your problems are fun but at least the first few are as much about math as about math as about programming. That’s OK if that’s the intent.

  • You might consider introducing the procedure fairly early on. That would make a nice little bundle that could help define the problem statement and make testing the solution clearer. Also, it creates a package for variables to pass into and out of. Instead of seeing that x = 4; y = 2; x + y = 6; a procedure would give the sense of infinite variation such that int plus(int x, int y) { return ???; } would make a lot more sense and I think be clearer for a student to fill in. It’s useful (sort of) outside of the scope of the individual problem.

  • It’s really hard to write a good problem statement. I’m currently taking Martin Odersky’s free online Scala course and I often find myself confused by his problem statements. But he includes a few unit tests with each problem and reading his tests really nails down the scope and intent of the problem. The actual grading uses about twice as many tests as he gives you and you are encouraged to make up your own tests. Really, the unit testing is the first aspect of the course that I can immediately apply at work.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật