Page 10 - C++
P. 10
in the binary file “ROUTE.DAT”.
(b) Write a user-defined function named Count() that will read the contents of text file 2
named “Report.txt” and count the number of lines which starts with either „I‟ or „M‟.
E.g. In the following paragraph, there are 2 lines starting with „I‟ or „M‟:
“India is the fastest growing economy.
India is looking for more investments around the globe.
The whole world is looking at India as a great market.
Most of the Indians can foresee the heights that India is capable of reaching.”
(c) Consider the following class Item:- 3
Write a function named Change_Item(int Id, float Pr) to modify the price of the item
whose ItemId & new price are passed as an argument.
SECTION – B (Python)
Q1 (a)
Differentiate between break and continue statement with the help of an example.
2
(b) Identify and write the name of the module to which the following functions belong: 1
i. ceil( ) ii. findall()
(c) Observe the following Python code very carefully and rewrite it after removing all 2
syntactical errors with each correction underlined.
(d) Write the output of the following Python code: 2
Page No. 8