Programming technique
Sequence and output
A program normally executes statements from top to bottom. Changing the order can change the result, even when every individual statement is valid.
Output one line at a time
System.out.println() displays a value and then moves to a new line. The statements below produce three lines in exactly the order written.
print() displays a value and then moves to a new line. The statements below produce three lines in exactly the order written.
System ready
Temperature: 21 C
Doors locked Continue on the same line
System.out.print() does not move to a new line. It is useful when several statements contribute to one line of output.
By default, print() ends with a newline. Set end="" when several statements should contribute to the same line.
Loading... complete Comments
Java uses // for a single-line comment. A useful comment explains a purpose, decision or section of the program. Avoid comments that merely repeat obvious syntax.
Python uses # for a single-line comment. A useful comment explains a purpose, decision or section of the program. Avoid comments that merely repeat obvious syntax.
Order matters
Read the program from top to bottom and predict every line of output before running it.
Exact text matters
Capital letters, punctuation and spaces inside quotation marks all form part of the output.
Semicolons matter
Each Java statement ends with a semicolon.
Line structure matters
Python normally places one statement on each line and does not require a semicolon.
Challenges Choose one
Choose a challenge that feels appropriate for you. Code heat is only a rough estimate, not a fixed level.
Visual Dice
SelectedWrite a program that outputs a large number 5 as the face of a die. Use only text characters and make the border and spots line up clearly.
ASCII Name
SelectedWrite a program that outputs your name as ASCII art. Plan the final picture first, then reproduce it using a sequence of print statements.
Console Profile Card
SelectedCreate a neatly aligned console profile card containing a name, favourite subject, current project and one-line motto. Include a border and purposeful comments that explain sections rather than obvious individual lines.
Console Poster
SelectedDesign a detailed console poster for an event, game or club. It must use at least 15 output statements, preserve exact spacing and order, and include a short test checklist describing what the finished output should look like.
Selected challenge
This choice is shared with the portfolio setup page.
Create your challenge folder
Run this command before starting. It creates the correct empty folder inside your portfolio.
Complete the challenge
Write and test your own solution in the folder created above.
Optional scaffolded support
Use only as much support as you need. The templates organise the program but leave the important algorithm unfinished.
Submit for review
Run this when your program is complete. It creates the README, commits the folder and pushes it.