Friday, March 20, 2020

Microevolution essays

Microevolution essays Microevolution is a small evolution or change to a specie over a period of generations, which give so many varieties of animals on earth. In early human history, people would try to explain observable events by noting that they were a natural happenings. Aristotle was one of the first naturalist. He gave great in depth descriptions of the world through his eyes. He believed along with manyo theres that all organisms were different from the rest. Even though he believed this he still tried to understand what some organisms were for when they had strange roles in nature. From these early observations, naturalist were made to be aware of nature, but until the 15th century naturalist were only aware of things in nature in Europe. Soon though they would make trips to Asia, Africa, and the New World. Such naturalist like Thomas Moufet were astonished at the vast array of species they discovered in these new areas. After travel was extended around the world scholars created an idea called biogeography. Biogeography means that the geography surrounding an area affected the certain species that inhabited the area. Later, in the 1600's geologists added to the naturalist's confusion by producing fossils that showed early species of their current organisms. This gave to the idea of evolution, or that over time species were changed to better themselves in their environment. New discoveries were not found until in the 19th century when Charles Darwin became a naturalist. He gave way top his Theory of Evolution by Natural Selection which stated that populations could evolve over time when individuals differ in heritable traits responsible for their survival and reproduction. Evolution cannot happen to just one organism. Evolution is something that occurs in a population. Evolution takes place when different alleles are inherited by descendants and the alleles are combined in different ways, mutated, or just change to help brin...

Wednesday, March 4, 2020

Tips for Declaring Variables in Java

Tips for Declaring Variables in Java A variable is a container that holds values that are used in a Java program. To be able to use a variable it needs to be declared. Declaring variables is normally the first thing that happens in any program. How to Declare a Variable Java is a strongly typed programming language. This means that every variable must have a data type associated with it. For example, a variable could be declared to use one of the eight primitive data types: byte, short, int, long, float, double, char or boolean. A good analogy for a variable is to think of a bucket. We can fill it to a certain level, we can replace whats inside it, and sometimes we can add or take something away from it. When we declare a variable to use a data type its like putting a label on the bucket that says what it can be filled with. Lets say the label for the bucket is Sand. Once the label is attached, we can only ever add or remove sand from the bucket. Anytime we try and put anything else into it, we will get stopped by the bucket police. In Java, you can think of the compiler as the bucket police. It ensures that programmers declare and use variables properly. To declare a variable in Java, all that is needed is the data type followed by the variable name: int numberOfDays; In the above example, a variable called numberOfDays has been declared with a data type of int. Notice how the line ends with a semi-colon. The semi-colon tells the Java compiler that the declaration is complete. Now that it has been declared, numberOfDays can only ever hold values that match the definition of the data type (i.e., for an int data type the value can only be a whole number between -2,147,483,648 to 2,147,483,647). Declaring variables for other data types is exactly the same: byte nextInStream; short hour; long totalNumberOfStars; float reactionTime; double itemPrice; Initializing Variables Before a variable can be used it must be given an initial value. This is called initializing the variable. If we try to use a variable without first giving it a value: int numberOfDays; //try and add 10 to the value of numberOfDays numberOfDays numberOfDays 10; the compiler will throw an error: variable numberOfDays might not have been initialized To initialize a variable we use an assignment statement. An assignment statement follows the same pattern as an equation in mathematics (e.g., 2 2 4). There is a left side of the equation, a right side and an equals sign (i.e., ) in the middle. To give a variable a value, the left side is the name of the variable and the right side is the value: int numberOfDays; numberOfDays 7; In the above example, numberOfDays has been declared with a data type of int and has been giving an initial value of 7. We can now add ten to the value of numberOfDays because it has been initialized: int numberOfDays; numberOfDays 7; numberOfDays numberOfDays 10; System.out.println(numberOfDays); Typically, the initializing of a variable is done at the same time as its declaration: //declare the variable and give it a value all in one statement int numberOfDays 7; Choosing Variable Names The name given to a variable is known as an identifier. As the term suggests, the way the compiler knows which variables its dealing with is through the variables name. There are certain rules for identifiers: reserved words cannot be used.they cannot start with a digit but digits can be used after the first character (e.g., name1, n2ame are valid).they can start with a letter, an underscore (i.e., _) or a dollar sign (i.e., $).you cannot use other symbols or spaces (e.g., %,^,,#). Always give your variables meaningful identifiers. If a variable holds the price of a book, then call it something like bookPrice. If each variable has a name that makes it clear what its being used for, it will make finding errors in your programs a lot easier. Finally, there are naming conventions in Java that we  would encourage you to use. You may have noticed that all the examples we  have given follow a certain pattern. When more than one word is used in combination in a variable name the words following the first one are given a capital letter (e.g., reactionTime, numberOfDays.) This is known as mixed case and is the preferred choice for variable identifiers.