zeroliken 79 Nearly a Posting Virtuoso

At line 9 change the sign from "&2s" to "%s"

zeroliken 79 Nearly a Posting Virtuoso

your missing the starting curly brace of the main function

also will this program work correctly???

it "should" work but it doesn't match your requirements
at your loop you didn't prompt the user for input again

zeroliken 79 Nearly a Posting Virtuoso

the first one checks for order if it's greater than, less than or equal to the object it is being compared with and returns a specified value given the result

the equals method checks for the equivalence of the objects with their values

the == works similarly as the equals method but it also checks wether the references to the object are equal

my opinion is since you only need to check if the list have duplicates the first option wouldn't be necessary
if the list contains elements that have primitive data types use '==' else use equals method
you can test each option and see for yourself which is appropriate, if you have doubts you can always check the API

zeroliken 79 Nearly a Posting Virtuoso

you haven't started the thread, add this on your start method

Thread th = new Thread (this);
th.start();
zeroliken 79 Nearly a Posting Virtuoso

variable total has no value, doesn't numScores represent the number of scores in the array?

zeroliken 79 Nearly a Posting Virtuoso

your condition at line 27 is causing this, if your input is valid it will always pass the loop condition thus printing the menu again

zeroliken 79 Nearly a Posting Virtuoso

Is this the best way to do it?

that would depend on several factors like resources, target audience, proposed project details, time allowance, etc.

For resources you'd need to have a platform where you can create the game like Flash CS series or macromedia which doesn't come cheap.

For a ping pong game it would be a bit easy to make, this project should be beginner friendly

I'd like to say more about other details but since I don't have know much info yet I'll leave it at this.

Is it the only way?

No since you learned Java you should be well aware of Java Applets (though not that abundant)
As of HTML5, CSS3 and javascript you could create pure web browser games that could do as much as flash and more with this you wouldn't have resource constraints like in flash where you should afford the platform though you do need to be aware for different browsers compatibility

You could do a web search of each and see for yourself their capabilities

What would be important aspects to consider?

I don't know how far have you've learned from other languages like Java but if you have experience creating a game with coordinates and threading for concurrency then it wouldn't be too hard (or too long ) to learn.

A good background on math (namely calculus) would help, for example coordinate based movements for AI, object physics and environment interaction.

As a …

zeroliken 79 Nearly a Posting Virtuoso

I'm missing the middle part " "

print quotation marks before and after the loop/process that does the operation

zeroliken 79 Nearly a Posting Virtuoso

yes there's a lot if you search

zeroliken 79 Nearly a Posting Virtuoso

A simple solution would be to place all the elements inside a division that has a fixed width

zeroliken 79 Nearly a Posting Virtuoso

He's a moderator he can delete each and every post from this whole thread

zeroliken 79 Nearly a Posting Virtuoso

He's probably just doing a test run for some functions regarding the site to check for bugs etc. and this thread will probably be deleted as soon as he's done with whatever he's doing

zeroliken 79 Nearly a Posting Virtuoso
for(int i = 0; i < list1.size() - 1; i++){
        if(list1.get(i).compareTo(list2.get(i)) == 0){
            list1.remove(list2.get(i));
        }
    }

once an element is removed from either list their sizes will be different from the other. So you can't compare the remaining elements of a list with the others original position

You could use a nested loop to check if a value from a list is present with every element from the other

zeroliken 79 Nearly a Posting Virtuoso

as I see it it's like this

the checking starts with 0 (list indeces start with 0) so it would look like

movies [ 0 , 1 , 2 , 3 , [ 0 , [ 0 , 1 , 2 , 3 ] ] ]

where the 4th one is a list and inside it the second one is a list

so from left to right [4][1][3] should point to Eric Idle

zeroliken 79 Nearly a Posting Virtuoso

Also, why is this needed?

change = tenDollar % 10 ; // calculate the change needed

he probably wanted the remaining decimal values to use for the quarter computation but this wouldn't work since tenDollars is an integer type and he can't use the modulo operator for float type variables

myk45 commented: Agreed :) +0
zeroliken 79 Nearly a Posting Virtuoso

Could you give more details about the problem like any error messages or program output

also take note that printf function is part of the C stdio header

zeroliken 79 Nearly a Posting Virtuoso

I currently have a subject titled "Introduction to Computer Organization and Machine-Level Programming" which focuses on Assembly language on 32 bit systems with Nasm as the compiler and uses Intel style syntax.

