For this assignment, I developed a program that simulates flipping a coin three times. After each flip, the results are recorded and then sorted. The objective was to implement a simple coin-flipping simulation and demonstrate sorting of random outcomes.
To convert a binary number to decimal, multiply each binary digit by the corresponding power of 2, starting from 202^020 on the right. Then, add the results together. If a binary digit is 1, you keep the result of the multiplication; if it's 0, the result is zero. This process allows you to determine the decimal equivalent of a binary number.
To convert a decimal number to binary, repeatedly divide by 2 and write down the remainders. The binary number is the sequence of remainders in reverse order.
In computer science, lists are data structures used to store and organize collections of items. They allow you to hold multiple values together, which can be of the same type (like numbers or strings). Lists are essential for many programs because they provide a way to manage data efficiently.