Lab 3
Lab 3
Lab 03
Topic C++ String and Basic File Writing
• Array
o Integer, Character, C-String
o Different input methods
o Problem solving using Arrays.
1
Lab Tasks
Task 1: Find a word problem:
Book reading is a good practice. Almost all type of books is available in soft form as well. We often need
to find some keywords in order to read about it from books. It is quite difficult to find a keyword from
hard copy. But on other hand we can easily find any keyword form a soft copy.
A. Find a keyword:
In order to find a keyword let’s try to find a character first. Compare the entered character with each
character of array.
B. Display Keyword:
Now apply same logic which we discussed above and try to find a keyword from a character array.
C. Count keyword:
After successful attempt of finding key word let’s try to count that how many times that keyword is found.
2
Task 7: Admission form problem:
Thousands of students got admission in UCP. It is difficult to store their admission form. So, UCP want to
store the record of their student in soft form for later use. Each entity of form is stored as comma
separated value and each line stores record of each student.