This project involves creating a program that converts decimal numbers to binary numbers. The process is straightforward, following the division method where the decimal number is repeatedly divided by 2 until the quotient becomes zero. The remainders obtained during this process are then arranged in reverse order to obtain the binary representation of the decimal number.
This project involves creating a program that takes a three-digit number as input and prints each digit of the number on separate lines in reverse order. It provides a simple exercise in handling numerical input, string manipulation, and output formatting.
This project integrates user input with predefined text templates, allowing for dynamic story generation. By employing concepts such as classes, methods, and string manipulation, I've crafted a modular and interactive program. Utilizing arrays or ArrayLists for word storage enhances scalability and flexibility. Error handling mechanisms ensure robustness, allowing graceful handling of unexpected inputs.Â
This farm animal project introduces three classes: Cow, Chicken, and Pig. Each class defines attributes and behaviors typical of its respective animal type. For instance, the Cow class represents characteristics like name, weight, age, and gender, with methods for noise generation, aging, and display. Similarly, the Chicken class encompasses features such as breed, egg-laying capacity, temperament, and weight, with corresponding methods. Lastly, the Pig class includes attributes like color, pen size, mud wallowing status, and weight, along with related methods. By implementing these classes, I gained a foundational understanding of object-oriented programming concepts while simulating interactions with farm animals.
The PiggyBank application is designed to manage total change stored within it, with functionalities to add and withdraw various denominations of coins and bills. It features two constructors, one allowing the initial total change to be set via a parameter and another setting it to 0.10 cents by default, representing a dime. Seven non-void methods facilitate retrieval of specific coin amounts and the total money stored, as well as calculation of bills that can be made from the total change. Five void methods enable addition of coins and withdrawal of money from the piggy bank, updating the total change accordingly. By implementing these methods, users can interact with the PiggyBank application to manage their savings effectively, learning essential programming concepts in the process.
The PiggyBank application is designed to manage total change stored within it, with functionalities to add and withdraw various denominations of coins and bills. It features two constructors, one allowing the initial total change to be set via a parameter and another setting it to 0.10 cents by default, representing a dime. Seven non-void methods facilitate retrieval of specific coin amounts and the total money stored, as well as calculation of bills that can be made from the total change. Five void methods enable addition of coins and withdrawal of money from the piggy bank, updating the total change accordingly. By implementing these methods, users can interact with the PiggyBank application to manage their savings effectively, learning essential programming concepts in the process.
In this Free Response Question from the 2024 AP Computer Science A exam, I tackled two methods within the GridPath class. For the first method, getNextLoc(), I determined the next location to traverse in a grid based on specific rules, returning a Location object representing the smaller of two neighboring elements. Then, for the second method, sumPath(), I calculated the sum of all values on a path within the grid starting from a given row and column until reaching the last row and column. Successive calls to getNextLoc() guided the path traversal. This task demonstrated my proficiency in algorithmic thinking and problem-solving skills, essential for success in computer science.