Teachers' Publications








Section A: Answer all questions /55pts

  1. Which two controls in VB display graphic images? /1Mark

Image control and Picture box

  1. List the steps required to connect a computer using a UPS /3Marks

ü  Connecting the battery wires

ü  Plugging the UPS directly into a properly wired and grounded power outlet

ü  Deciding which critically important devices(computer) to plug into the "battery" outlets.



  • First you need to connect the UPS overnight to charge the battery.
  • Normally the UPS comes with instructions of how to connect the battery because the manufactures ship the UPS with the battery inside disconnected.
  • After that connect the CPU and the Monitor to the back of the UPS there is a plug behind the UPS that says SURGE those doesn't provide electricity after a power outages those are only to protect devices normally used for speakers.
  1. How to move (delete) a program from your computer? /3Marks

Click on the Windows 7 Start Menu button ( ) and then click on the Control Panel. Please double-click the Uninstall a program icon: A list of programs installed will be populated this may take a bit of time. In this list please find the program that you would like to remove and select it by left-clicking once on it.


  1. What is a computer virus? In which ways can a virus be transmitted into your PC? /4Marks

A computer virus is a type of malicious software program ("malware") that, when executed, replicates by reproducing itself (copying its own source code) or infecting other computer programs by modifying them.

Ways Computer Viruses Are Spread:

         Email attachments.


         Infected Boot disks

         Infected Software


         Fake Anti Virus Software

         From Mobile/Removable Devices


  1. Give the four impacts of computer on society /4Marks

Everyone knows that this is the age of computer and vast majority of people are using computer. Development of science and technology has direct effect on our daily life as well as in our social life. Computer technology has made communication possible from one part of the world to the other in seconds. They can see the transactions in one part of the world while staying in the other part. Computer development is one of the greatest scientific achievements of the 20 th century. Computers are used in various fields as well as in teaching and learning. Some of the major computer application fields are listed below.

  1. An aid to management: The computer can also be used as a management tool to assist in solving business problems.
  2. Banking: Branches are equipped with terminals giving them an online accounting facility and enabling them to information as such things as current balances, deposits, overdrafts and interest charges.
  3. Industrial Application: In industry, production may be planned, coordinated and controlled with the aid of a computer.
  4. Engineering Design: Computer help in calculating that all the parts of a proposed design are satisfactory and also assist in the designing.
  5. Meteorology: Data is recorded at different levels of atmosphere at different places, using remote sensors carried on a satellite.
  6. Air Travel: Small computers are installed as a part of the plane's equipment.
  7. Road Traffic Control: Computers assist with the control of traffic lights.
  8. Telephones: Computerized telephone exchanges handle an ever increasing volume of calls very efficiently.
  9. Medicine: Computers are widely used in hospitals for such task as maintaining drugs, surgical equipments and linen, for payroll and also for checkup and treatment of diseases.

  1. List and explain the types of SQL commands. /5Marks

Types of SQL Commands

The following sections discuss the basic categories of commands used in SQL to perform various functions. These functions include building database objects, manipulating objects, populating database tables with data, updating existing data in tables, deleting data, performing database queries, controlling database access, and overall database administration.

The main categories are

  • DDL (Data Definition Language)
  • DML (Data Manipulation Language)
  • DQL (Data Query Language)
  • DCL (Data Control Language)
  • Data administration commands
  • Transactional control commands

Defining Database Structures

Data Definition Language, DDL, is the part of SQL that allows a database user to create and restructure database objects, such as the creation or the deletion of a table.

Manipulating Data

Data Manipulation Language, DML, is the part of SQL used to manipulate data within objects of a relational database.

There are three basic DML commands:




Selecting Data

Though comprised of only one command, Data Query Language (DQL) is the most concentrated focus of SQL for modern relational database users. The base command is as follows:


This command, accompanied by many options and clauses, is used to compose queries against a relational database. Queries, from simple to complex, from vague to specific, can be easily created.

A query is an inquiry to the database for information. A query is usually issued to the database through an application interface or via a command line prompt.

Data Control Language

Data control commands in SQL allow you to control access to data within the database. These DCL commands are normally used to create objects related to user access and also control the distribution of privileges among users. Some data control commands are as follows:





You will find that these commands are often grouped with other commands and may appear in a number of different lessons throughout this book.

Data Administration Commands

Data administration commands allow the user to perform audits and perform analyses on operations within the database. They can also be used to help analyze system performance. Two general data administration commands are as follows:



Do not get data administration confused with database administration. Database administration is the overall administration of a database, which envelops the use of all levels of commands. Database administration is much more specific to each SQL implementation than are those core commands of the SQL language.

Transactional Control Commands

In addition to the previously introduced categories of commands, there are commands that allow the user to manage database transactions.

  • COMMIT Saves database transactions
  • ROLLBACK Undoes database transactions
  • SAVEPOINT Creates points within groups of transactions in which to ROLLBACK
  • SET TRANSACTION Places a name on a transaction


  1. What is a data type? What is the difference between a String and a Boolean data type? What are two controls that behave as if they conform to the Boolean data type? /4Marks

ü  A data type or simply type is a classification identifying one of various types of data, such as real, integer or Boolean, that determines the possible values for that type, the operations that can be done on values of that type, the meaning of the data, and the way values of that type can be stored.


