9.3.21

Spring 2021 C+: hw-4

Write a C++ program that will read an integer number (up to four digits) and convert it into words.

Sample Input/Output:


Spring 2021 c++ : hw-3

C++ OOP to display name and age


You have to read name and age of a person and display them on the output screen. Here, you will learn how to read string (name) with spaces in C++ language?

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