Write a C++ program that will read an integer number (up to four digits) and convert it into words.
Sample Input/Output:9.3.21
Spring 2021 c++ : hw-3
C++ OOP to display name and age
Here, you have to declare a string (character array) variable named name that will store name of the person and integer variable named age that will store the age of the person.
Use Constructor, Destructor and Method in C++
Spring 2021 C++ : hw-2
1. Write a OOP to read string using cin function in c ++ . Count the number of character in that string without using built-in function.
2. Write a OOP to read a line of string using getline() function in c++. Count the number of word and number of character from that string.
Spring 2021 C++ : hw-1
1.
The Farming Problem:
In this problem, a person is
asking you to tell him how many legs can be counted among all his animals. The
farmer has given three types sample:
A.)
Chicken: 2 legs
B.)
Cows: 4 legs
C.)
Goat : 4 legs
The farmer has counted his animals and he gives you a
subtotal for each sample. You have to implement a function in OOP that returns
the total number of legs of all the animals.
Rules: Don’t for get to return the result. Remember that the farmer wants to now the
total number of legs and not the total number of animals.
Hints:
Farmer said that total number of animals is:
150
Farmer mentioned that there are 100
chickens, 25 cows and 25 goats
25.1.16
Index of C++ OOP Programming
C++ Program Structure -II
C++ Variables, Identifiers and Data Types
Declaration of variables
Exercise Week-1: Variable, Datatype and Initialization
C++ : Object and Class with a traditional BOX example
C++ : Inheritance with BASE & DERIVED Classes
Example: Salary Calculation using Inheritance in C++
C++ : Illustration of Overloading in C++ with a example of real problem solution
Example: Student Management System using Function Overloading using OOP in C++
C++ loadable and non-over loadable Operators
C++ : How Polymorphism works in C++ with implementation guideline
C++ : How Data Abstraction occurs in C++
C++ : Encapsulation with example in C++
C++ : Interfaces with real world problem solution in C++
Compound Data Types: Arrays in C++
Compound Data Types: Pointer in C++
Functions in C++ Programming Environment
OOP-Exercise : Classes and Objects with Constructor -cum- Destructor in C++
OOP-Exercise : Problems and Solutions on Encapsulation in C++
OOP-Exercise: Inheritance with problems and solutions in C++
OOP-Exercise-1 : Arithmetic Operators with operands as input
OOP-Exercise-2 : calculate square and cube of given number using inline function
OOP-Excercise-3 : Write a program to calculate simple interest using Function and also using Member variable/function in C++ OOP
OOP-Excercise-4.1 : Find the area of a triangle, area of a circle, and area of rectangle using function overloading technique in C++
Function Programming : Excercise-4.2 : Check Whether the given number is Strange or Not.
OOP-Excercise-5 : Check Whether the given number is Strange or Not.
OOP-Excercise-6 : Write a Object Oriented Program to Display Student Information
OOP-Excercise-7 : Search an integer element from an Array of 10 values. Use Constructor and Destructor with Class in C++
OOP-Excercise-8 : Check whether the given number by user is palindrome or not palindrom. Use individual member function to take input, output and display. Use Inheritance in C++
OOP-Excercise-9 : Program to find area of triangle, circle, and rectangle using C++ Overloading
OOP-Excercise-10 : Check palindrome. Use Inheritance technique
Function-Excercise-11 : Recursive function to fill an Integer Array of 5 Elements
Function-Excercise-12 : Sum of all even elements from an Array
C++_Excercise-13 : Find ODD or EVEN
C++_Excercise-14 : Count the number of character
OOP-Excercise-15 : Banking System
OOP-Excercise-16 : Array Programming
C++_Excercise-17 : Function Programming
C++_Excercise-18 : Recursive Function Programming
C++ Definition gallery of object oriented programming
Inheritance in C++ to check a Perfect Number (C++_Excercise-19)
Constructor in c++ to Sum of all multipliers by given range
Inheritance in c++ to generate a Fibonacci series
Design a Payroll system using Single INHERITANCE in C++
Recursion in C++
Pay-Bill Calculation using OOP in C++
Write a C++ program using using inline function to find the largest of three integer numbers
Sort an array of integer in ascending order
Implement function overloading in C++
Create a 'DISTANCE' class
Create a class called 'EMPLOYEE'
Create a class called 'TIME'
Create a class 'COMPLEX' to hold a complex number
Create a 'MATRIX' class of size m X n
Derive a class ‘MAT’ from MATRIX class
illustrate multilevel inheritance
Illustrate multiple inheritance
Create a 'STRING' class which overloads ‘ = = ' operator
Write a C++ program to illustrate ‘this’ pointer
Create a base class called 'SHAPE'
C++ program to read a list
Design your own manipulator
C++ program that uses a single file
C++ program to read the file and output the list in the tabular format
Write an interactive, menu-driven program
Write a C++ program that displays the size
Define a function to find the minimum value contained in an array
Class template to represent a generic vector
Calculator using C++
simple interest using c++
array programming in c++
comparison operator in c++
conditional operator in c++
sum of all digits from an integer number using c++
find prime numbers and make sum of all primes using c++
find prime and check with the sum of all primes using c++
print strange number between 1 and 100000
print all integer which are divisible by 3 using c++
letter with loop c++
calculate total= 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 using c++
how to compare char in c++
switch statement in c++
how to find the smallest string in C++
switch statement in c++
Develop a Calculator using Constructor with Parameter in c++
Find the Area of Circle and Rectangle using Multilevel Inheritance in C++
Integer Array Search Using Constructor and Method in C++
Count the number of digit from an Integer Number given by user
Write a C++ program which will count digit from an integer number. The input(integer number) must be given by user from keyboard. This program will ask to the user for number of test to count the digit.
17.9.15
How to find the smallest string in C++
Solution
char* min(char* a, char* b, char* c)
{
return strcmp(a,b) < 0 ? strcmp(a,c) < 0 ? a : c : strcmp(b,c) < 0 ? b : c;
}
switch statement in c++
In the Mapple Leaf School System, children are classified by age as follows:
less than 2, ineligible
2, toddler
3-5, early childhood
6-7, young reader
8-10, elementary
11 and 12, middle
13, impossible
14-16, high school
17-18, scholar
greater than 18, ineligible
Given an int variable age , write a switch statement that prints out the appropriate label from the above list based on age.
Solution
switch (age)
{
case 0:
case 1:
cout << "ineligible";
break;
case 2:
cout << "toddler";
break;
case 3:
case 4:
case 5:
cout << "early childhood";
break;
case 6:
case 7:
cout << "young reader";
break;
case 8:
case 9:
case 10:
cout << "elementary";
break;
case 11:
case 12:
cout << "middle";
break;
case 13:
cout << "impossible";
break;
case 14:
case 15:
case 16:
cout << "high school";
break;
case 17:
case 18:
cout << "scholar";
break;
default:
cout << "ineligible";
break;
}
how to compare char in c++
Solution
(c==' ' || c=='\t' || c=='\n') ? false : true
calculate total= 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 using c++
Solution
total=0;
k=0;
do
{
total+=k*k*k;
k++;
}
while (k<=n);
letter with loop c++
aa
ab
ac
ad
ae
ba
bb
...
ee
Solution:
for (char outerChar='a'; outerChar<='e'; outerChar++)
for (char innerChar='a'; innerChar<='e'; innerChar++)
cout << outerChar << innerChar << "\n";