ü  The Boolean type has only two values. The constants for these values are true and false and are only used for truth values. Unlike some languages, false isn't exactly the same as 0 (zero), but it will convert to 0 when used where a number is expected, so it's much the same thing.

The String type is for textual characters. There is no type for representing just one character. A String is a row of zero or more characters as a unit, not an array of single characters. Of course, a String of exactly one character is as good as a single character, so that is the way a single character is represented.


ü  Checkbox and option button are Boolean controls

  1. What is usually the last step a VB programmer takes before distributing an application to users? /1Mark


  1. What do the following acronyms stand for? /4Marks
    1. ATX: Advanced Technology extended
    2. BTX: Balanced Technology Extended
    3. RAM: Random Access Memory
    4. IRQ: Interrupt Request
    5. DMA: Direct Memory Access
    6. DIMM: Dual Inline Memory Module
    7. SCSI: Small Computer System Interconnect
    8. NIC: Network  Interface Card


  1. A hard disk has the following parameters: number of cylinders C=16383, Number of heads=16, Sectors per Track SPT=63, Bytes Per Sector BPS=512B.
    1. Calculate disk capacity in bytes. /2Marks
    2. Calculate disk capacity in GB. /1Mark

Capacity = Number of cylinders × number of heads × sectors/track × 512 = hard disk size (bytes)
For my specific hard disk my calculations are:16,383 * 16 * 63 * 512 = 8455200768 bytes

Drive H=16, C=16383, S=63, B=512, Size=8.4GB


  1. State any three differences between SATA and IDE computer technologies. /3Marks

         SATA data transfer at the rate of up to 6 GB/s that is far more than IDE data transfers rate which works at the rate of up to 133MB/s

         SATA interface supports hot plugging IDE interface does not support hot plugging.

         SATA narrow can be up to a tempo (roughly 3ft) long. Power and data split into two connections, IDE ribbon-like, wide, can be up to 18 inches long.


  1. Give the output from the following codes fragments: /4Marks
  2. #include <stdio.h>

#include <stdlib.h>

int main(int argc, char *argv[])

{          int a,b,sum1,sum2;




            printf("%d %d %d %d", a, b, sum1, sum2);

return 0;            }


  1. #include


int main()


       int x=5, y=10, z=10;


        printf(“%d”, x);


  1.  Use function to write a program to find the factorial of an integer. /3Marks