Having studied first high level languages first like C and Java I struggled a bit with Assembly which requires a lot of instructions to perform simple tasks which only takes a few lines for high languages to perform. Despite this unlike the high level lang I get to actually view the compute's memory storage and allocation for the program which answers some of the questions I'd have during the first years of my CS course

Now for other OS, correct me if I'm wrong as I recall Windows was built using C and also in Assembly(but the latter's only minimal)

zeroliken 79 Nearly a Posting Virtuoso

-use an array of integers for the variable
-each loop has an initialize value of zero, and a condition that it only increments up to 1
-the statement inside each loop is composed of changing the leftmost or rightmost value of the array going right if following from the former or left if from the latter
-in the innermost loop print the array

here's an example using 2 digit binary

int a[2];
    for(int i = 0; i<2; i++){
        a[0] = i;
        for (int j = 0; j<2; j++ ){
            a[1] = j;
            /*prints the whole array from the innermost loop*/
            for(int k = 0; k<2; k++){
                printf("%d", a[k]);  
            }
            printf("\n");

        }
    }
I_m_rude commented: nice explaination :) +2
zeroliken 79 Nearly a Posting Virtuoso

Not too surprised for Apple to make this move.
This is just another petty attempt to monopolize the market on mobile devices and this is another example on how low they can get.

I'm more surprised the court actually sided with Apple with this one than the whole issue of Apple sueing Samsung over the designs.
Come on.. they have the copyright on round corners on icons and necessary softwares for touch screen technology and the court actually believed this.

happygeek commented: the phrase beggars belief comes to mind, doesn't it? +11
zeroliken 79 Nearly a Posting Virtuoso

store the years in an array,
loop through the array and print out the element if it is properly divisible by 4

zeroliken 79 Nearly a Posting Virtuoso

returns the index where the current element of array y is equal to x, else returns -1 if the value of x is not in the array

zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso

What I am considering is dual-booting my Windows computer with it.

Any advice?

try Wubi for ubuntu

PhilEaton commented: great for beginners! +0
zeroliken 79 Nearly a Posting Virtuoso

cout<<root->info;

shouldn't that be printf(), this is the C forum after all

zeroliken 79 Nearly a Posting Virtuoso

111100/11000: strcpy doesn't compare but compys from one string to another

you missed reading a word in my previous comment

... and strcmp in comparing the 2 string

111100/11000 commented: Thanks +0
zeroliken 79 Nearly a Posting Virtuoso

try to use strcpy in assigning a value to chouseing_alphabet and strcmp in comparing the 2 string

zeroliken 79 Nearly a Posting Virtuoso

how to do the total of value in the array ben[20]

use a loop and make a variable where every element of the array will be added to it

have to use function or other ???????

do you mean you need to use a function for the adding process?
then just pass the array to a function (as a parameter) then do the same process as I stated before
e.g.
in main:

    sum = totalofarray(ben);

at function:

    int totalofarray(int ben[]){
        int total;
        //do process of adding values to total 
        return total;
    }
zeroliken 79 Nearly a Posting Virtuoso

line 42: try

int answer(int x,int y)

now there is another problem . I don't get answers to 11xanything ,12xanything. help

next change to the ff.

at line 5: int mutab[12][12];
at line 10: for (int h=0;h<12;h++)
at line 18: for (int i=0;i<12;i++)
at line 31: for (int k=1;k<13;k++)

zeroliken 79 Nearly a Posting Virtuoso

here's a pseudocode to give you a hint:

    x = 5
    while the value of x is not equal to 0 
        y = 5
        while the value of y is not equal to 0 
        if the value of y less than or equal to x
            print an asterisk
        else
            print a space
            decrement y;
        end while
        decrement x
        print a newline
    end while
zeroliken 79 Nearly a Posting Virtuoso

find a good web host, there are free ones you can use or commercial ones that costs per month (depends on your needs)
then just upload your site to your Host

zeroliken 79 Nearly a Posting Virtuoso

It's the space between people that makes a relationship

zeroliken 79 Nearly a Posting Virtuoso

It prints out 0 because it takes noOfdigits, stores a copy then adds 1 and returns the copy. So you get the value of what it was, but also increments it at the same time. Therefore you print out the last value though it gets incremented.

zeroliken 79 Nearly a Posting Virtuoso

