rishitava qns
rishitava qns
Write a program in C++ using classes and objects to find the sum from 1 to N, where N is an
integer provided as input.
6. Write a function in C++ to count the number of lines starting with uppercase characters in the
text file "HELP.DOC".
7. Define a class `ITEM` in C++ with the following description:
- Private Members:
- `Code`: of type `int` (Item Code)
- `Iname`: of type `string` (Item Name)
- `Price`: of type `float` (Price of each item)
- `Qty`: of type `int` (Quantity of item in stock)
- `Offer`: of type `float` (Offer percentage on the item)
- A member function `GetOffer()` to calculate the offer percentage as follows:
- If `Qty <= 50`: Offer is 0%
- If `50 < Qty <= 100`: Offer is 5%
- If `Qty > 100`: Offer is 10%
- Public Members:
- A function `GetStock()` to allow the user to enter values for `Code`, `Iname`, `Price`, and `Qty`,
and to call `GetOffer()` to calculate the offer.
- A function `ShowItem()` to display all the data members.