int main(){

  int i,f=1,num;

  printf("Enter a number: ");




  printf("Factorial of %d is: %d",num,f);

  return 0;




void findFactorial(int,int *);

int main(){

  int i,factorial,num;

  printf("Enter a number: ");



  printf("Factorial of %d is: %d",num,*factorial);

  return 0;


void findFactorial(int num,int *factorial){

    int i;

    *factorial =1;






Private Sub cmdFactorial_Click()
n = Val(InputBox(“Enter Number To Find Factorial ?”))

fact = 1
For i = n To 1 Step -1
    fact = fact * i

Print “Answer Using For Loop”
Print “=====================”
Print “Factorial of ” & n & ” is” & fact
Print “”

  1. Write a program in VB to solve quadratic equation. /5Marks


Private Sub Cmd1_ click ( )

Dim a , b , c , X1 , X2 as variant

a= Val (Txt1.text)       

b= Val (Txt2.text)

c= Val (Txt3.text)

X1=Cdbl (- b + Sqr (b ^ 2 – 4 * a * c) ) / (2 * a)      

X2= Cdbl (- b – Sqr (b ^ 2 – 4 * a * c) ) / ( 2 * a)

End Sub


The Code

Private Sub Form_Load()
Dim a, b, c, det As Integer
Dim root1, root2 As Single
Dim numroot As Integer
End Sub

Private Sub new_Click()
' To set all values to zero
Coeff_a.Text = ""
Coeff_b.Text = ""
Coeff_c.Text = ""
Answers.Caption = ""
txt_root1.Visible = False
txt_root2.Visible = False
txt_root1.Text = ""
txt_root2.Text = ""
Lbl_and.Visible = False
Lbl_numroot.Caption = ""
End Sub

Private Sub Solve_Click()
a = Val(Coeff_a.Text)
b = Val(Coeff_b.Text)
c = Val(Coeff_c.Text)

'To compute the value of the determinant

det = (b ^ 2) - (4 * a * c)
If det > 0 Then
Lbl_numroot.Caption = 2
root1 = (-b + Sqr(det)) / (2 * a)
root2 = (-b - Sqr(det)) / (2 * a)
Answers.Caption = "The roots are "
Lbl_and.Visible = True
txt_root1.Visible = True
txt_root2.Visible = True
txt_root1.Text = Round(root1, 4)
txt_root2.Text = Round(root2, 4)

ElseIf det = 0 Then
root1 = (-b) / 2 * a
Lbl_numroot.Caption = 1
Answers.Caption = "The root is "
txt_root1.Visible = True
txt_root1.Text = root1
Lbl_numroot.Caption = 0
Answers.Caption = "There is no root "
End If
End Sub

  1. To design a simply calculator, design a form with three text boxes and four command buttons. The integer value of the first and second number is entered into separate (labeled) text boxes. Write codes to perform add, subtract, multiply, and divide where pressing on buttons. Display the result operation in separate Textbox by using the following formula.  8+7=15  /4Marks
  1.  Produce the Intersection and the Union of the  tables below:                        /4Marks

FOOTBALL_PLAYER Table                                                  CRICKET_PLAYER Table

Id Name
1101/01 Sam
3303/03 Tom
7707/07 Jack
9909/09 Kalim
Id Name
7707/07 Jack
8808/08 Jackob
9909/09 Kalim
1111/11 Abu
2222/22 Kaliba


SECTION B: Answer any three questions of the followings /30 marks

  1. Design a form with one command and two text boxes. Enter the value of integer number (N) in separate text box. Write a code program to check if the number (N) is a prime Number or not. Display the “It is not a prime number” or “It is a prime number” in separate text box.

Private Sub Command1_Click()

Dim N, D As Single

Dim tag As String

N = Val(Text1.Text)

Select Case N

Case Is < 2

Case 2

Case Is > 2 

D = 2


If N / D = Int(N / D) Then

tag = "Not Prime"

Exit Do

End If

D = D + 1

Loop While D <= N - 1

If tag <> "Not Prime" Then

End If

End Select

End Sub


  1. Consider the relation below:    

The EMPLOYEE relation

EmpNo EmpName Designation Salary DeptNo
1001 Sam Teacher 5,000 1
 002 Peter Secretary 5,500 1
1003 Jane Accountant 6,000 2
1004 Jack Manager 11,000 2
  1. Give all information for employees.

ü  Write SQL query.

ü  Give the relation resulting from the query.

  1. List all employees with a salary greater than 1,000.

ü  Write SQL query

ü  Give the relation resulting from the query

  1. Produce a list of salaries for all employees of DeptNo2 showing only EmpNo, EmpName, Salary, DeptNo.

ü  Write SQL query

ü  Give the relation resulting from the query

  1. Define a class to represent a bank account. Include:

Data members:

  • Name of the depositor
  • Account number
  • Type of account
  • Balance amount in the account

Member functions:

  • To assign initial values
  • To deposit an amount
  • To withdraw an amount after checking the balance
  • To display name and balance

Write a main function to test the program

Program to represent a bank account (implemented as a Class)

# include<iostream.h>

# include<conio.h>

# include<iomanip.h>

class bank


            char name[20];

            int acno;

            char actype[4];

            float balance;


            void init();

            void deposit();

            void withdraw();

            void disp_det();


//member functions of bank class

void bank :: init()



                        New Account



Enter the Name of the depositor : ";




Enter the Account Number : ";



Enter the Account Type : (CURR/SAVG/FD/RD/DMAT) ";



Enter the Amount to Deposit : ";

cin >>balance;


void bank :: deposit()


float more;

cout <<"




Enter the amount to deposit : ";




void bank :: withdraw()


float amt;





Enter the amount to withdraw : ";




void bank :: disp_det()



                        Account Details


cout<<"Name of the depositor : "<<name<<endl;

cout<<"Account Number        : "<<acno<<endl;

cout<<"Account Type          : "<<actype<<endl;

cout<<"Balance               : $"<<balance<<endl;


// main function , exectution starts here

void main(void)



bank obj;

int choice  =1;

while (choice != 0 )



Enter 0 to exit

            1. Initialize a new acc.

            2. Deposit


            4.See A/c Status";




            case 0 :obj.disp_det();


                        EXITING PROGRAM.";


            case 1 : obj.init();


            case 2: obj.deposit();


            case 3 : obj.withdraw();


            case 4: obj.disp_det();


            default: cout<<"

Illegal Option"<<endl;








class bank


    char name[40];

    int ac_no;

    char ac_type[20];

    double balance;


    int assign(void);

    void deposite(float b);

    void withdraw(float c);

    void display(void);


int bank::assign(void)


    float initial;

    cout<<" You have to pay   500 TK to open your account \n"

    <<" You have to store at least 500 TK to keep your account active\n"

    <<"Would you want to open a account????\n"

    <<" If Yes press 1 \n"

    <<" If No press 0 : ";

    int test;






      cout<<" Enter name ,account number & account type to creat account : \n";




    ;// do nothing

    return  test;


void bank::deposite(float b)




void bank::withdraw(float c)





        cout<<" Sorry your balance is not sufficient to withdraw "<<c<<"TK\n"

             <<" You have to store at least 500 TK to keep your account active\n";




void bank::display(void)


    cout<<setw(12)<<"Name"<<setw(20)<<"Account type"<<setw(12)<<"Balance"<<endl;



int main()


    bank account;

    int  t;




        cout<<" Would you want to deposite: ?"<<endl

        <<"If NO press 0(zero)"<<endl

        <<"If YES enter deposite ammount :"<<endl;

        float dp;



        cout<<" Would you want to withdraw : ?"<<endl

        <<"If NO press 0(zero)"<<endl

        <<"If YES enter withdrawal ammount :"<<endl;

        float wd;



        cout<<" see details :"<<endl<<endl;



            else if(t==0)

    cout<<" Thank you ,see again\n";

    return 0;


  1. Write a program to enter an angle value (Degree, Minutes, and Seconds) into separate text boxes. Calculate the value of angle (in degree only). Display angle in separate text box. When the user click the option button, calculate the value of the function (Sin, Cos or Tan) and display in separate text box. If the value of Minutes or seconds exceeded 60, write a message box (The value of minutes or seconds exceeds 60) to stop the program.

Private Sub Command1_Click() 

Dim deg As Double, minut As Double, second As Double

Dim total As Double, p As Double

deg = Val(Text1.Text)

minut = Val(Text2.Text)

second = Val(Text3.Text)

If minut > 60 Or second > 60 Then

res = MsgBox("The value of minutes or seconds exceeds 60", 0)

If res = 1 Then Text1.Text = "": Text2.Text = "": Text3.Text = "": Exit Sub

End If

total = deg + (minut / 60) + (second / 3600)

Text4.Text = Str(total)

p = 3.141596 / 180

If Option1.Value = True Then

Text5.Text = Str(Sin(p * total))

End If

If Option2.Value = True Then

Text5.Text = Str(Cos(p * total))

End If

If Option3.Value = True Then

If Cos(p * total) <= Abs(0.00001) Then Text5.Text = "division by zero": Exit Sub

Text5.Text = Str(Tan(p * total))

End If 

End Sub





SECTION C: Answer any one question of your choice /15 marks

  1. Consider the following table which provides practice in converting a number from binary notation to decimal format of an IP Address.
  1. Complete the table above
  1. Based on the rules of categorizing IP addresses summarized in the table below:
B 10XX
C 110X
D 111X
  1. Express IP Address in binary format and identify the address class of it.
  2. Determine the class of the Address
  1. Considering the following tables:


ClientID SurName FirstName Telephone
001 Uwera Diane 08754172
002 Kayiranga Alain 08965216
003 Kayitesi Aimée 08952141


CarID Manufacturer Meter ClientID
4698 SJ 45 Renault 123450 003
4568 HD 16 Toyota 56000 002
6576 VE 38 Benz 12000 001
7845 ZS 83 Fiat 75600 003
7647 ABY 82 Renault 189500 002
8562 EV 23 Benz   002
8941 UD 61 Fiat   001
7846 AZS 75 Peugeot 21350 003

Give the output of the following SQL queries:

  1. SELECT SurName, FirstName, CarID, Manufacturer FROM CLIENTS, CAR


AND Manufacturer= "Benz";


SET Telephone= "075082141"

WHERE ClientID="003";


ADD COLUMN Mail varchar (10);

  1. SELECT Manufacturer, SUM (Meter) As Total


WHERE Manufacturer IN (“Renault”,” Fiat”)

GROUP BY Manufacturer;






JULY 2016              




                                   MATHEMATICS-PHYSICS -COMPUTER SCIENCE (MPC)



SECTION A: Answer All questions /55 marks

  1. Multiple choice/5marks

 b. A serial data port on your PC would have how many pins out?

A. 9,   B. 5, C. 7

         b) How many wires does the standard IDE drive cable have?

   A. 40

   B. 55

   C. 50

 c) What type of port communicates information to a peripheral device one bit at a time?  

A. Parallel port

   B. Serial port

   C. Optical port

 d) What component of the computer processes data?

  A. The RAM

   B. The Storage devices

   C. The Processor.

   D. The Monitor

