A file contains records of students sorted into undergraduates followed by postgraduates. Undergraduate students pay fees at rate A and postgraduates at rate B. Students from other countries pay fees at rate E for undergraduates and rate G for postgraduates.
a) Draw a physical data structure diagram for the file
b) Draw a logical DSD when its required to produced a list of all students who have paid their fees.
c) Draw a logical DSD for a program listing foreign postgraduates students
d) Draw a DSD for a program listing undergraduates who have not paid their fees.
Showing posts with label tutorials. Show all posts
Showing posts with label tutorials. Show all posts
Monday, January 2, 2012
Monday, December 19, 2011
Chapter 3: Part 1
Exercise 3.2 (Page 3-13)
=============
A sports club maintains records of its members showing name, category of membership and payment details. Members are either life members or standard members. Life members do not pay membership fees, so no payment details are needed.
Draw a data structure diagram to represent this data.
Exercise 3.4 (Page 3-16)
=============
The treasurer of a local sports and social club wishes to record all financial transactions on the computer. The club has four different categories of membership; junior, senior, life membership and monthly membership. As a consequence, different subscription rates apply.
Juniors and life members do not pay subscriptions. Subscriptions are payable each January for senior members, whereas monthly members pay monthly, 12 times per year. The treasurer wants a record of when members have paid so that, at the end of the financial year (December) when he does his accounts, he can identify those members who have missed paying a subscription.
Draw a structure diagram for the file.
Exercise 3.3 (Page 3-13)
=============
A train consists of an engine followed by a number of 1st class coaches, then a number of 2nd class coaches with a guards van at the end. Draw a data structure diagram to represent this structure.
Exercise 3.6 (Page 3-18)
=============
Produce the data structure diagram for the following file:
Stock File:
===========
- There are two types of records within this file, the main record and trailer records.
- Each main record is followed by as many trailer records as there are outstanding orders for that part.
- Note that these trailer records are part of the data in the record.
Main record:
=============
- Part number
- Description
- Quantity in stores
- Minimum re-order quantity
- Delivery lead times (weeks)
- Current price
Trailer records:
================
- Order number
- Order quantity
- Order week number
=============
A sports club maintains records of its members showing name, category of membership and payment details. Members are either life members or standard members. Life members do not pay membership fees, so no payment details are needed.
Draw a data structure diagram to represent this data.
Exercise 3.4 (Page 3-16)
=============
The treasurer of a local sports and social club wishes to record all financial transactions on the computer. The club has four different categories of membership; junior, senior, life membership and monthly membership. As a consequence, different subscription rates apply.
Juniors and life members do not pay subscriptions. Subscriptions are payable each January for senior members, whereas monthly members pay monthly, 12 times per year. The treasurer wants a record of when members have paid so that, at the end of the financial year (December) when he does his accounts, he can identify those members who have missed paying a subscription.
Draw a structure diagram for the file.
Exercise 3.3 (Page 3-13)
=============
A train consists of an engine followed by a number of 1st class coaches, then a number of 2nd class coaches with a guards van at the end. Draw a data structure diagram to represent this structure.
Exercise 3.6 (Page 3-18)
=============
Produce the data structure diagram for the following file:
Stock File:
===========
- There are two types of records within this file, the main record and trailer records.
- Each main record is followed by as many trailer records as there are outstanding orders for that part.
- Note that these trailer records are part of the data in the record.
Main record:
=============
- Part number
- Description
- Quantity in stores
- Minimum re-order quantity
- Delivery lead times (weeks)
- Current price
Trailer records:
================
- Order number
- Order quantity
- Order week number
Monday, December 12, 2011
Tutorial 2: Chapter 2 - Week 2
*Past Year Paper: December 2009
QUESTION 1 (4 Marks)
Write pseudocode for a WHILE loop to display the following numbers in the given order:
1 3 5 7 9
QUESTION 2 (4 Marks)
Explain the similarities and differences between a variable and a constant in a program.
QUESTION 3 (7 Marks)
Write pseudo-code to solve the following problem:
Your program needs to calculate the cost of paint for a rectangular wall, given the height and
width of the wall in metres and the cost of the paint as 80 pence per square metre. The result
should be printed out in pounds and pence (1 pound = 100 pence). You can assume that the
dimensions of the wall are an exact number (integer) of metres.
Your program should display the message “invalid entry” if the height and the width are the
same.
Note: Cost off Paint = height * width * cost
QUESTION 4 (10 Marks)
Write pseudocode for the Straight Selection sort algorithm to sort TEN (10) integers.
*Past Year Paper: September 2009
QUESTION 5 (4 Marks)
Give the following function, procedure and main program in pseudo-code:
INTEGER FUNCTION sum (num1, num2 of TYPE Integer)
RETURN num1+num2
ENDFUNCTION
PROCEDURE displayResult (name of TYPE String, total of TYPE
Integer)
Display name
Display total
ENDPROCEDURE
MAIN Program
use variable:
name of TYPE String
num1, num2, total of Integer
ACCEPT name
ACCEPT num1
ACCEPT num2
//missing statement 1 – call the function sum
//missing statement 2 – call the displayResult procedure
ENDMAIN
Write the missing statements to call the function and procedure.
(Note: the total variable can be used to hold the value returned by the sum function)
QUESTION 6 (8 Marks)
State FOUR (4) reasons for using procedures or functions.
QUESTION 7 (2 Marks)
Explain the differents between Attributes and Operations in the context of a class.
QUESTION 8 (8 Marks)
Write pseudo-code to solve the following problem:
Your system must allow the user to input FIVE (5) employee's annual incomes. If the annual
income is greater or equal to $100,000, a 10% tax on the income must be charged on the whole
salary, otherwise only 4% will be charged.
QUESTION 1 (4 Marks)
Write pseudocode for a WHILE loop to display the following numbers in the given order:
1 3 5 7 9
QUESTION 2 (4 Marks)
Explain the similarities and differences between a variable and a constant in a program.
QUESTION 3 (7 Marks)
Write pseudo-code to solve the following problem:
Your program needs to calculate the cost of paint for a rectangular wall, given the height and
width of the wall in metres and the cost of the paint as 80 pence per square metre. The result
should be printed out in pounds and pence (1 pound = 100 pence). You can assume that the
dimensions of the wall are an exact number (integer) of metres.
Your program should display the message “invalid entry” if the height and the width are the
same.
Note: Cost off Paint = height * width * cost
QUESTION 4 (10 Marks)
Write pseudocode for the Straight Selection sort algorithm to sort TEN (10) integers.
*Past Year Paper: September 2009
QUESTION 5 (4 Marks)
Give the following function, procedure and main program in pseudo-code:
INTEGER FUNCTION sum (num1, num2 of TYPE Integer)
RETURN num1+num2
ENDFUNCTION
PROCEDURE displayResult (name of TYPE String, total of TYPE
Integer)
Display name
Display total
ENDPROCEDURE
MAIN Program
use variable:
name of TYPE String
num1, num2, total of Integer
ACCEPT name
ACCEPT num1
ACCEPT num2
//missing statement 1 – call the function sum
//missing statement 2 – call the displayResult procedure
ENDMAIN
Write the missing statements to call the function and procedure.
(Note: the total variable can be used to hold the value returned by the sum function)
QUESTION 6 (8 Marks)
State FOUR (4) reasons for using procedures or functions.
QUESTION 7 (2 Marks)
Explain the differents between Attributes and Operations in the context of a class.
QUESTION 8 (8 Marks)
Write pseudo-code to solve the following problem:
Your system must allow the user to input FIVE (5) employee's annual incomes. If the annual
income is greater or equal to $100,000, a 10% tax on the income must be charged on the whole
salary, otherwise only 4% will be charged.
Wednesday, December 7, 2011
Tutorial 1 - Week 1
Question 1 (4 Marks)
====================
Explain the differences between First
Generation Languages and Fourth
Languages.
Question 2 (4 Marks)
====================
Define the difference between public
and private methods.
Question 3 (4 Marks)
====================
Explain the meaning of an association
as used in Object Oriented. Give
example of an association.
Question 4 (4 Marks)
====================
Explain the difference between a class
and an object.
Question 5 (4 Marks)
====================
Explain the differences between
Functional Languages and Logic
Programming.
Question 6 (4 Marks)
====================
Briefly describe the main features of
object oriented languages.
Question 7 (4 Marks)
====================
Give TWO examples of an open source
programming language.
====================
Explain the differences between First
Generation Languages and Fourth
Languages.
Question 2 (4 Marks)
====================
Define the difference between public
and private methods.
Question 3 (4 Marks)
====================
Explain the meaning of an association
as used in Object Oriented. Give
example of an association.
Question 4 (4 Marks)
====================
Explain the difference between a class
and an object.
Question 5 (4 Marks)
====================
Explain the differences between
Functional Languages and Logic
Programming.
Question 6 (4 Marks)
====================
Briefly describe the main features of
object oriented languages.
Question 7 (4 Marks)
====================
Give TWO examples of an open source
programming language.
Subscribe to:
Posts (Atom)