Sunday, August 2, 2009

Can you please check my c++ program?

#include%26lt;iostream.h%26gt;


#include%26lt;apvector.h%26gt;


#include %26lt;apstring.cpp%26gt;


void main();


{


do


{


apvector%26lt;int%26gt;age(5);


int num=0, a, b;


apstring choice;


cout%26lt;%26lt;"Enter the total sale from Monday through Friday: ";


for(int num1=0; num1%26lt;5; num1++;)


{


cin%26gt;%26gt;age[num];


num++;


}


cout%26lt;%26lt;"Select a number for the day of the week: \n";


cout%26lt;%26lt;"Monday = 1 \n";


cout%26lt;%26lt;"Tuesday = 2 \n";


cout%26lt;%26lt;"Wednesday = 3 \n";


cout%26lt;%26lt;"Thursday = 4 \n";


cout%26lt;%26lt;"Friday = 5 \n";


cin%26gt;%26gt;a;


b=a-1;


cout%26lt;%26lt;age[b]%26lt;%26lt;"\n";


cout%26lt;%26lt;"Do you wish to continue \n";


cin%26gt;%26gt;choice;


}while(choice!="No")


}





It is supposed to ask for the information, then the user picks what day's information they want to view, then the program should ask if they want to continue, if cout%26lt;%26lt;"no"; program should stop.

Can you please check my c++ program?
so does it work? there is no way for us to check. What does it do? what doesn't it do? You should also post what your header (.h) and the other .cpp file does, because without it, there is no way for us to tell what it is doing, or what it isnt doing. For example, can you declare *? I dont think you can, but if you say you can in the header or other cpp file, then I guess you can. But I dont know.





(also, i would repost this, as this question has reached below the bottom of the list =P)
Reply:I did not find any problem.


No comments:

Post a Comment