e) Which computer below uses the screen touch technology?

A. The palmtop

   B. The laptop

   C. The minicomputer

   D. The desktop computer

f) Which computer device below is an example of output hardware?

   A. The keyboard

   B. The printer

C. The scanner

   D. The microphone

g) Which storage device of the computer stores or keeps the operating system and application programs?

A. The flash disk.

B. The diskette


D. The hard disk

h) Which operating system below does not require the use of the mouse?

A. Windows Vista

B. Windows Linux

C. Windows ME


i) Which software below is an application program?

   A. Windows Explorer

   B. Microsoft DOS

   C. Microsoft OS

   D. Microsoft Access

j) Which computer peripheral produces the soft copy of a hard copy?

A. The scanner

B. The printer


D. The Tape drive

2. Give three examples of audio ports that connect audio devices to the computer. /1.5marks

Line in, line out, microphone connectors

3. List the three motherboard form factors. /1.5marks


4. Describe the three components of a UPS. /1.5marks

Rectifier: converts Ac power to DC power so that the battery can store it.

Battery: stores the power for use in case of surge

Inverter: converts the battery DC power into AC power for the equipment and provides continues power to the computer for as the battery provides uninterrupted power to the inverter.

Identify from the following which are hardware or software. /3marks

    1. Capacitors
    2. Internet Explorer
    3. Hard Disk
  • Unix
  • Scanner
  • RAID


Hardware Software

¾     Hard Disk

¾     Scanner

¾     RAID


¾     Internet explorer

¾     Unix


  1. What is a browser? List any four types of web browsers. /3marks

A browser

A web browser (commonly referred to as a browser) is a software application for retrieving, presenting, and traversing information resources on the World Wide Web.

Mozilla Firefox, internet explorer, opera mini , Google chrome, safaris

  1. A “1.44 MB” floppy disk has 80 cylinders (numbered 0 to 79), 2 heads (numbered 0 to 1) and 18 sectors (numbered 1 to 18). Calculate its capacity in sectors. /4.5marks

