• Member Avatar for David W
    David W

    Replied To a Post in Overloading a function

    But ... >C doesn't allow overloaded functions.
  • Member Avatar for David W
    David W

    Began Watching Assignment : choosing robot with rule base system

    Hi there, I am planning to create one robot choosing center. But I do not know how to use the idea to execute in python software. my idea is, let …
  • Member Avatar for David W
    David W

    Replied To a Post in Assignment : choosing robot with rule base system

    Python lends itself to jumping right in and start coding... This example code below may give you some ideas about how to get started ... # selectRobot.py # # 2014-03-26 …
  • Member Avatar for David W
    David W

    Replied To a Post in Parallel Matrix Multiplicator

    You may like to see a version that uses dynamic memory... /*matrixStructMult2.c */ #include <stdio.h> #include <stdlib.h> #include <assert.h> typedef int myType; typedef struct twoDArray { myType **data; int rows; …
  • Member Avatar for David W
    David W

    Replied To a Post in password problem with function

    You may like to take a look at this ... // getPassWord.cpp // #include <iostream> using namespace std; // passing in by 'ref' so value in calling scope is updated …
  • Member Avatar for David W
    David W

    Replied To a Post in password problem with function

    Oops again :( Please see below ...
  • Member Avatar for David W
    David W

    Replied To a Post in password problem with function

    Oops ... see below please ...
  • Member Avatar for David W
    David W

    Replied To a Post in coinflip

    Hey ... in Assembly Language, the structures we use in 'structured programming' ... are all built up from jumps / goto's ... no worries :) And ... variety is nice …
  • Member Avatar for David W
    David W

    Began Watching coinflip

    after the 1st iteration the toss is 100 and then the iteration increases toss to 200 and then 300. Why is this happening i want toss to be made only …
  • Member Avatar for David W
    David W

    Replied To a Post in coinflip

    > Because maybe he need to show example of goto statement, I don't care about reasons. Problem is solved and that's all I care about. @Kristian_2 You do know that …
  • Member Avatar for David W
    David W

    Replied To a Post in search function

    You seem to be making an easy thing hard ... See this example of reading a 2D matrix from file, printing it back and then searching it to find a …
  • Member Avatar for David W
    David W

    Began Watching Please explain this bit of code

    I got this code from the internet. import random #create a sequence of words to choose from name = ("stephen","bob", "robert","craig") # pick one word randomly from the sequence word …
  • Member Avatar for David W
    David W

    Replied To a Post in Please explain this bit of code

    > hint_prompt = hint_prompt.lower() the string is converted to all lower case
  • Member Avatar for David W
    David W

    Began Watching Parallel Matrix Multiplicator

    Hi, I have to create a program that creates N child processes, and they muliply the matrix. I have some base codes but when I try to run them they …
  • Member Avatar for David W
    David W

    Replied To a Post in Parallel Matrix Multiplicator

    Or ... start bottom up ... and code in small steps ... making sure that it 'works' as expected, (gives exact desired output), at each step ... and that YOU …
  • Member Avatar for David W
    David W

    Began Watching Checking for First, last and Maximum and minimum

    I am having problem getting the final result here, it keeps on looping. #include<stdio.h> #include<string.h> #include<conio.h> #include<math.h> #include<stdlib.h> #include<ctype.h> int main() { int i, t, k, max, min, sumof; printf("Enter …
  • Member Avatar for David W
    David W

    Replied To a Post in Checking for First, last and Maximum and minimum

    Sometimes ... the obvious ... is alarmingly simple ... when you 'see' it :) C arrays start at index 0, so next in, from front, has index 1, and ... …
  • Member Avatar for David W
    David W

    Began Watching substrings

    Write a program that takes two input strings S1 and S2 and finds if S2 is a substring of S1 or not. If S2 is a substring of S1, the …
  • Member Avatar for David W
    David W

    Replied To a Post in substrings

    Show the code you have ... and where you think you are stuck ...
  • Member Avatar for David W
    David W

    Began Watching spiral matrix

    Write a program that reads an MxN matrix A and prints its elements in spiral order. You should start from the element in the 0th row and 0th column in …
  • Member Avatar for David W
    David W

    Replied To a Post in spiral matrix

    Show the code you have ... and where you think you are stuck ...
  • Member Avatar for David W
    David W

    Began Watching The Greatest Common divisor

    The greatest common divisor of integers x and y is the largest integer that evenly divides both x and y. Write a recursive method Gcd that returns the greatest common …
  • Member Avatar for David W
    David W

    Replied To a Post in The Greatest Common divisor

    Hey ... start a new thread please ... did you not see that one was 5 years OLD ? int main() // not void main in standard C { // …
  • Member Avatar for David W
    David W

    Began Watching password problem with function

    I am trying to write a code that checks if password is pass with the use of functions...but i am not able to ....Please help me i am a beginner....and …
  • Member Avatar for David W
    David W

    Replied To a Post in password problem with function

    Show us the code you have so far ... are where you think you are stuck. Here is a student beginner level example of using functions to validate user input …
  • Member Avatar for David W
    David W

    Replied To a Post in Someone, please help!

    Do you 'see' the output here ... yes it prints '64' ! cout << "\nThe following (new array_list) " << "is not from file\n\n"; SortedList x; cout << "Inserting 64 …
  • Member Avatar for David W
    David W

    Began Watching search function

    i have this for my requirement assignment: Write a search function int get_index(const float astm[?][?], const int size) to find the array index from a given size. can someone give …
  • Member Avatar for David W
    David W

    Replied To a Post in search function

    Show the code you have so far ... and where you think you get stuck.
  • Member Avatar for David W
    David W

    Began Watching program

    Write a program that reads an MxN matrix A and prints its elements in spiral order. You should start from the element in the 0th row and 0th column in …
  • Member Avatar for David W
    David W

    Replied To a Post in program

    You need to show the code you have so far ... and where you are stuck.
  • Member Avatar for David W
    David W

    Began Watching Guys help please.

    create a code that will read a file for an input which is a matrix,(rows and columns of the integers) and be able to output the transpose of it. original …
  • Member Avatar for David W
    David W

    Replied To a Post in Guys help please.

    You need to show the code you have so far ... and let us know where you are stuck.
  • Member Avatar for David W
    David W

    Began Watching c++ program that would display the menu of a restaurant

    guys sorry about my post earlier . this is what i did with my program but i dont think my equation is correct because whenever i want to get the …
  • Member Avatar for David W
    David W

    Replied To a Post in c++ program that would display the menu of a restaurant

    Using several functions ... a function for each task ... could really help your program development ... and help elucidate the logic flow. // restaurant.cpp // #include <iostream> #include <string> …
  • Member Avatar for David W
    David W

    Began Watching sorry about my post earlier regarding a restaurant menu.please help me .

    guys help with this. sorry about my post earlier. im just new here in daniweb comm. i dont know the rules yet. i have a problem . i don't know …
  • Member Avatar for David W
    David W

    Replied To a Post in sorry about my post earlier regarding a restaurant menu.please help me .

    Since you are using C++, why not use C++ string (not C string) And don't use (risky) gets ... (even in C) In C++ with C++ string `#include <string>` then …
  • Member Avatar for David W
    David W

    Began Watching python Notebook: Changing the written file.

    Hello, I am new to python and I am trying to do this task but it looks that I am missing some things which is not visible to me can …
  • Member Avatar for David W
    David W

    Replied To a Post in python Notebook: Changing the written file.

    Perhaps your design spec's... really does want you to copy each user input to a file (append to a file) ... right away after each line has been input? The …
  • Member Avatar for David W
    David W

    Replied To a Post in Someone, please help!

    This example may give you some ideas how your above code could be re-coded using C++ idioms (and not Java idioms) ... // insertSortedAryList.cpp // #include <iostream> #include <fstream> //#include …
  • Member Avatar for David W
    David W

    Replied To a Post in Adding lines of text to file that may not exist

    > It is never recommended to use the input with evaluation. Are you above talking about Python 3? I would change that to ... It is robust coding style that …
  • Member Avatar for David W
    David W

    Replied To a Post in Adding lines of text to file that may not exist

    Ok ... but then ... in Python 2.x... num = input( msg ) # always? returns a string # and your 2.x... code may have ... # been expecting a …
  • Member Avatar for David W
    David W

    Began Watching convert c++ code to python code

    I have never learn python and i need to write one small program in it. I have C++ code so can someone convert that code to python code ? code: …
  • Member Avatar for David W
    David W

    Replied To a Post in convert c++ code to python code

    Once you get started coding in Python ... and get some feel for its (often very) simple coding style and power ... you may then want to DO many of …
  • Member Avatar for David W
    David W

    Began Watching Adding lines of text to file that may not exist

    Here is simple text file example for beginners, using try..except for reading old content as it may not yet exist.
  • Member Avatar for David W
    David W

    Replied To a Post in Adding lines of text to file that may not exist

    @pyTony: Can one still use raw_input in Python 3 ?
  • Member Avatar for David W
    David W

    Began Watching getting values from file records

    python3 Hi I am trying to compare these two (strings) of numbers. There may not be a space inbetween the numbers in the file, but here its just for clearity. …
  • Member Avatar for David W
    David W

    Replied To a Post in getting values from file records

    You could try something like this ... (that uses the code given you by @Gribouillis ... slightly revised ... and with comments added that may help explain it for you.) …
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Maybe ... You could 'wrap' the 'flag' variables in their own namespace ... namespace MyFlags { bool from_User = false; bool to_Screen = true; bool update_Changes = false; }
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Oops above link is dead, try this: [example bubble sort with function pointers](http://www.4shared.com/folder/UKgVr0n1/distanceTwoCitiesSteps.html)
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Ok ... I would recommend a few revisions ... If you were to use function pointers, (for the compare functions in your 3 different bubble sorts), you could vastly reduce …

The End.