Learning Java Programming in Clara‘s World
Book information
Description
This book introduces the key concepts of Java programming through the eyes of a small ladybug called Clara. Clara is a fun and extremely obedient insect, whose journey starts with limited skills. Readers learn programming by making Clara move around and manipulate objects in her world. As the book progresses, Clara becomes more intelligent and acquires new skills and (together with readers) learns by tackling some of the world’s greatest challenges. The book explains programming concepts through real-world problems such as launching rockets into space, automatically patching potholes, developing a vacuum cleaner robot, simulating projectile motion, dynamically avoiding obstacles, delivering mail, etc. Every chapter of the book starts by presenting a challenge and then continues to explain new programming concepts with the focus on tackling this challenge. Focusing the new material explanation on these challenges helps to remind the readers of how this material is connected with the problems that they may encounter in the real world and makes it easier to relate to. You can explore all programming challenges presented in this book on the Clara’s World website. Every programming problem covered in the book has a corresponding link to a problem template (for those readers willing to attempt the problem themselves), the link to the solution of this problem and a video recording of us solving this problem step-by-step. In addition, at the end of each chapter there is a link to fun exercises that readers are recommended to complete. Preface Why Did We Write This Book? Teaching Programming in a Fun Way Our Teaching Approach Additional Online Resources Digital Resources for Readers and Educators Contents About the Authors Chapter 1 Introduction to Clara's World 1.1 Meet Clara 1.1.1 Clara's World 1.1.2 Programming Clara 1.2 Chapter Problem: Leaf Delivery 1.2.1 Introducing Clara's World Framework 1.2.2 Changing Clara's World Appearance 1.2.3 Working with Multiple Worlds 1.2.4 Solving the Chapter Problem 1.3 Revised Problem: Leaf Delivery and Reset 1.4 Summary 1.5 Exercises Chapter 2 Flow of Control 2.1 Chapter Story: Patching Roads 2.2 Chapter Problem: Clara Patches Roads 2.3 New Clara Commands 2.4 The Difference between act() and run() 2.5 Conditional Statements 2.6 Solving the Chapter Problem: Clara Patches Roads 2.7 Logical Operators 2.7.1 Logical NOT 2.7.2 Logical AND 2.7.3 Logical OR 2.8 Short-Circuited Operators 2.9 The Precedence of Logical Operators 2.10 Statement Blocks and Nested if-statements 2.11 Road Patching Example with Logical Operators 2.12 Conditional Operator 2.13 Common Errors 2.13.1 Indentation and the Use of Curly Brackets 2.13.2 More Formatting Errors 2.13.3 Using Semicolons 2.13.4 Issues with Explicit Mentioning of true and false 2.14 Summary 2.15 Exercises Chapter 3 Loops 3.1 Chapter Story:Vacuum Cleaner Robots 3.2 Chapter Problem: Clara the Vacuum Cleaner Robot 3.3 Loops 3.4 The for Loop 3.4.1 Examples of Using the for Loop. 3.4.2 Solving the Chapter Problem with for Loops 3.4.3 Elements of the for Loop. 3.4.3.1 Header and Body 3.4.3.2 Loop Header: Initialisation Section 3.4.3.3 Loop Header: Test Section 3.4.3.4 Loop Header: Update Section 3.4.4 Nested Loops 3.4.5 The break Statement 3.4.6 The continue Statement 3.5 Conditional Loops 3.5.1 Chapter Problem 2: Clara the General-Purpose Cleaner 3.5.2 The while Loop 3.5.3 Solving the Chapter Problem with while Loops 3.5.4 The do-while Loop 3.6 Common Errors 3.7 Summary 3.8 Exercises Chapter 4 Coding Style and Decomposition 4.1 Chapter Story: Consequences of Errors in Code 4.1.1 What Is Bad Code? 4.2 Key Principles of How to Write Good Code 4.2.1 Comments in Code 4.2.1.1 Single Line Comments 4.2.1.2 What to Comment 4.2.1.3 Clara Cleaner Problem with Comments 4.2.2 Code Indentation 4.2.3 Decomposition 4.2.3.1 Example: Hurdle Race 4.2.4 Naming Conventions 4.3 Summary 4.4 Exercises Chapter 5 Variables 5.1 Chapter Story: The Friendship Algorithm 5.2 Chapter Problem: Selecting the Least Objectionable Activity 5.3 Variables 5.3.1 Variable Names 5.3.2 Variable Types 5.3.3 Variable Values 5.3.4 Declaring Variables 5.3.5 Assigning Variable Values 5.3.6 Variable Visibility 5.4 Receiving User Input from Keyboard 5.5 Console Output 5.6 Friendship Algorithm: Memorising Interests 5.7 Mid Point Example 5.8 Friendship Algorithm: Finding LOA 5.9 Summary 5.10 Exercises Chapter 6 Expressions 6.1 Chapter Story: Letterboxes with Flags 6.2 Chapter Problem: Using Flags 6.3 Boolean Variables 6.4 Solving the Chapter Problem 6.5 Variables and Literals 6.6 Working with Keyboard Input 6.7 Arithmetic Operators and Expressions with Variables 6.7.1 Subtraction 6.7.2 Addition 6.7.3 Remainder 6.7.4 Division 6.7.5 Variable Casting 6.8 Revised Chapter Problem: Aussie Postie 6.9 More on Expressions 6.9.1 Operator Precedence 6.9.2 The ``+'' Operator 6.9.3 Combined Assignment Operators 6.9.4 Relational Operators 6.9.5 Summary Example: Line in the Middle 6.10 Summary 6.11 Exercises Chapter 7 Debugging and Random Numbers 7.1 Chapter Story: Pac-man 7.2 Chapter Problem 1: Ghosts Performing Random Walk 7.3 Random Numbers 7.3.1 Solving the Chapter Problem: Finding the Leaf via Random Walk 7.4 Debugging 7.4.1 Chapter Problem 2: Repairing Clara's World after an Earthquake 7.4.2 Desk-Checking 7.4.3 Console Output 7.4.4 Embedded Debugger 7.5 Advanced Keyboard Input 7.6 Creating Constants 7.7 The switch-case Construct 7.8 Obstacle Avoidance Bug Style 7.8.1 Chapter Problem 3: Bug Navigation 7.9 Summary 7.10 Exercises Chapter 8 Methods 8.1 Chapter Story: Simulating Projectile Motion in Video Games 8.1.1 Simplified Projectile Motion Simulation 8.2 Chapter Problem: Jumping Like a Flea 8.3 Methods 8.3.1 The void Returning Methods 8.3.2 Methods Returning a Value 8.3.3 Using return with void Methods 8.3.4 Methods Receiving Input 8.4 Information Hiding 8.5 Solving the Jumping Clara Problem 8.6 Passing Parameters by Value 8.7 Passing Parameters by Reference 8.8 Summary 8.9 Exercises Chapter 9 Arrays 9.1 Chapter Story: Game of Life 9.2 Chapter Problem 1: Game of Life in Clara's World 9.3 Arrays 9.3.1 Creating an Array 9.3.2 Working with Array Elements 9.3.3 Processing Arrays 9.3.4 Alternative Array Declaration 9.3.5 Array Length 9.3.6 Array Initialisation 9.4 Passing Arrays to Methods 9.5 Chapter Problem 2: Friendship Algorithm with Arrays 9.5.1 Sequential Search Algorithm 9.5.2 Solving Chapter Problem 2: Finding the Common Interest 9.6 Array Variables as References 9.6.1 Copying Arrays 9.6.2 Comparing Arrays 9.7 Multidimensional Arrays 9.7.1 Two-Dimensional Arrays 9.7.2 Initialising Two-Dimensional Arrays 9.7.3 Processing Two-Dimensional Arrays 9.7.4 Ragged Arrays 9.7.5 More than Two Dimensions 9.8 Solving Chapter Problem 1: Game of Life 9.9 Summary 9.10 Exercises Chapter 10 Classes and Objects 10.1 Chapter Story: The Amazing Ants 10.2 Chapter Problem: Clara Imitates Ant Behaviour 10.3 Introduction to Classes and Objects 10.4 Creating Objects 10.5 Creating a Class Example 10.6 Access Specifiers private and public 10.7 The static Keyword 10.8 Inheritance 10.9 Overriding Methods 10.10 Accessing Methods and Variables 10.11 Constructors 10.12 Method Overloading 10.13 Passing Objects as Method Arguments 10.14 Chapter Problem Solution 10.15 Summary 10.17 Exercises 10.18 Epilogue Appendix A Clara's World User Guide A.1 Quick Start A.2 Creating an Account A.3 Logging in A.4 Recovering your Password and Verification A.5 User Home Screen A.6 Schedules, Practicals and Exercises A.6.1 Schedules A.6.2 Practicals Download Zip Leaderboards Exercise List Description Exercise Due Date A.6.3 Exercises Code Editor Board View Board Menu Breadcrumbs Message View A.7 Rankings A.8 Profile Groups Editor Organisations Avatars A.9 How to Create Your Own Exercises Step 1: Create an Empty Exercise Step 2: Describe the exercise Step 3: Create a World Step 4: Validate the World Step 5: Final Touches Step 5: Adding Custom Code References
Similar books
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF
Professional Linux kernel architecture ''Wrox programmer to programmer''--Cover. - ''What you are reading right now is the result of an evolution over more than seven years: After two years of writing, the first edition was published in German by Carl Hanser Verlag in 2003. It then described kernel 2.6.0. The test was used as a basis for the low-level design documentation for the EAL4+ security evaluation of Red Hat Enterprise Linux 5, requiring to update it to kernel 2.6.18 (if the EAL acronym does not mean anything to you, then Wikipedia is once more your friend). Hewlett-Packard sponsored the translation into English and has, thankfully, granted the rights to publish the result. Updates to kernel 2.6.24 were then performed specifically for this book''--P. ix
2008 · PDF