Total storage capacity of a floppy/hard disk=total number of sectors*512 bytes per sector 

 Total number of sectors =sectors per side*number of heads

 Sectors per side=Tracks per side*sectors per track

 Total number of sectors=(80*18)*2=2880  

 Total storage capacity=2880*512 bytes /sector=1474560 bytes (1.44MB)  

  1. Distinguish the different families of computers./2marks

Microcomputer, minicomputer, mainframe computers, supercomputer


  1. State five differences between DOS and Linux./2.5marks

DOS does not provide any graphical user interface, whereas Linux does.

DOS does not support the concept of multi-users; whereas Linux does.

DOS also does not have any in built security features, whereas Linux does

Basically DOS has had very different goals from that of Linux.

MS-DOS is a 16-bit operating system whereas Linux use 32-bits and 64-bit

MS-DOS is a closed source, Linux is a open source

Files and directories

The files in Linux can be very long, up-to 255 characters, and they do not always have extensions.

The path names are separated by forward slashes (/) in Linux whereas DOS and Windows uses back slashes (\).   

  1. Why is a hard disk technically 80 GB but the operating system treats it as 72GB only?/5marks

With 80GB but the computer it calculates 72.72GBs by referencing that 1KB equals to 1024 bytes multiplicate by 1024 bytes which is equals 1,048,576KB.

1,048,576 KB or 1MB and then a Gigabyte in turn equals 1,048,576 KB multiplicate by 1,048KB which in turn equals 1,099.8 MB. or 1100MB.

If we were to calculate that out according to the computers determination of 80GB, we would divide the 80.000MB that are on the hard drive by 1100MB.that the computer seems to be 1B and we get 72.72GBs.


  1. What are the data types? Write down all the data types that are predefined in C++. /5marks

In computer programming, information is stored in a computer memory with different data types. We must know what is to be stored in a computer memory,whether it is a simple number, a letter or a very large number. As we also know, computer memory is organized in bytes, and for these variables with varying information a data type is associated. The minimum amount of memory in computer memory is a byte, that can store a small amount of data and managed easily. Every variable is declared with two entities, its type and its name. There are several data types available in C++. The basic built in data types are charint, float, double and bool. There is another data type void, which we will discuss some other time. C++ also allows user defined data types

  1. What are the output for the following fragments of codes:/3marks

a) int n, k=5;



   return 0;



b) int n;

     float x=3.8;



     return 0;



c) int i=5, j=6, k=7, n=3;



     return 0;




  1. Describe two types of class members used in OOP and explain how they can be accessed in three different ways. /5marks

Data members and member functions

Private, public, protected

  1. Enumerate the procedures followed to create a new project in Visual Basics. /2marks

To create a project for your program

  • From the Windows Start menu, click Visual Basic 6.0
  • Click New Project.
  • On the File menu, The New Project dialog box opens.
  • Choose Standard.EXE project
  • Click open
  • Double click the form object
  • Type the program
  • Press F5 to run the program.
  1. Explain the following terms: /2marks
  2. is a group of statements designed to perform a specific task.
  3. Assign the prefixes for controls and data types as used in VB: /2marks

cbo, pic, tmr, int

  1. Draw a flowchart for an algorithm for calculating the Greatest Common Divisor (GCD) of two numbers. The algorithm proceeds by successive subtractions in two loops: If the test A<=B yields “Yes” (or True), Then the algorithm specifies B<--B-A (meaning the number B-A replaces the old B). Similarly If A>B Then A<--A-B. The process terminates when the content of B is 0, yielding the GCD in A. /5marks





  1. What are the function of the following commands:/3marks

a) ls: display the list of files

b) cd: change directory

c) cp: copy a file or directory

d) cat: displays content of a file

e) ipconfig: used to display the IP Address

f) ping: Ping is a basic Internet program that allows a user to verify that a particular IP address exists and can accept requests .

Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network.





SECTION B: Answer any three questions for your choice /30 marks

  1. Knowing that the formula to compute the volume of a cylinder is v=pi*(r^2)*h. Where v=volume, pi=22/7, r=radius and h=height. Write a required code to make a Visual Basic program that calculates the volume of a cylinder. Starting by designing the interface for the user with three label boxes, three text boxes and one command Button(OK). When you run the program, you should be able to interact within the interface, So that if you enter a value each in the radius box and the height box, then click command button; the value of the volume will be displayed in the volume box.

NB: Using the function Str$. The declaration step is not required. /10marks

Private Sub OK_Click( )

r = Val(radius.Text)

h = Val(hght.Text)

pi = 22 / 7

v = pi * (r ^ 2) * h
volume.Text= Str$(v)

End Sub

  1. Write a program for an Automated Teller Machine while currencies are 5000, 2000 and 1000. /10marks

#include<stdio.h> /0.5marks

 int totalFiveThousand=100;

int totalTwoThousand=100;

