In: Computer Science
* What does it mean when header files are described as making a program “modular?” What are the advantages of this?
* You are testing a program that is designed to take in a pair of float values as input. The intended range is from -50.50 to 100.25. What are 10 test cases you would use to test this program, bearing in mind each test case is a set of two numbers? Briefly justify your choices.
1.
Let's say that in 1 file we implemented a class with all its functions and then we #include<"file"> in our main program which is going to execute,so in this way we can directly create the object of that class ,without including that in our main file,so in this way we make our program as modular.Let's study a bit about this modular programming:-
Modular programming is the process of subdividing a computer program into separate sub-programs.
A module is a separate software component. It can often be used in a variety of applications and functions with other components of the system. Similar functions are grouped in the same unit of programming code and separate functions are developed as separate units of code so that the code can be reused by other applications.
Object-oriented programming (OOP) is compatible with the modular programming concept to a large extent. Modular programming enables multiple programmers to divide up the work and debug pieces of the program independently.
Modules in modular programming enforce logical boundaries
between components and improve maintainability. They are
incorporated through interfaces. They are designed in such a way as
to minimize dependencies between different modules. Teams can
develop modules separately and do not require knowledge of all
modules in the system.
Each and every modular application has a version number associated
with it. This provides developers flexibility in module
maintenance. If any changes have to be applied to a module, only
the affected subroutines have to be changed. This makes the program
easier to read and understand.
The benefits of using modular programming include:
2. -50.50 to 100.25
i) (-50.50,100.25)
ii)(-50.51,100.26)
iii)(-50.51,100.24)
iv)(-50.50,100.26)
v)(-50.50,100.24)
vi)(-50.49,100.24)
vii)(-50.51,-50.52)
viii)(100.26,100.27)
ix)(100.25,100.26)
x)(-50.50,-50.51)