"It is easy to learn C++,if you have the good knowledge of C".C++ language is basically an Object Oriented language. Therefore it is also called as Object Oriented Programming(OOP) . The difference between C and OOP is that-----
In C, program is divided into different functions.
In C++,it is divided into no. of objects.
There are some extra features in OOP. They are as follows :
1) Data hiding.
2) Encapsulation.
3) Inheritance.
4) Operator Overloading.
5) Polymorphism.
6) It includes all the featuers of C.
Hello…To C++ Programmers, Would you please tell about the Map of learning C++ LANGUAGE?
First of all read C++ basics like OOPS, then Charcter Sets, Keywords, Variable, Data Types. Then read about Classes and Objects, then try to solve simple questions then move to Conditonal statements(If-Else),then Switch, then Looping and so on
land survey
Tuesday, July 14, 2009
C++ Programmers i realllllly need ur help!!!?
if you can please do this program for me or guide me as to how to do this it would be MUCH appreciated. This is all i can do: (i can only find the remaining time of the same day, not of a specific date)
#include %26lt;iostream%26gt;
#include %26lt;string%26gt;
#include "ccc_time.cpp"
#include %26lt;cmath%26gt;
using namespace std;
int main ()
{
Time t;
int gethour, getmin, min, hour, remain;
gethour = (t.get_hours()%12)*60;
getmin = t.get_minutes();
cout%26lt;%26lt;"Enter the time that the Exam will begin (hh mm): "; cin%26gt;%26gt;hour%26gt;%26gt;min;
remain = abs((gethour + getmin) - ((hour*60) + min))
hour = remain/60;
min = remain%60;
cout%26lt;%26lt;"You still have "%26lt;%26lt;hour%26lt;%26lt;" hours and "%26lt;%26lt;min%26lt;%26lt; " minutes to prepare for the Exam.\n";
return 0;
}
Write a program that asks for the due date of the Midterm (hour, minutes). Then print the
number of minutes between the current time and the date of the midterm in the form “You still have XX
hours and YY minutes to prepare for the midterm.”
C++ Programmers i realllllly need ur help!!!?
If you are still stuck, may be you can contact a C++ expert at website like http://askexpert.info/
#include %26lt;iostream%26gt;
#include %26lt;string%26gt;
#include "ccc_time.cpp"
#include %26lt;cmath%26gt;
using namespace std;
int main ()
{
Time t;
int gethour, getmin, min, hour, remain;
gethour = (t.get_hours()%12)*60;
getmin = t.get_minutes();
cout%26lt;%26lt;"Enter the time that the Exam will begin (hh mm): "; cin%26gt;%26gt;hour%26gt;%26gt;min;
remain = abs((gethour + getmin) - ((hour*60) + min))
hour = remain/60;
min = remain%60;
cout%26lt;%26lt;"You still have "%26lt;%26lt;hour%26lt;%26lt;" hours and "%26lt;%26lt;min%26lt;%26lt; " minutes to prepare for the Exam.\n";
return 0;
}
Write a program that asks for the due date of the Midterm (hour, minutes). Then print the
number of minutes between the current time and the date of the midterm in the form “You still have XX
hours and YY minutes to prepare for the midterm.”
C++ Programmers i realllllly need ur help!!!?
If you are still stuck, may be you can contact a C++ expert at website like http://askexpert.info/
C++ programmers hand example?
help
C++ programmers hand example?
class Hand
{
Hand() {};
~Hand() { cerr %26lt;%26lt; "Ouch!" };
int numFingers() { return simpsons() ? 4 : 5; }
Sound* clap() { return SoundDB()-%26gt;oneHandClapping(); }
};
That's the best I can do with the info provided....
Reply:John's answer was brilliant.
C++ programmers hand example?
class Hand
{
Hand() {};
~Hand() { cerr %26lt;%26lt; "Ouch!" };
int numFingers() { return simpsons() ? 4 : 5; }
Sound* clap() { return SoundDB()-%26gt;oneHandClapping(); }
};
That's the best I can do with the info provided....
Reply:John's answer was brilliant.
C programmers! help pls?
what is the code to:
1. display NEATLY a 10 x 10 multiplication table
2. display a 12-month calendar by asking user some info about the starting day
using nested "for" loops only..thanks a lot!
C programmers! help pls?
#include %26lt;stdio.h%26gt;
int main() {
// Part1.
for (int i = 1; i %26lt;= 10; i++) {
for (int j = 1; j %26lt;= 10; j++) {
printf("%3d ", i*j);
}
printf("\n");
}
// Part2.
int daysInMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
char *monthName[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
int w;
printf("what day is Jan 1 (0-Mon, 6-Sun):");
scanf("%d", %26amp;w);
for (int i = 0; i %26lt; 12; i++) {
printf("%12s\n", monthName[i]); // Month name in the middle.
for (int j = 0; j %26lt; (w%7); j++) printf(" "); // Empty spaces for the first week of the month.
for (int j = 0; j %26lt; daysInMonth[i]; j++) {
printf(" %2d", 1+j);
w = (w+1)%7;
if (w == 0) printf("\n"); // w is the weekday.
}
printf("\n");
}
return 0;
}
Reply:10 x 10:
for (x=1;x%26lt;=10;x++)
{
for(y=1;y%26lt;=10;y++)
{
cout%26lt;%26lt;x*y%26lt;%26lt;"\t";
}
cout%26lt;%26lt;"\n";
}
1. display NEATLY a 10 x 10 multiplication table
2. display a 12-month calendar by asking user some info about the starting day
using nested "for" loops only..thanks a lot!
C programmers! help pls?
#include %26lt;stdio.h%26gt;
int main() {
// Part1.
for (int i = 1; i %26lt;= 10; i++) {
for (int j = 1; j %26lt;= 10; j++) {
printf("%3d ", i*j);
}
printf("\n");
}
// Part2.
int daysInMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
char *monthName[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
int w;
printf("what day is Jan 1 (0-Mon, 6-Sun):");
scanf("%d", %26amp;w);
for (int i = 0; i %26lt; 12; i++) {
printf("%12s\n", monthName[i]); // Month name in the middle.
for (int j = 0; j %26lt; (w%7); j++) printf(" "); // Empty spaces for the first week of the month.
for (int j = 0; j %26lt; daysInMonth[i]; j++) {
printf(" %2d", 1+j);
w = (w+1)%7;
if (w == 0) printf("\n"); // w is the weekday.
}
printf("\n");
}
return 0;
}
Reply:10 x 10:
for (x=1;x%26lt;=10;x++)
{
for(y=1;y%26lt;=10;y++)
{
cout%26lt;%26lt;x*y%26lt;%26lt;"\t";
}
cout%26lt;%26lt;"\n";
}
C Programmers, help me please...?
how can I count a certain letter or digit in a word?
let's say
MISSISSIPPI
1=M
4=I
4=S
2=P
it would me more appreciated if your answer would be string, array, etc.
C Programmers, help me please...?
char *mystring = "MISSISSIPPI";
int length = strlen(mystring);
int countletters(char str[])
{
int count = 0, k = 0;
while (str[k] != '\0')
{
if (str[k] == 'YOUR LETTER')
count++;
k++;
}
return count;
}
hope this will solve your issues
Cheers:)
Reply:hello friends! i am prabhakar gunturi. iam sure that below solution will work. after that you please send this type of questions to my mail. waiting for your mail.
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
#include%26lt;string.h%26gt;
static int flag[100];
void main()
{
static int count,l,i,j;
char sentence[100];
clrscr();
printf("enter any string");
gets(sentence);
l=strlen(sentence);
for(i=0;i%26lt;l;i++)
{
count=1;
for(j=0;j%26lt;l;j++)
{
if(flag[i]!=1)
{
if(toupper(sentence[i])==toupper(sentenc...
{
count++;
flag[j]=1;
}
}
}
if(flag[i]!=1)
printf("The character %c presents %d times in the given string",sentence[i],count);
}
Reply:If you're looking for a specific character, do:
int CountCharacters(char *str, char find)
{
int count;
for (count=0; *str; str++ )
{
if ( *str == find )
count += 1;
}
return count;
}
Building on that (although definitely not especially efficient since it requires scanning the string for each letter), if you wanted output:
void CountCharacters(char *str)
{
char *find;
char *findPointer;
find = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for ( findPointer = find; *findPointer; findPointer++ )
{
int count;
count = CountCharacters(str, *findPointer);
if ( count %26gt; 0 )
{
cout %26gt;%26gt; *findPointer %26gt;%26gt; "=" %26gt;%26gt; count %26gt;%26gt; "\r\n";
}
}
}
Reply:qsort(string,sizeof(char),strlen(string)...
char*ptr = string1;
char chars[strlen(string)] = {0,0};
int count[strlen(string)] = {1,1....};
i=0;
while(*ptr)
{
if(*prt == *(ptr+1))
{chars[i] = *ptr;count[i]++;}
else
{chars[i] = *ptr;i++;}
}
survey software
let's say
MISSISSIPPI
1=M
4=I
4=S
2=P
it would me more appreciated if your answer would be string, array, etc.
C Programmers, help me please...?
char *mystring = "MISSISSIPPI";
int length = strlen(mystring);
int countletters(char str[])
{
int count = 0, k = 0;
while (str[k] != '\0')
{
if (str[k] == 'YOUR LETTER')
count++;
k++;
}
return count;
}
hope this will solve your issues
Cheers:)
Reply:hello friends! i am prabhakar gunturi. iam sure that below solution will work. after that you please send this type of questions to my mail. waiting for your mail.
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
#include%26lt;string.h%26gt;
static int flag[100];
void main()
{
static int count,l,i,j;
char sentence[100];
clrscr();
printf("enter any string");
gets(sentence);
l=strlen(sentence);
for(i=0;i%26lt;l;i++)
{
count=1;
for(j=0;j%26lt;l;j++)
{
if(flag[i]!=1)
{
if(toupper(sentence[i])==toupper(sentenc...
{
count++;
flag[j]=1;
}
}
}
if(flag[i]!=1)
printf("The character %c presents %d times in the given string",sentence[i],count);
}
Reply:If you're looking for a specific character, do:
int CountCharacters(char *str, char find)
{
int count;
for (count=0; *str; str++ )
{
if ( *str == find )
count += 1;
}
return count;
}
Building on that (although definitely not especially efficient since it requires scanning the string for each letter), if you wanted output:
void CountCharacters(char *str)
{
char *find;
char *findPointer;
find = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for ( findPointer = find; *findPointer; findPointer++ )
{
int count;
count = CountCharacters(str, *findPointer);
if ( count %26gt; 0 )
{
cout %26gt;%26gt; *findPointer %26gt;%26gt; "=" %26gt;%26gt; count %26gt;%26gt; "\r\n";
}
}
}
Reply:qsort(string,sizeof(char),strlen(string)...
char*ptr = string1;
char chars[strlen(string)] = {0,0};
int count[strlen(string)] = {1,1....};
i=0;
while(*ptr)
{
if(*prt == *(ptr+1))
{chars[i] = *ptr;count[i]++;}
else
{chars[i] = *ptr;i++;}
}
survey software
C programmers, have you seen this before?
I was comparing two floating point numbers to determine when to exit a loop. One floating point was set to 2 (float1). The other started at 1 (float2) and was incremented by 0.2. The loop was supposed to exit when the second floating point got to 2.2 (as in loop while(float2 %26lt;= float1), but it would always exit at 1.8. The only way I could fix it was to do a (fabs(float1 - float2) %26lt; 0.01), along with an or statement of float1 %26lt; float2.
I watched the numbers in the debugger, and it wasn't as if it said 2.00001 when it incremented to 2. Basically, it looked as if it was saying 2 is not equal to 2. I thought I was going insane!!! How could 2 not be equal to 2??? But I guess with floating points, there some issue with precision?
C programmers, have you seen this before?
Yes. This happens. Its a problem when you're dealing with floating point numbers. Like 1/3, which cannot be represented by a finite set of numbers (3.333....) floating point numbers have some variance.
Reply:Use abs(f1-f2) %26lt; epsilon(very small number) to compare them
I watched the numbers in the debugger, and it wasn't as if it said 2.00001 when it incremented to 2. Basically, it looked as if it was saying 2 is not equal to 2. I thought I was going insane!!! How could 2 not be equal to 2??? But I guess with floating points, there some issue with precision?
C programmers, have you seen this before?
Yes. This happens. Its a problem when you're dealing with floating point numbers. Like 1/3, which cannot be represented by a finite set of numbers (3.333....) floating point numbers have some variance.
Reply:Use abs(f1-f2) %26lt; epsilon(very small number) to compare them
37m india,recently started learning c++ and java,what else should I do to get good job as software programmer?
i am a businessman,and want to switch to software programming as profession,i don`t have any computer background.
37m india,recently started learning c++ and java,what else should I do to get good job as software programmer?
SAP ABAP programming
Reply:in programing languages use for only coding. you want to know entire life subjects ie accounancy,managments.analising designing and everythig
Reply:Dear PS:
1.All you have to do is practise programming using Open source projects, so that you can gain experience to go any projects using the language C++ or Java
2. Learning Java alone will not fetch you any job you dream or desire in this world anymore, add spices like J2EE.
3.Begin yourself in any software concern as a fresher or programme trainee.
$. Rest you'll get to know how you can get ur dream job.
Reply:Do the following
1.Learn the programming from a reputed institute like NIIT etc
2.Make a one page CV
3.Register yourself with naukri.com,timesjobs.com, monsterindia.com and many more
4.Send your Cv to Infosis,Wipro,Tcs,Cognigent etc
5.Your desire will be fulfilled
Reply:Learn programming %26gt; write (good) programs %26gt; sell programs.
Reply:You're already learning the right things as far as which languages to learn. C++ especially is very valuable to professional programmers.
What you need to do next is to get properly certified by whatever authority certifies programmers in your area. After that, its simply a matter of finding someone to hire you.
Hint: Practice developing software by working on some Open Source projects. These are programs in which their creator has decided to make it free to anyone, and in which any programmer in the world is allowed to modify it and make it better. By participating in an Open Source project, you will gain experience working on real-world software, and be in direct communications with highly-experienced programmers who can help teach you.
Good luck, hope everything works out!
37m india,recently started learning c++ and java,what else should I do to get good job as software programmer?
SAP ABAP programming
Reply:in programing languages use for only coding. you want to know entire life subjects ie accounancy,managments.analising designing and everythig
Reply:Dear PS:
1.All you have to do is practise programming using Open source projects, so that you can gain experience to go any projects using the language C++ or Java
2. Learning Java alone will not fetch you any job you dream or desire in this world anymore, add spices like J2EE.
3.Begin yourself in any software concern as a fresher or programme trainee.
$. Rest you'll get to know how you can get ur dream job.
Reply:Do the following
1.Learn the programming from a reputed institute like NIIT etc
2.Make a one page CV
3.Register yourself with naukri.com,timesjobs.com, monsterindia.com and many more
4.Send your Cv to Infosis,Wipro,Tcs,Cognigent etc
5.Your desire will be fulfilled
Reply:Learn programming %26gt; write (good) programs %26gt; sell programs.
Reply:You're already learning the right things as far as which languages to learn. C++ especially is very valuable to professional programmers.
What you need to do next is to get properly certified by whatever authority certifies programmers in your area. After that, its simply a matter of finding someone to hire you.
Hint: Practice developing software by working on some Open Source projects. These are programs in which their creator has decided to make it free to anyone, and in which any programmer in the world is allowed to modify it and make it better. By participating in an Open Source project, you will gain experience working on real-world software, and be in direct communications with highly-experienced programmers who can help teach you.
Good luck, hope everything works out!
Subscribe to:
Posts (Atom)