int totalOneThousand=100;  /0.5marks

 int main()


     unsigned long withdrawAmount;

    unsigned long totalMoney;

     int fivethousand=0,twothousand=0,onethousand=0; /0.5marks

     printf("Enter the amount in multiple of 1000: ");/0.5marks

    scanf("%lu", &withdrawAmount); /0.5marks

     if(withdrawAmount%1000 !=0) /0.5marks


         printf("Invalid amount;"); /0.5marks

         return 0;


     totalMoney=totalFiveThousand*5000 + totalTwoThousand*2000+totalOneThousand*1000; /1mark

     if(withdrawAmount> totalMoney) /0.5marks


         printf("Sorry,Insufficient money"); /0.5marks

         return 0;


     fivethousand = withdrawAmount / 5000; /0.5marks

    if(fivethousand > totalFiveThousand) /0.5marks

         fivethousand = totalFiveThousand;

    withdrawAmount = withdrawAmount - fivethousand *5000; /0.5marks

     if (withdrawAmount> 0)


         twothousand = withdrawAmount / 2000; /0.5marks

         if(twothousand> totalTwoThousand) /0.5marks

             twothousand = totalTwoThousand;

         withdrawAmount = withdrawAmount - twothousand * 2000; /0.5marks


     if (withdrawAmount> 0)

         onethousand= withdrawAmount /1000;  /0.5marks

     printf("Total 5000 notes: %d\n", fivethousand);

    printf("Total  2000 notes: %d\n", twothousand);

    printf("Total  1000 notes: %d\n", onethousand); /1mark

     return 0;


  1. Based on the employees table below
employee_number first_name last_name Age salary dept_id
1001 John Smith 32 62000 500
1002 Jane Anderson 35 57500 500
1003 Brad Everest 45 71000 501
1004 Jack Horvath 47 42000 501

Write SQL statements to:

  1. Create the above table

CREATE TABLE employees

(employee_number VARCHAR(64),

first_name     CHAR(10),
last_name     CHAR(64),
salary INTEGER,
dept_id  CHAR(64),
PRIMARY KEY (employee_number) )

  1. Display first name and age for everyone whose name is in the table.

SELECT * FROM employees;

  1. select all fields from the employees table whose salary is less than or equal to 52,500 .

SELECT * FROM employees WHERE salary<=52,500;

  1. d)insert into employees the following values 1001, Smith, John, 62000, 500.

INSERT INTO employees VALUES (1001, ‘Smith’, ‘John’, 62000, 500);

  1. Select first , last names and salary for everyone whose last name ends with th.

SELECT first_name, last_name, salary FROM employees WHERE last_name LIKE’%th’;

  1. Select all columns for everyone over 35 years old

SELECT * FROM employees WHERE Age>35 ;

  1. Select first name for everyone whose first name equals Jane.

SELECT first_name FROM employees WHERE first_name= ‘Jane’;

  1. Select all columns for everyone whose last name contains est.

SELECT * FROM employees WHERE last_name’% est%’;

  1. Remove all employees who are earning over 70,000.00.

DELETE FROM employees WHERE salary>70,000.00;

  1. j)Delete an entire table

DROP TABLE employees;

  1. Based on the relation A, B and C, answer the following questions. /10marks


A1 A2 A3
1 12 100
2 16 102
3 16 103
4 19 104


B1 B2
22 214
24 216
27 284
29 216


C1 C2 C3
31 401 1006
32 401 1025
33 405 1065
  1. You have relations A,B and C .show the resulting relation if you apply the following SQL statements. Select B1 from B where B2=216.
  2. You have relations A,B and C .show the resulting relation if you apply the following SQL statements. Select A3 from A .
  3. You have relations A,B and C .show the resulting relation if you apply the following SQL statements. Update C set C1=37 where C1=31.
  4. You have relations A,B and C .show the resulting relation if you apply the following SQL statements. Select * from A union select *from B.
  5. You have relations A,B and C .show the resulting relation if you apply the following SQL statements. INSERT INTO C (C1, C2,C3) VALUES (‘35’, ‘407’, ‘1050’).



C1 C2 C3
37 401 1006
32 401 1025
33 405 1065
A1 A2 A3 B1 B2


12 100 22 214
2 16 102 24 216
3 16 103 27 284
4 19 104 29 216
C1 C2 C3
31 401 1006
32 401 1025
33 405 1065
35 407 1050


SECTION C: Answer any One Question/15 marks

  1. Write a C++ program to implement a circle class. Each object of this class will represent a circle, storing its radius and the x and y coordinate of its center as floats. Include two access functions for:

i. Calculating area of circle.

ii. Calculating the circumference of circle.

#include <iostream>
#include <iostream>
#include <cmath>
#define PI 3.142
usingnamespace std;
class Circle
        int r; //Data Members, declare r as an integer
        float area, cir, x, y; //declare area, cir, x and y as floats
               Circle(); // Constructor
               Circle(float, float, int);
               float getCirc();
               float getArea();
// Function Definitions
Circle :: Circle() // Constructor function
        r = 0;
        area = 0.0;
        cir = 0.0;
        x = 0.0;
        y = 0.0;
