Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, 17 May 2011

JavaFiendz



For the last couple of weeks, I've been plugging away at this program that I am making for one of my computer science classes. It's called Java Fiendz; a pun on the java programming language used to create a coffee ordering system. The program is actually really cool and has been of interest to me since the beginning. It uses multiple classes and a driver so it has kind of been a struggle for me. This is only my second programming class here at Stony Brook and with over 300 lines of code, it has been getting me very frustrated. I tend to start looking for a problem in the code and then get distracted by other code and I end up changing things that don't need to be changed. It a very complicated process that I hope to accomplish soon.



The program mimics a really coffee ordering system to a tee. First, it allows you to pick a coffee or iced coffee, a size, and either decaf or regular. It then allows you to add cream, sugar, or flavoring at different prices. Going back to the menu, you can then print out the current order you have placed. This "receipt" will show you exactly what you ordered, how much it will cost, and the total cost with sales tax. There are also options to clear the order and quit the program. What's pretty cool is that every place from McDonald's to Starbucks uses this type of system and now I am advanced enough to understand it. Hopefully in the future, I can build a real system to be implemented in such an environment.

Sunday, 27 February 2011

C++ vs. Java

Recently I've started looking over some of the source code needed for my Game Development class, and it's been pretty daunting. I have never learned C++ programming, and the recent switch over from Java doesn't make it much easier. Java is a great language to write in. It's much more user-friendly than C++, and provides adequate feedback. C++ tells you that an error exists, and expects you to find what's wrong with the program through a hundred classes with over thousands of lines of code.

Although if you understand one programming language, learning others become relatively easier to learn since they are all derived from C, there are still substantial differences in the syntax between C++ and Java. I still get confused sometimes when I'm writing code in C++, and need a lot of help from my friend Google.

Hopefully I can power through my CSE 380 class without too much trouble. This weekend has been a pain to get through with all my homework due tomorrow. Reading through all this code and recompiling my program to check for bugs is giving me an awful headache. I'm praying that my roommate will come back with coffee for me sometime soon.