1. With aid of a diagram, explain the stages the CPU goes through as it executes a
program. [25 marks]
2. Give a brief account on the technology used in Flash memory implementation [25
marks]
3. Explain the start-up process of a computer clearly indicating the purpose of the POST,
BIOS and CMOS. [25 marks].
4. With aid of a diagram, give a brief explanation on the type of busses available on
modern computer systems and the purpose of the North Bridge and South Bridge.
Your diagram should clearly show where the bridges are and what connects them. [25
(1) (a)Define a class Pairs with two integer data members, f and s, where f represents
the first value in the ordered pair and s represents the second value in an ordered
pair. Write a program to test all the overloaded operators in your class definition.
(b) Overload the stream extraction operator >> and the stream insertion operator << as
friend functions so that objects of class Pairs are to be input and output in the
form (5,6) (5,-4) (-5,4) or (-5,-6).
(c) Overload binary operator + as a friend function to add pairs according to the rule
(a,b) + (c,d) = (a + c, b + d)
(d)Overload operator – as a friend function in the same way, i.e. according to the rule
(a,b) - (c,d) = (a - c, b - d)
(e) Overload operator * as a friend function on Pairs and int according to the rule
(a,b) * c = (a * c, b * c)
Consider the following structure used to keep record of a module:
struct Module
{
string moduleName;
string moduleCode;
string lecturer;
int nrStudents;
}
Turn the Module struct into a class. The class should have member variables for all
the values in the corresponding struct. Make all the member variables private.
Include public member functions for each of the following:
a default constructor that sets the string member variables to blank strings,
and the int member variable to 0;
an overloaded constructor that sets the member variables to specified values;
member functions to set each of the member variables to a value given as an
argument to the function (i.e. mutators);
member functions to retrieve the data from each of the member variables (i.e.
accessors);
Test the class in a program that instantiates an object of class Module. The program should then input values for the object
(obtained from the keyboard), and use the mutators to assign values to the member
variables.
Define a class Pairs with 2 integer data members, f & s, where f represents
the 1st value in the ordered pair and s represents the 2nd value. Objects of type Pairs can be used wherever ordered pairs are
needed.
The class must have a default constructor that initializes data members to
0, & 2overloaded constructors, 1 with one int parameter and the other with
2 int parameters. The 1-parameter constructor should initialise the 1st
member of the pair; the 2nd member of the pair must be 0. The 2-parameter
constructor must initialise both members of the ordered pair.
The class must have a destructor that outputs 'Bye'
Add accessor functions that return the values stored in each of the member
variables of an object of class Pairs & mutator functions to update each of the member variables of an object of class Pairs
respectively. The class must contain a void member
function reset() that resets the member variables of a Pairs to values
specified by parameters.