Circle::Circle(float x_, float y_, int r_) {
float Circle::getArea() {
        return (float)M_PI*r*r;
float Circle::getCirc() {
        return (float)(2*M_PI*r);
int main()
        Circle c(1, 2, 3); // c is an object of class Circle
        cout << "The area is " << c.getArea() << endl;
        cout << "The circumference is " << c.getCirc() << endl;
        return 0;



  Umwihariko wa Gahogo Adventist Academy/ Fees Payment Modes/Amatangazo/Announcements

The way the teachers  assign  the    marks to


 Please Teachers, Click here to write marks on students' reports


You click here to view the answers for 1st term, 2015 Examination for S6 MCE & MPC






  • The  holidays package consist of four different subjects include Economics, Entrepreneurship, Geography and Computer Science, and General Paper(For this GP Deadline for submission of the groupwork is 31/8/2015 at 4.30pm).
  • The student has to choose the one that he/she is concerned with.
  • Submission date :  August 17th 2015
  • Attempt all questions
  • The student will not be allowed to enter in class without submitting the work
  • This work will be recorded as the first quiz in third term



1. Discuss the causes of income inequality in less developed countries

2. a) Outline  any 2 advantages of monopoly                                                                     

  b) Why and how should monopoly be controlled?                                                     

3. a) What is production?                                                                                              

   b) At what level is it carried out? And explain                                                                                        

4. What problems are faced by tax authorities in your country?

5. Given the following demand and supply functions as:Qd=72+8P    Qs=90+6P

  Suppose price P is fixed at 20 francs per unit.

    i)Find out the quantity supplied and quantity demanded

   ii) Determine whether there is shortage or surplus in the market

   iii) What is shortage/what is surplus?

6. Study the following table on commodities W, Y, Z and answer the following questions:

Quantity of W(per Kg)

Price of Y( per Rwf)

Price of Z(Rwf)







 a)      Calculate the price elasticity of demand of commodity Z.

b)      Calculate the cross elasticity of demand of commodity Y and Z.

7 .a) Explain six (6) main measures used by the government to control price fluctuations

      b)  Explain the causes of fluctuations in prices of agricultural products as compared to prices of manufactured products

8.  a) Explain why a firm will continue in production even when its total revenue is less than its total costs

       b) Differentiate minimum price (price floor) from maximum price (price ceiling), by using diagrams.

9. a) Outline the roles of credit in agricultural development

b) Why is credit difficult to avail to the agricultural sector in your country?

10. a) Distinguish between perfect competition and monopoly market structures

     b) Explain different characteristics of both types of market structure

 Posted by MAOMBI Josaphat



 1.a)What is structural adjustment program?

    b)Give any 4 conditionalities  for SAPs

 2.a)Differenciate between visible trade and invisible trade

   b)Give  any 3 advantages of international trade

 3 .a) Tax is a non quid pro quo payment.

  b) Give any 3 canons of taxation

 4.i)What is informal sector?

 ii)Give 2 features of informal sector in your country

 iii)What are 2 measures has your country adopted to attract foreign investors?

 5.a)What is a central bank?     

 b) What roles are played by the central bank in your country

 6. Study the following table on commodities W, Y, Z and answer the following questions:

 Quantity of W(per Kg)

Price of Y( per Rwf)

Price of Z(Rwf)







 a)      Calculate the price elasticity of demand of commodity Z.

 b)      Calculate the cross elasticity of demand of commodity Y and Z.

 7.  a)  Explain six (6) main measures used by the government to control price fluctuations

       b)  Explain the causes of fluctuations in prices of agricultural products as compared to prices of manufactured products.

 8. Study the following table and answer the related questions for it.

 Units of output(Q)





















































 a)      Fill in this table

 b)      Establish the relationship between between MC and TC

 8.  a) Explain why a firm will continue in production even when its total revenue is less than its total costs

        b) Differentiate minimum price (price floor) from maximum price (price ceiling), by using diagrams.

 9.What are the causes of income inequality in less developed countries

 10.a)Outline  any 2 advantages of monopoly                                                                     

 b)Why and how should monopoly be controlled ?                                                     

 11.a)What is production?                                                                                              

 b)At what level is it carried out?                                                                                       

 12. What problems are faced by tax authorities in your country?                  

 13. Given the following demand and supply functions as:Qd=72+8P    Qs=90+6P

 Suppose price P is fixed at 20 francs per unit.

 i) Find out the quantity supplied and quantity demanded

 ii) Determine whether there is shortage or surplus in the market

 iii) What is shortage/what is surplus?

 14. Differentiate the following concepts:                                        

 a)      Absolute price from relative price

 b)      Effective demand from ineffective demand

 c)      Firm from industry

 d)      Break-even point from shutdown point

 e)      Marginal utility from total utility

 15. Suppose that the supply schedule of Maine Lobsters is as follows:        (5 marks)

 Price of Lobster(Per Rwf)


Quantity of lobster supplied(Per Kg)











 Suppose the Maine Lobster can be sold only in MUHANGA District. The MUHANGA District demand schedule for Maine Lobster is as follows:

 Price of Lobster(Per Rwf)


Quantity of Lobster demanded(Per Kg)











         a) Draw the demand curve and the supply curve for Maine Lobster.

         b) What are the equilibrium price and quantity of Lobsters?

Posted by MAOMBI Josaphat



                  QUESTION ONE    

Show how entrepreneur differs from Intrapreneur.


               QUESTION TWO

a)      Differentiate debtor and creditor 

b)      State the different obligations of debtor and creditor 

               QUESTION THREE

a)      Differentiate cash discount and trade discount  

b)      Bizimana investments bought 5 dozen of notebooks at 10,000 RWF. The firm was allowed a 20% trade discount because of bulk purchase and 10% cash discount if he paid within one month. If he paid within the stated period, how much was he paid?

             QUESTION FOUR

