kirti28kumar
BAN USER- 0of 0 votes
AnswersWrite a program which makes use of two classes named integer and character. The class integer has one integer data
- kirti28kumar in India for codeblock
member lying in the private section and one member function named input lying in the protected section.The member
function input is used to enter the data in the data member.The class character publically inherits from the class
integer.The class character has one character data member and two member functions named calc and display.The calc
function ask the user to input data in the character data member which will be a number from 1-9.The calc function will
divide the integer number (Data member of the class integer) entered earlier with the number entered in the character
and the display function will display the message “Divides Completely” in the case the integer is divided completet and
the message “Does not divide” otherwise.The ASCII values of numbers 0-9 range from 48-57.Eg. run is as follows:
Enter Integer:10
Enter Character :2
Result: Divides completely.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer C++ - -1of 1 vote
AnswersWrite a program which contains a class named String (please take care of the case). The class should be capable of
- kirti28kumar in India for codeblock
holding a string containing more than one word. The class should at least have a parametric constructors by which we
are going to supply a sentence at run time. Class string should be defined in this way that the following statement
should be executed with their proper output.
String str1; //string with length 0
String str2;
cin>>str2; // to print the char elements of str2;
(Don’t use any string library function for the any purpose)
You are free to add any C++ concepts, any other data members, member functions and constructors you think are
necessary to solve the problem.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer C++ - 0of 0 votes
AnswersWrite a program which contains a class named String (please take care of the case). The class should be capable of
- kirti28kumar in India for codeblock
holding a string containing more than one word. The class should at least have a parametric constructor by which we
are going to supply a sentence at run time. The class should contain a member function ‘palindromecheck()’which
reverses the words of the sentence in their proper original order. The class String should be user defined. You are free
to add any other data members, member functions and constructors you think are necessary to solve the problem.
Sample Run:-
Enter sentence:-
Mom…nothing can be better than you
Output:-
Sentence with reversed words is:-
you than better be can nothing …moM
Not Palindrome
Sample Run:-
Enter sentence:-
wife loves husband,husband loves wife
Output:-
Sentence with reversed words is:-
wife loves husband,husband loves wife.
Palindrome
You are free to add any C++ concepts, any other data members, member functions and constructors you think are
necessary to solve the problem.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Object Oriented Design
hmmmm...soo answer it???
- kirti28kumar October 26, 2012