# Tag Info

### Why do we practice printing patterns while coding?

Why do we practice printing patterns while coding? Because bugs love to hide in loops. Talk students into using loops to print these patterns and they will create bugs. Tracking down and squishing ...
• 1,023

### Why do we practice printing patterns while coding?

Are these kinds of pattern questions just for fun and to get better at using loops [...] ? Absolutely yes. Practical applications of such patterns nearly don't exist. It's good training for control ...
Accepted

### Using questions from a code-competition website in homework and exams

Whether this is a good plan or not depends on some things, most especially the nature of your students. However, it seems a bit too unstructured. If you have a general mix of student ability it ...
• 35.1k

### Exercise or example to reinforce idea of functions?

I saw the light at the end of the fiber optic cable as soon as you said that these are students of electronics. There is nothing more modular and encapsulated than that! Software is simply electronics ...
• 939
Accepted

### Exercise or example to reinforce idea of functions?

Instead of an example, use a metaphor. Get yourself a frisbee - ultimate disk and two packs of sticky notes. You are the caller of a function. Another person is the function itself. Write a value on ...
• 35.1k

### Reference request for resource with difficult programming exercises

If he wants to have a blast biting into some very fun and challenging problems, Project Euler is fantastic, and entirely language neutral. He may find that certain problems are out of his grasp until ...
• 31.6k

### Reference request for resource with difficult programming exercises

Although the question is asking for a book, looking a "Project Euler" mentioned in another answer, I would like to suggest Codewars might be what you are looking for. On codewars you choose ...
• 161

### Why do we practice printing patterns while coding?

I was skeptical about this as well. Those pictures feel like a cheesy attempt to make programming cool, from an era when that meant ASCII graphics; or the sort of cutsie junk we need to keep the ...
Accepted

### Should I Provide Answers To Exercises?

I post solutions after the due date of an assignment. And usually, I'll go over them in class as well. Two birds... Students get to see at least one working solution, although I try to come up with ...
• 3,029

### Lambda expressions exercises and practice

One of the interesting things added to java in v8 is functional interfaces. Previously java only matched things up and verified correctness by type (type names). With functional interfaces, java now ...
• 35.1k
Accepted

### Is it worth to learn to make a MD5-hash cracker?

I have used a similar idea - writing an SHA-1 hash cracker - as a mini-project for students learning Java. These students had previously learned to program in other languages, so they had experience ...
• 519

### Reference request for resource with difficult programming exercises

The International Olympiad in Informatics is an international competition for gifted young amateur programmers. The tasks from past editions are available online, including detailed problem ...
• 200

### A meaningful exercise that requires using a destructor

Create an object that creates a new file and writes in to it over several method invocations (not just one). Assure that the object has been deleted before continuing (Make the object go out of scope ...
• 35.1k

### Should I Provide Answers To Exercises?

To give or not to give, that is the question There are actually several possibilities that reflect how you want the provided solution to be used. For context, I am an instructor at Colorado State ...
• 1,113

### Should I Provide Answers To Exercises?

Don't provide code dumps. Provide guides that outline the process of solving the problem. Create a function that squares a number passed to it Don't just give out a fully-coded solution. The ...
• 5,420

### Should I Provide Answers To Exercises?

Reading an answer is not the same thing as solving a problem. I think different areas of the brain are engaged. Solving the problem yourself is a stronger reinforcement of the ideas certainly. ...
• 35.1k

### A meaningful exercise that requires using a destructor

There are 2 good examples of patterns where the destuctor is a key. This way you can teach a couple of useful patterns on the way. RAII - Resource Acquisition Is Initiation Rule of 3/5/0 It's ...
Accepted

### Genetic Algorithm enrichment lesson

Classification problems are reasonable candidates. For instance, I wrote a GA that looked at the mushroom dataset taken from the UCI Machine Learning Repository with the goal of classifying an ...
• 414

### Best Practices for introductory teaching

I think you have left out two essential elements here. Your first two points leave the students passive consumers. The last is about testing. But there is no guarantee of any learning in between. In ...
• 35.1k

### Basic OOP practice exercises for inheritance and polymorphism

You could have a hierarchy based on an abstract class or interface Car, with implementations/subclasses for ElectricCar, ...
• 7,510

### Exercise or example to reinforce idea of functions?

Can I craft an exercise ... that would give a dramatically wrong output, e.g. cause the screen to "blow" up if the function print-ed instead of return-ed... [my emphasis] Early in my Python ...
• 824
Accepted

### Looking for good Master Theorem examples

A famous example is Strassen's matrix multiplication algorithm, whose running time satisfies the recurrence $T(n) = 7T(n/2) + O(n^2)$. A similar example is Karatsuba's algorithm for fast integer ...
• 286
Accepted

### Reference request for resource with difficult programming exercises

Disclaimer 1: I haven't seen the book, and I have no idea what exercises it offers. Disclaimer 2: I haven't seen your brother's code. The goal of an easy exercise is to learn how to write the perfect ...
• 442
Accepted

### What are some good conditional branching excercise scenarios?

There are literally zillions of scenarios. Even before the loops are introduced. For example, Min, max, and clipping a value into an interval. Figure out whether a year is a leap one. Determine if a ...
• 442

### Basic OOP practice exercises for inheritance and polymorphism

I have used an example of a machine which has a serial number and a state. It can be turned on and off, it can be told to give out its serial number. A ...
Accepted

### Basic OOP practice exercises for inheritance and polymorphism

One example that isn't necessarily exciting but would allow for a lot of class design is a Shape interface. From there let's say you have ...
• 9,032

### Excel macro recorder exercises

One extremely handy macro is creating names ranges. Start recording Select the range you want to name Press the "create named range" in the "formulas" tab give name stop recording. Voila. This has ...
• 6,227

### Excel macro recorder exercises

I'll start by adding the exercises I'm currently using, but please don't let this stop you from posting more! Create a macro that inserts a header row. (Story: "Every day I download a csv file. ...
• 1,388

### Lambda expressions exercises and practice

I think the most critical thing about lambda functions is that they enable the convenient use of map and filter functions on ...
• 121