actually it's undefined behavior
see this similar thread for clarifications and read WaitP and Narue's comments

zeroliken 79 Nearly a Posting Virtuoso

Some things are beautiful because they cannot be obtained

zeroliken 79 Nearly a Posting Virtuoso

What do you mean by doesn't pause correctly?

The first one and second one works the same
also at the first code there's a trailing semicolon on the for loop @ line 44

for(x=0;x<25;x++); {
zeroliken 79 Nearly a Posting Virtuoso

Lets say I didnt know what the elements were in the array...

I don't think this would be an issue since the concern would be pairing the indexes(position of each element) of the array

...or how many elements there were

I think using a counter for the number of elements should suffice or make a dynamic array so that there won't be any unnecessary space

zeroliken 79 Nearly a Posting Virtuoso

Hmmm... sounds good! How do we do that????? how to make our own header???

Have you searched the web for examples?

N i guess there is a way to call a program in some other program! thats why we use int main() right???

Now this is different than just using simple header files
Here's a link that should help you get started
http://www.gidforums.com/t-3369.html

zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso
  • you haven't created yet a variable grade

float TestAverage = (test1 + test2 + test3)/3;
float LabAverage = (lab1 + lab2 + lab3)/3;
float NotesAverage = (notes1 + notes2 + notes3)/3;

  • there's no need to redeclare their data type

cin << TestAverage + LabAverage + NotesAverage;

  • you probably meant to store their summed value to grade (which you still need to declare) instead of asking their value from the user

I thought I already did when I list them as float's

the only variables listed as floats are TestAverage, LabAverage, NotesAverage and not grade

zeroliken 79 Nearly a Posting Virtuoso

if i want to make x the constant or in c u call define.,how can i go about?

before main,
#define x 2.55

zeroliken 79 Nearly a Posting Virtuoso

Did you post the whole code? I don't see any loop that will print the output again
I tried the program with linux gcc and windows cgwin compiler and got only one output...

zeroliken 79 Nearly a Posting Virtuoso

12/12/2012 then the date for tomorrow displays a list of dates

could you post a sample output of the code
I'm unable to duplicate the problem since I got only one date for the output when I entered 12/12/2012

zeroliken 79 Nearly a Posting Virtuoso

to do it
highlight all of your code and press the Code button or simply press tab from your keyboard

also are there any error messages for your code, could you post that as well or if not describe what happens when you run it

zeroliken 79 Nearly a Posting Virtuoso

a whole different set of ascending numbers after the sort

for(i=0;i<s;i++){
a[i]=rand()%100+1;}

the values you assign to the array are different than the values you displayed on the previous while loop
print the values of the array in this loop to see

dij_0983 commented: right +2
zeroliken 79 Nearly a Posting Virtuoso

I am looking for a code to ask the user to input a string int a function.

research scanf(), strings, i/o, in c on the web and you'll find lots of examples

I'll be taking a computer science class next year and I try to
do some understand some basics.

check the tutorials here http://www.daniweb.com/software-development/c/threads/50370/starting-c-

dij_0983 commented: been trying to find tutorial link for a while already +2
zeroliken 79 Nearly a Posting Virtuoso

your program might have used a function or a variable which is not defined in any of the object files or libraries supplied to the linker.
this might have been caused by a missing library or using an incorrect name

zeroliken 79 Nearly a Posting Virtuoso

I have a problem. If the text is too long in the text file...the program crashes. How to solve it?

IF the texts inside the text file are within the number of characters to be read in fgets() and is within the length of the array then this is not the problem,

I am storing the strings (spaces included)

it's already being stored in the string search (line by line with space included)

moreover I cannot reproduce the same problem ,could you post a sample output of the program

zeroliken 79 Nearly a Posting Virtuoso

It can read the first line just fine
quick question why are you using fgets twice?

zeroliken 79 Nearly a Posting Virtuoso

@ line 6
your assigning a value to the null terminator of the matrix

i want the elemnets of every matrix is random number using time function

instead you should make a nested loop that traverses it's indexes and inside that loop it assigns a random value for the current index

Ancient Dragon commented: right :) +0
zeroliken 79 Nearly a Posting Virtuoso

i am really not sue how to add in the .56 probablity thing

here's one way:
considering that you know how to use rand()
you could randomize a value from 0 to 99 and if it lands between 0-55 player ada wins else if it's 56 - 99 the other player wins

Eagletalon commented: agree with the function suggested 100% +0