Peter plans to buy a car after three years .The car is expected to cost 220,000.Peter deposits 80,000RWF at the beginning of the first year and 40,000 RWF at the beginning of the 2nd year .Calculate the amount which should be deposited at the beginning of the 3rd year. If compound interest is paid at the rate of 10% in order to enable him to buy the car  

                     QUESTION FIVE

Jacqueline is considering TWO projects for which she wants to get a loan from Bank of Kigali .T he projects will bring the following cash follows






















Jacqueline accepts an only project which brings back the money she used to start (payback period) of four years or less

a)      What are the total cash inflows for each project?

b)      What is the payback period for these TWO projects?

c)      Which project will she choose given her requirement?

           QUESTION SIX

a)Explain how can we provide financial accountability 

 b)Give any five attributes that are required on the party of an entrepreneur to sense the opportunities 


a)On January 2013 Kwizera started an enterprise with 600,000 RWF at hand and building estimated to 2,000,000 RWF. He bought furniture for 100,000 RWF, equipment for 60,000 RWF, and goods for 240,000 RWF and deposit half of the remaining money into the bank, keeping the others as cash.

           Required: Draw up his opening balance sheet. 

            b) Describe any six types of interest rate


A company is considering expanding its production. It can go in either for automatic machine costing RWF 224,000 with any estimated life of 5 years and half or any ordinary machine costing RWF 60,000 having an estimated life of 8 years. The annual sale and costs are estimated of 8 years. The annual sales and cost estimated as follows:

Automatic machine                                                                                     Ordinary machine

Sales: 150,000                                                                                                    sales: 150, 0000

Costs                                                                                                                           Costs

Materials: 50,000                                                                                           Materials: 50,000

Labors 12,000                                                                                                  Labors: 60,000

Other variable expenses: 24,000                                                   Other variable expenses: 20,000

Calculate payback period and advise the management

a)      On March, 20, 1945, 200$ was invested as fund paying 5 % compounded semi- annually. How much fund on September 20.1961?

              QUESTION NINE

a)      Describe the factors that influence the choice of career in life.

b)      Ability to gather information is vital for establishing an enterprise .Do you agree with this statements? Give five reasons support your answers 

             QUESTION TEN

Keita started business on 1st, January, 2013 with capital of 10,000 which he paid directly into the business bank .During the month of January, he had the following transactions

2011, Jan                                                                                                                                                  RWF

6th   purchased a motor vehicle by cheque   4,000

9th bought goods for resale on credit from Ezekiel  2,000

13rd   sold goods to Evelyn on credit    1,500

22nd sold goods for cash to e Emmanuel  1,200

26th paid Ezekiel by cheque     2,000


 a)  Prepare Keita ‘journal                                                                                                                                                                              b) Open relevant Ledger account                                                                                                                                                           c)   Prepare Keita’s trial balance                      



Minani’s trial balance on 31st, December 2010 showed a difference of 8,000 RWF being a shortage on the debit side.  Later on January, 15th 2011, all the errors from the previous years were discovered

a)      The cheque of RWF 15,300 paid to  Umase  had been entered in the cash boob, but  had not been entered in Umase ‘s account

b)      The purchase  account had been under added by RWF 2,300

c)      A cheque of RWF 9,600 received from Norbert had been correctly entered in the cash book, but had not been entered in Norbert’s account.

Required: a)   Rectification of entries in the journal      

b) Ledger account

c) Rectification of entries in suspense account  



BUGINGO and Brothers Limited is a shoes manufacturing company 2010.The Company sold 62,000 pairs of Shoes at price of 650 RWF per pairs. The expenses of this company can divided into the following

Total variable cost    : 850,500 RWF

Total fixed cost: 520,600 RWF

            Required: a) Calculate breakeven point in quantity and in value /


At the beginning of 2015, an enterprise presented the balance sheet as follows:

Karangwa Enterprises

Balance sheet as on 1st January1, 20015

Assets                                                                                         Capital and Liabilities


Material………………………. 90,000Rwf




Cash…………………………… 3,500Rwf


Long-term loan …………….. 32,000Rwf


Total                                       501,500Rwf

Total                                       501,500Rwf

The following transactions were made during the accounting period:

a)      3rd Bought goods on credit 8,000Rwf from Pamela.

b)      5th Paid by cheque in partial settlement of a long-term loan, 10,000Rwf.

c)       7th Paid Mrs. Jeannine in full settlement by cash 950Rwf.

d)      9th Bought material, paid by cheque 10,000Rwf.

You are required to:

Enter the above transactions into the journal , post them into the ledger accounts and prepare a trial balance.


   During the Month of April the movement of the product N were as follows;

   April 01 Stock 5t cost of purchase 75400rwf

        ‘’    08 Issued note no 30: 4t

        “    09.Receiving slip no11:30t;cost of purchase 449,490rwf

         “  12 Issued note no 31:10t

         “   15 Issued note no32:12t

          “  18 Issued note no33: 8t

          “   19 Receiving slip no12:25t;cost of purchase 375,600rwf

         “  22 Issued note no34: 10t

Prepare the stock record card by using FIFO Method?   

 Posted by Josaphat MAOMBI

Umwihariko wa Gahogo Adventist Academy/ Fees Payment Modes/ Amatangazo/Announcements



Head Teacher

+250 788 659 851