257 Posted Topics
Re: I would accomplish this by adding each element (i.e. xcomputers) to an array. Then I would use a for loop and switch statement to output the number associated with each character. The for loop would iterate through the array and apply each letter to the ensuing switch statement, which then … | |
Re: Welcome to Daniweb. Keep at it. You won't become a good programmer without lots of practice and determination. I struggled with programming when I first started as well. Remember, Rome wasn't built in a day. I look foward to working with you in the future. | |
Re: I play the bass guitar. I love to play classic songs from Iron Maiden, Journey, etc. I also play new stuff too. Playing solo now because I don't know anyone who wants to join a band. Check out my profile for a pic of my current bass. However I plan … | |
Re: I like weekend mornings (Saturday and Sunday). No school to worry about. I just get to relax and do what I want. | |
Re: He asked for a book to learn, not for 170+ lines of code that he will have no idea how to use. He is trying to learn. Your code does absolutely nothing to help a beginner understand how vectors actually work. @OP follow Ancient Dragon's link for help with vectors. … | |
Re: When using a vending machine you insert your currency into slots in the machine. Then you select the desired item using buttons on the machine. In return you will recieve the desired item and change if you overpaid for the item. :) In case you can't tell I have no … | |
Re: Hi Irene welcome to Daniweb. I live pretty close to you (Pelham Bay in the Bronx) :) I can see by the two links you posted that you are a very good web designer. Enjoy your time here and keep up the good work! | |
Re: The way I stop the processing is by adding: [code=cplusplus] char wait; cout<<"Enter any key to exit"; cin>>wait; [/code] You can put this code anywhere in the program so you can view the output at your own pace. | |
Re: A function to calculate factorials in math is a common example of recursion. The function calls itself until it reaches its "base case", which in the factorial example is n=0. | |
Re: When I create classes in c++ I include the header and all of the functions, constructors, etc in the same file. I'd call it CPU.cpp. Then I create a new file with the main method with the following line: [code=cplusplus] #include "CPU.cpp" [/code] Not sure if that is neccesary but … | |
Re: You have a few problems with your code. I made some changes and got it to work. First, I made name a string value instead of a char. I also changed to while loop to: [code=cplusplus] while (name != "stop" ) { cout<<"Enter your friend's name (""stop"" to quit): "; … | |
Re: Create your variables and use cout statements to ask the user for the values of each variable. Then use cin>> to accept the user input for each variable. Post the code you have written so far, so the community will be more willing to help you. | |
Re: Why don't you look at this to get started: [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedList.html"]http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedList.html[/URL] | |
![]() | Re: Ask the user if he wants to fill the array manually or automatically using: [code=java] System.out.println("Would you like to enter manually of automatically?") [/code] Then use if statements to generate the different results. For example: [code=java] if(//user input == manually) //use a for loop to accept values up to the … |
Re: The first for loop accepts the user input integers and adds them to the vector. The second for loop adds up the number of individual integers in the vector. | |
Re: I think the new design is fine. I think it would be cool if we can filter posts by forum. For example: if I want to see all the posts I contributed to the Java forum I can filter all my posts by "Java". I'm in no way trying to … ![]() | |
Re: Number 100 makes me laugh. The warnings have been around for so long, yet people still smoke for some reason. What a crazy world we live in! I want to know why so many people out there risk there lives for such a pointless and easily avoidable reason. By the … | |
Re: C can have some murky syntax, especially with output and format specifiers. Be sure to post any questions you may have in the C forum. There are many experienced members in this community who are always willing to help. Just show some effort and remember to use code tags! Keep … | |
Re: Welcome to Daniweb. My insatiable love of video games is what inspired me to take up computer science and learn about programming as well. Good luck and great to have you aboard. | |
Re: Try wrapping your if and else if statements in a while loop. [code=java] while(choice != 0) { if... else if... else... } [/code] This should stop processing when the user enters 0. | |
Re: [QUOTE=Ancient Dragon;999827]lines 23 and 28[/QUOTE] I think Ancient Dragon meant to say lines 23 and [I][B]27[/B][/I]. :) Don't put semicolons after if and else. | |
Re: Declare a new array called Z[20]. Then use the following code to add the corresponding numbers. [code=cplusplus] for (int count = 0; count < 20; count++) { Z[count]=X[count]+Y[count]; cout<<Z[count]<<endl; } [/code] This code says: Take the values at position 'count' of arrays X and Y and add them together. Then … | |
Re: I would use a stack. Stacks work in a "first in last out" manner, meaning the first value entered will be the last output. Start with the value at "size" (which is how big the stack is) and work your way down to position 0. This is just my interpretation, … | |
Re: Welcome to Daniweb. When I started college 2 years ago I too had very little experience with programming. Don't worry, after a few classes you'll get quite good at programming. Take your computer science classes seriously and always seek help if you are unsure of a particular topic. I look … | |
Re: If you search for a javascript calculator in google, you'll find the code easily. Or you can actually try doing it yourself. The choice is your's. | |
Re: I would try: Make all of your variables of type double. Use println for output. [CODE=java] double total; double distance = 200.00; double ppg = 2.79; double parking = 5.50; double tolls = .35; double mpg = 31.5; System.out.println("Total Price is " + total ); [/CODE] Let me know if … | |
Re: For B you have to put greater than 80 and less than 90. Fix that for the other grades too. The way you have it now, entering 90 will output all grades higher than F. That should work. | |
Hello friends. I'm very new to C and am still learning how to do basic stuff. I got the code to work in C++ (which I'm much more fluent in) but I'm having trouble converting it to C code. [code=cpp] #include <iostream> using namespace std; double factorial( int n); int … | |
Re: Great work with the Simpson quotes. That show is so funny and should be watched by all. | |
Re: I couldn't agree with you more. I love to play RPG's, finish every single side-quest, and completely max out my characters. | |
Hey guys, I need your help with a very important matter. I'm starting a band with some of my friends from high school and we are odds in selecting a name for the band. My friend Ed wants the name to be Chicken N' Lamb (don't ask) while my brother … | |
Re: Hello C, welcome to Daniweb. It's great to have a fellow musician in the community (I play bass). Enjoy your time here! | |
Hello friends at Daniweb. Today I recieved my first Daniweb digest e-mail which implored people who have been members for many months to introduce themselves if they never had in the past. As I fall into this category, I would like to officially introduce myself now. My name is Tom … | |
Re: Hello and welcome to Daniweb. I love the video game Max Payne too. Can't wait to play Max Payne 3 coming this holiday season. Also, seeing as you live in Canada, I was just wondering if you are a fan of the Toronto Blue Jays. I live in America but … | |
Re: The scanner object from the Scanner class allows for interactive user input. | |
Re: [QUOTE=njungeb;878408]I play guitar (and occasionally drums) in the Praise team at our church.[/QUOTE] Cool! I'm also a musician and into the world of compter science. I am 20 years old and have been playing bass for several years (although I'm into a slightly different kind of music ;) ). Rock … | |
Re: Hi and welcome to Daniweb. Go to the Hardware and Software section, then go to Microsoft Windows and then Web browsers. I'm sure that you will find your answer there. | |
Re: Hi and welcome to Daniweb. Be sure to check out the web design sections of the web development forums (based on your post it seems that is what you are most interested in). I'm sure you will have much to add to the community. | |
Re: The top of the stack is -1 when the stack is empty. When you fill it using push(), the top will change. A return value of -1 lets the user know that the stack is empty. | |
Re: I coded for my object oriented design with Java final today. :S Mostly dealt with objects from the Collection heirarchy. I think I did pretty well.:) | |
Hello friends, I want to clear a table by clicking a button on a form. I have created the query to clear the table but I cannot make it the source for the command button on the form. Is this possible? Thanks for your time and help. | |
Hello friends, I'm working on a program that takes a number input from the user and recursively sums the number 'n' to one. For example, inputting a 5 would sum 1/5 + 1/4 + 1/3+ 1/2 + 1/1. I have sucessfully gotten the fraction sequence to display but I am … | |
Re: My hometown of Bronx, New York would be devestated. New York was one of the primary targets of the attack, so no surprise there. Let's hope this situation never becomes a reality. | |
Re: Javascript is used in web programming to create dynamic, interactive pages. I think every half way advanced site includes javascript. | |
Hello friends. I'm working on a program to sort a list object using toArray, Arrays.sort, and Arrays.asList. The problem asks that I then apply Collections.binarySearch directly to the list object. I know what the problem is (which I have stated through comments in my code) but I don't know how … | |
Hello, I'm facing another problem with vectors, this time with the problem of converting infix to postfix. The compile process completes, but I recieve an error after I enter the infix expression. Here is the exact error I recieve: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 43 >= 2 at java.util.Vector.removeElementAt(Vector.java:511) at … | |
Re: You forgot to put 'neither should change names' on the poll. That's my vote. | |
Re: First you can have the user input the number of values to input into the data structure(arrays are a good choice). Then use a for loop to ask the user to put in each value. | |
Re: You can achieve that by using a table with three rows. Set the top and bottom rows height to 10% and make the middle row 80%. However, this doesn't use divs and it looks like you want to. Sorry if this post is totally useless to you. | |
Re: preorder = visit node, left, right inorder = left, visit, right postorder = left, right, visit Repeat the process at each node. |
The End.