Posts

CPT 307 Week 5 Interactive Assignment

Image
In this post, I used the queue function. In this Java program I used the add (), element(), offer(), peek(), and poll() methods for the queue function. Here I set up a queue that lists different parts of a car. The queue function is used to remove elements from the beginning of the queue and insert elements at the end of the queue. This is the First in First Out method. The poll function job is to take the first element of the queue and remove it. One thing to note is that in this case, if the container is empty, a null will be presented and not an exception. The remove function deletes the head of the queue In writing this program, I needed to be able to add elements to the queue, and I did this by using the add function. This allows me to add specific items to the list I am building Using the peek stack will retain the first element it doesn’t retrieve or remove the element. The Offer method can insert elements into the queue with no issues. Many times, this is used in p...

About Computers

When installing anything on to your personal computer, it is as simple as going to google.com and searching for whatever you want to download. For example, if you are trying to download Java, the first two result will take to java.com so you can download it. Ensure that you choose the appropriate link for the operating system you are running (i.e. Windows, Unix/Linux, Mac OS) and following the prompts will complete the installation of Java. Using Java, like any programming language takes time to learn. A simple method that can be used is watching YouTube videos to start with the basics and gradually progress. The widespread use of computers has revolutionized many aspects of labor and business. In only a few generations, the computer has gone from being a mysterious tool accessible to a privileged few to a common tool used by people at all levels of labor in almost every industry. Information Storage Without addressing the specifics of the technology, computers store informati...

Network Security

Java is object-oriented programming (OOP) language. OOP languages like Java deal with objects and classes. A class can simply be explained with the use of attributes and behaviors. Using a person as an example, attributes of a person would be their height, weight or eye color. Using the same example, behaviors are actions a person does like eat, run, or sleep. For objects, they are an instance of a class. They are described with characteristics and methods. Characteristics are like attributes, but instead of a person’s height, it gives the height a value like 5’9’’. Methods are like behaviors of a class, they are actions. There are four principles that you must learn when learning an OOP language. These principles include encapsulation, data abstraction, polymorphism, and inheritance. Encapsulation is used to ensure an object’s integrity. It does this by hiding functional details of a class. With inheritance, a subclass acquires the attributes and behaviors of the parent ...