We have been looking at different chatbots with the intention of creating our own. Chatbots are a very simple version of an AI that can respond to what you write. Chatbots work by "reading" what you write and then choosing a predetermined answer based on certain keywords in your responses. If there are no keywords in your response, the chatbot will pick a response from a random list. We have been looking at already written code to see how chatbots pick their responses and how they "read" what the user enters. We hope to use the information that we are learning to create our own simple chatbot. When we finish, it will hopefully be able to respond to several different keywords and make responses that actually make sense. The picture below is a conversation with an online chatbot.
Monday, May 9, 2016
Sunday, May 1, 2016
Basic Windows Application Programming: Part I
With our first program virtually at its completion, we can now set our sight on integration into an actual Windows application, not just a command prompt program. This crucial next step of development requires extensive knowledge of coding far beyond what we know at the moment, so, currently, we've recruited the trusted Dev C++ programming application to do this for us. It does so by pasting the necessary code for an actual application, also known as a Guided User Interface, or GUI for short, into our existing code. This makes sure we don't have to worry about the visuals of the application, as much as the function of it. Below is a screenshot of the code which Dev C++ injects into the program. This method of coding allows more customization of the aesthetics, and form of the program, whereas regular command prompt programming is very bland and one-sided.
Physics Program Finished... For Now
Over the past few weeks, we've been hard at work on our first bona fide physics program, and now it's complete (at least for now). At the moment, it only contains 12 of the most rudimentary physics equations used, but we plan on adding much more down the road. It will hopefully contain other helpful tools besides equation solving, such as projectile motion graphing, electric field mapping, and wave models. This is just the first step on our journey to bigger, more demanding programs which we hope to create later as part of our project. Below is a link to Dropbox, where you can download the program itself, which can be run on any Windows PC. There is also a link for the code. Don't be fooled by the monstrous amount of code; everything this program does has been programmed using no more than 5 or 6 commands.
Here's a screenshot of the program in action:
Monday, April 11, 2016
The Math Class
The math class will be a very important part of our final program. The math class has various math related functions that can help us. There are functions that can compute the sin, cos, and tan of an angle. In our physics program these can be used to find the direction of vectors and the magnitude of their components. The class also contains functions that compute the square roots and exponents. These would be important because a lot of physics problems contain exponents and square roots. The class contains different functions for rounding which would allow the user to choose what place to round the answer to. The picture shows a simple code that computes the value of the square root of 4. The math class will be very helpful in creating our final program.
Thursday, March 31, 2016
Physics!!!
Everybody loves when someone else can do a physics problem for them.
That's why we've been hard at work creating a program that incorporates
every single physics equation, complete with the ability to solve for
any variable. Through the use of many conditional statements, switches,
and what will be hundreds of line of code, we hope to bring forth
something that can help you finish your physics homework in 60 seconds
or less!
This just might be our final product down the line, but we are not sure at this point if such a feat is possible. However, that's exactly what we set out to do, create something we never thought we could do.
This just might be our final product down the line, but we are not sure at this point if such a feat is possible. However, that's exactly what we set out to do, create something we never thought we could do.
Monday, March 28, 2016
Classes
Classes are the basis for object oriented programming. This week we learne
d how to create classes and objects to improve our code. The class is like a blueprint, it describes the object and how it will function. The object is the actual interpretation of the class. Objects can come from the same class, but have different features. This is like how a builder can make houses with the same blueprints but they can have different colored doors and slightly different layouts. Methods define the behavior of the class. Methods can be thought of as verbs while the object is the noun that does the action. Methods and variables in classes can be defined as public or private. Public variables and methods can be accessed from anywhere while private methods can only be accessed from within the class. Creating private methods allow the programmer to restrict access to certain features of their code which can help to stop bugs.
d how to create classes and objects to improve our code. The class is like a blueprint, it describes the object and how it will function. The object is the actual interpretation of the class. Objects can come from the same class, but have different features. This is like how a builder can make houses with the same blueprints but they can have different colored doors and slightly different layouts. Methods define the behavior of the class. Methods can be thought of as verbs while the object is the noun that does the action. Methods and variables in classes can be defined as public or private. Public variables and methods can be accessed from anywhere while private methods can only be accessed from within the class. Creating private methods allow the programmer to restrict access to certain features of their code which can help to stop bugs.
Monday, March 14, 2016
Encapsulation
This week, we finally learned how to keep the NSA's prying eyes from our precious program data, with the use of the Encapsulation method. This coding technique virtually "encapsulates" the data you choose, as to prevent other parts of a program, or even the outside world, from accessing and changing the data.
This can be useful for keeping certain data types constant, while allowing certain subsets within it to be changed. The same can be done with "viewing rights," as you can designate which class and objects can be seen or not seen by the public. In the example below, the data class "myAccount" is visible to the public, as well as the account # associated with it. If set to "private" instead, only the class will be visible, not the #. This has many real world applications, especially in the financial industry.
Monday, March 7, 2016
Functions and Loops
This week we learned about the creations of functions and loops. A function is a piece of code that performs a certain task. The function can be called several times throughout the program without having to rewrite the code each time. This makes coding faster and easier. Functions can be defined to take in values or use predefined values. A function has a certain return type that must be returned at the end of the function. Functions can be defined for several different uses such as computing an average or printing out a message. The use of functions will be very important in our final project. Loops are used to repeat the same few lines of code several times in a row. There are two main types of loops, the while loop and the for loop. The while loop is less rigid than the for loop. In a while loop, a statement is made that is either true or false. The code inside the loop keeps being repeated until the statement is false. This type of loop allows the programmer to change how many times the loop runs based on input from the user. In a for loop the number of times the code will run is more defined. The programmer must choose a variable, a statement, and a way to change the variable. The variable is changed in the same way every time the code runs. This allows for less change in the way the loop will run. The picture shows a for loop that is used to print out the phrase four times in a row.
Sunday, February 28, 2016
Getting There...
Things have gotten even more complicated with the arrival of arrays, one-dimensional, two-dimensional, and three-dimensional. Arrays are basically data tables that a program can pull from to perform certain tasks and algorithms. There are two main ways to place values into an array: a) through the use of a "cin" command, or b) by stating them when you initially declare the array. The included screenshot displays the second method, and uses chosen data values to complete a simple subtraction and output function. Arrays will be a key part of our final program.
Monday, February 22, 2016
Learning More of the Basics
This week we have been learning more of the complexities of C++. We have been learning more about different data types and what they are used for. We learned that the primitive data types are char, int, double, float, and bool. These are the most simple data types and are easiest to use. Int stores an integer; double and float store rational numbers; char stores characters; and bool stores a true or a false. Along with the primitive data types we learned about the if statement. The if statement allows you to check if a statement is true or false. If the statement is true, the code will execute; if the statement is false, the code will not be executed. This allows the computer program to make decisions based on the information that is passed to it. This can also be used to stop errors from occurring such as before dividing checking to see if the denominator is zero. Using the primitive data types and if statements, we have been able to make slightly more complicated programs.
Subscribe to:
Comments (Atom)







