Friday, March 20, 2020

An Object in Java Represents a Real-World Object

An Object in Java Represents a Real-World Object An object in Java  - and any other object-oriented language  - is the basic building block of all Java applications and represents any real-world object you might find around you: an apple, a cat, a car or a human. The two characteristics that an object always has are state and behavior. Consider a person object. Its state might include hair color, sex, height, and weight, but also feelings of anger, frustration or love. Its behavior could include walking, sleeping, cooking, working, or anything else that a person might do. Objects form the very core of any object-oriented programming language. What is Object Oriented Programming? Hundreds of books have been written to describe the intricacies of object-oriented programming, but basically, OOP is based on a holistic approach emphasizing  re-use and inheritance, which streamlines development time.  More traditional procedural languages, such as Fortran, COBOL, and C, take a top-down approach, breaking down the task or problem into a logical, orderly series of functions. For example, consider a simple ATM application used by a bank. Before writing any code, a Java developer first will create a roadmap or plan on how to proceed, usually beginning with a list of all the objects that need to be created and how they will interact. Developers may use a class diagram to clarify the relationships between objects. Objects required for use in an ATM transaction might be Money, Card, Balance, Receipt, Withdrawal, Deposit and so on.  These objects need to work together to complete the transaction: making a deposit should result in a balance report and perhaps a receipt, for instance. Objects will pass messages between them in order to get things done. Objects and Classes An object is an instance of a class: here is the crux of object-oriented programming and the idea of re-use. Before an object can exist, a class on which it can be based must exist.   Perhaps we want a book object: to be precise, we want the book The Hitchhikers Guide to the Galaxy. We first need to create a class Book. This class could be the basis for any book in the world. It might look something like this: public class Book {String title;String author;   //methodspublic String getTitle({return title;}public void setTitle(){return title;}public int getAuthor(){return author;}   Ã‚  public int setAuthor(){return author;}// etc.} The class Book has a title and an author with methods that allow you to set or get either of these items (it would have more elements as well, but this example is just an excerpt). But this is not yet an object  - a Java application cant yet do anything with it.  It needs to be instantiated to become an object that can be used.   Creating an Object The relationship between an object and a class  is such that many objects can be created using one class. Each object has its own data but its underlying structure (i.e., the type of data it stores and  its behaviors) are defined by the class. We can create several objects from a book class. Each object is called an instance of the class. Book HitchHiker new Book(The HitchHikers Guide to the Galaxy, Douglas Adams);Book ShortHistory new Book(A Short History of Nearly Everything, Bill Bryson);Book IceStation new Book(Ice Station Zebra, Alistair MacLean); These three objects can now be used: they can be read, purchased, borrowed or shared.

Wednesday, March 4, 2020

ACT Guessing Strategy The Top Mistake Students Make

ACT Guessing Strategy The Top Mistake Students Make SAT / ACT Prep Online Guides and Tips The ACT doesn't penalize guessing, so you should never leave any answer blank even if you have to take a completely blind guess. Even with this information, students still make one huge mistake. Here we expose the biggest ACT guessing strategy mistake students make, and suggest a much better approach. We've seen students improve 1-2 points immediately after applying this 5-minute strategy. The Biggest ACT Strategy Mistake ACT takers already know not to leave any questions blank – after all, the ACT doesn't penalize guessing. But many students take this to mean that they should spend substantial time on each question. These mistaken students think, "if I have to answer all questions, doesn't it make sense to spend at least 20-30 seconds looking at each?" The answer is a big, fat NO. Let me be clear: you have to give an answer for each question, but you DO NOT need to spend 20-30 seconds looking at each question. I am a strong advocate of blind guessing for many students on many types of questions. First, What Is Blind Guessing? Blind guessing is exactly what it sounds like guessing on a question without even reading it. Just filling in "C" or "G" at random. This might sound crazy, but for many students this is not a bad strategy. How and Why to Use Blind Guessing In particular, you should always blind guess when you encounter a problem way beyond your difficulty threshold. For example if you usually score a 15 on the math section, then most of the problems in the "hard" towards the end of the section will be way above your skill level. You get .20 points (in expectancy) just for blind guessing, which means you have a 1-in-5 chance of getting it right. And it takes 1 second! Now, since these are hard questions, and you usually score a 15, it may take you 2 minutes just to understand each question, and another 2 minutes to eliminate a couple of answer choices. This is a really bad use of four minutes to just get .4 extra points (in expectancy). Besides, you may not even eliminate correctly. Who Should Not Blind Guess: High Scorers High scorers, those with above a 20 on all sections, should not be using Blind Guessing. That's because, to maximize their points, they need to be spending time trying all of the questions. In such a case, since you're reading and understanding all questions anyway, you might as well make a more educated guess by eliminating some answers. When Everyone Should Not Blind Guess: Easy Questions For easy questions (those toward the beginning of the section), everyone should be trying them even if you're a low scorer, these are the questions that will give you your baseline points. On these questions, blind guessing is a big no-no. Recap As a recap, a holistic ACT guessing strategy is made up of three parts: 1. Always answer all questions, even if it means blind guessing last minute. Never leave them blank! 2. If you read a question, make an educated guess by eliminating answers you think are wrong. 3. Do not spend time on all questions: for ones that you know are much too hard for you, intend to blind guess. Read More! How is the ACT scored? Is the ACT easier than the SAT? Want to improve your ACT score by 4+ points? Download our free guide to the top 5 strategies you need in your prep to improve your ACT score dramatically.