Hello, I was hoping to get some input from anyone in the Java section. My professor gave us a practice problem about two weeks ago and I have been running into an out of bounds error. The program seemed simple enough, take in two arrays of binary numbers from a user, add them, and return the sum as a third array. So far I have this: import java.util.*; public class Binary { public static int[] calculate(int[] arr1, int[] arr2) { int length = (arr1.length + arr2.length); int carry = 0; int[] newArray = new int[length]; for(int i = 0; i …

Member Avatar
Member Avatar
+0 forum 3

Hello to all programmers out there. Considering the growing request for practice problems by the beginners, we ( Me, Joey, Niek, Aaron..) have decided to start a sticky which will host some common practice problems which would help the beginners in understanding the programming concepts in a better way. (Did I mention 'Practice makes a man perfect' ? ;) ) The practice problems enlisted will have their own difficulty level or the skill level required(beginner to expert). However feel free to jump to any of them if you think you are up for it. Please don't post "Thank you" posts …

Member Avatar
Member Avatar
+22 forum 45

Hello All, long time no see, I'm seeking for websites that provides practices of C++ and Java examples for programming students, the idea is to give me a programming question to solve in order to train myself. thanks.

Member Avatar
Member Avatar
+0 forum 3

I am trying to learn SQL programming in my spare time, but I'm running into some issues. I currently have Visual Basic Studio 2010 installed, as well as Microsoft SQL Server 2008/2012. I've been told that I should be using MySQL to practice the coding. Should I lean towards MySQL in order to learn the language? (I am currently installing MySQL Workbench as we speak)....

Member Avatar
Member Avatar
+0 forum 4

My name is Leonard E. Norwood Jr. I'm just practicing a simple bubblesort program but this time using classes and pointers with operators >> and << and also an overloaded operator =. I'm merely trying to sort a list of numbers from lowest to highest. And the purpose of the bubblesort is to search for unsorted numbers to compare and swap until the list is fully sorted. This is my list for practice: 29 23 12 39 32 37 41 52 67 59 103 91. You can easily sort that out in your head. I just got one error that …

Member Avatar
Member Avatar
+0 forum 17

What is the best way to practice C++ coding on Windows 7, and at the very least free? I want to get better at programming, but I don't have a compiler.

Member Avatar
Member Avatar
+0 forum 1

Hi every I'm new here and new to programming. : ) Here is a practice assignment I have completed but seemingly not correctly. Can anyone offer advice as to my error? It compiles correctly but using some test numbers I only ever recieve that the circle has no x intercepts *Text Problem* The standard form of an equation for a circle is (x − h)^2 + (y − k)^2 = r^X2 where (h,k) represents the center of the circle and r is the radius. The y-value of the equation becomes zero at the point of intersection with the x-axis. When …

Member Avatar
Member Avatar
+0 forum 2

hello, i was wondering if you could tell me what would you diffent/better on the following code. I am trying to become a better developer and i would like to learn what the best PHP pratice is. I remove the comments to make it a bit cleaner //THIS IS THE CLASS I USE TO CONNECT TO THE DB - I USE PDO class db { private static $instance = NULL; private function __construct() { } public static function getInstance() { if (!self::$instance) { self::$instance = new PDO("mysql:host=localhost;dbname=DB", '', '');; self::$instance-> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } return self::$instance; } private function __clone() { …

Member Avatar
Member Avatar
+0 forum 3

Background Due to a decrease in advertising profit, your favorite (and previously free) social networking site has decided to charge a monthly fee to each member. Frustrated, you set out to make your own social networking site, VisageTome. For now, you will need to make a class to store each person's name, favorite food, and list of friends. This class should include methods to access and modify these variables. You will also need to allow the user to modify this information. Requirements Part 1 - Make People Create a class to store the following information for each person: First name …

Member Avatar
Member Avatar
-1 forum 5

Hello everyone. First, a little about me. I started off web development in .Net (C#) and found it to be not suiting my style. Then I moved on to PHP and instantly fell in love with it. I've been practicing it for the last 40-45 days and have covered up most of the topics with ease. I'm also past the beginner mode in AJAX and Jquery, which are awesome by the way. As a result, I'm in a position where I would not need to be spoon fed the solutions (I hope) xD Back to topic, I'm currently working on …

Member Avatar
Member Avatar
+0 forum 10

Practicing C++ and here is two of the practice problems I pulled from the FAQ And practice post. Just want feedback and issues with the way I wrote these. Simple Calculator [CODE] #include <iostream> #include <string> #include <sstream> #include <stdlib.h> using namespace std; int main(void) { //cout << string(50, '\n'); cout << "Welcome to Simple Calc" << endl; cout << "Program will ask for two numbers and then a operation" << endl; string input = ""; string input2 = ""; char input3 = '+'; int sum = 0; while (true) { cout << "Numbers Only please, enter x at any …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone. Today I decided to write a little Caesar cipher script in Python. After tweaking the code and testing it, I shot up my browser and had a look at other snippets on the web. I was shocked at what I saw. All of the Python solutions I went over were implemented in ~30 LoC. My implementation is ~160 LoC. I was aware of my "descriptive" coding style i.e. I'm not really good at making my code shorter and more concise, but this was too much. A 130 LoC difference? Goddammit. I'll have to admit it though: my script …

Member Avatar
Member Avatar
+0 forum 6

I need to keep my coding skills up to snuff, but I'm having kind of a block. I don't know what to code. Anyone have any idea of some small projects that I can work on? Perhaps ones that would look good if i sent them to companies? Don't ask me to complete a project that is really your homework, as I won't be posting my completed code here, so you won't be getting your answer from me.

Member Avatar
Member Avatar
+0 forum 3

Hi! I've recently converted some C code to a bit more native C++. This included changing printf() statements to std::cout statements. However, some printf()'s are rather lengthy and annoyingly long (and human-error-prone) to write in std::cout. Example (and this one is a short one): C-style: [CODE]printf("ERROR %d: %s: %s\n", event, origin ? origin : "?", fulltext.c_str());[/CODE] C++-style: [CODE]std::cout << "ERROR " << event << ": " << origin ? origin : "?" << ": " << fulltext << "\n";[/CODE] I personally find the first way much more clear and easier to write. What is the recommended way to do this …

Member Avatar
Member Avatar
+0 forum 4

I know a lot of people have their own comforts and styles when it comes to scripting and coding, but... Some language documentations specifically state a naming convention that is considered best practice for their language, like Java specifying camelCase. However, PHP's online documentation doesn't specify a naming convention (from what I've found, at least). Google searching this topic yields a lot of discussions akin to "What is generally accepted?" but I was wondering if people here know if there is an authoritative answer on the topic. So, is it best practice to declare my variables... [code=php]$likeThis[/code] or [code=php]$like_this[/code] or …

Member Avatar
Member Avatar
+0 forum 4

Since I am a Python beginner, I was thinking about studying,and possibly working on some real-world software written in Python. So could you guys suggest some simple open source projects that I could use to study and, if possible, get involved with in development. Thanks.

Member Avatar
Member Avatar
+0 forum 1

Hi, i need help or advice on how to start a code i have to write. This is the details of the program with an example: [url]http://www2.cs.uh.edu/~acl/cs1410/prog6.pdf[/url] Any help or advice on how to go about this would be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 8

I'm going through K.N. King's introductory [i]C Programming: A Modern Approach (2e)[/i] and every time I see the code in the book, I can't help but wonder what's the better way to write your code in the following situation. Should I use the curly brackets or not, and how much does it matter? Here are the three versions of the same idea (I guess the last version is the worst): Version 1, with curly brackets: [code=C] while(1) { if(1) { i++; } } [/code] Version 2, without curly brackets: [code=C] while(1) if(1) i++; [/code] Version 3, condensed version of the …

Member Avatar
Member Avatar
+0 forum 4

I know: -basic cout/cin -declaring single integers/strings -currently learning 'for' loops as you can see, my knowledge is extremely limited as of now, and i wish to have a few practice problems to have a go at. May i have some suggestions?

Member Avatar
Member Avatar
+0 forum 6

The End.