Вы находитесь на странице: 1из 65

Rapid Application

Development
Pass Paper

J.Thavaruban BAT/IT/2017/F/021
M.Sajithkumar BAT/IT/2017/F/042
Content

2015 passpaper & Answer

2016 passpaper & Answer

2017 passpaper & Answer
Answer

Q1
I. Writing the code
Checking the syntax
errors Compiling and
interpreting
Debugging
Running the application

ii. Windows Form


Application Class
Libraries
Console
Application
Silverlight
Application WPF
Application

iii. True

iv. Static variable initialized once and add every


time when execute the code

v. Butto
n
Label
Text Box
Combo Box
List Box
Rich Text Box
List view
Picture box
Q2

i.
Risks associated with teams.
If a team of developers, end
users, and systems maintainers have not
worked together before and do not learn to
communicate effectively, they are not likely to
develop a successful system without schedule
delays or cost overruns. Other risks are
associated with the lack of well-defined or well-
understood processes.

Risks associated with technology.


Teams that pursue a new technical approach
(for example, the first venture into client-server
computing) find that the lack of experience
with a new technology, architecture, or
development approach contributes to failure.

Risk associated with requirements.

Most often-cited reason for failure is poor


management of requirements characterized
by:
– frequently changing requirements,
– requirements that are not well understood,
and
– requirements explosion
II. There is a long delay before the customer sees
any results Developments can take a long time
and sometimes a business may change during
that period There is nothing until 100% of the
process is finished.
iii.

Advantages of the RAD :

 Reduced development time.


 Increases reusability of components
 Quick initial reviews occur
 Encourages customer feedback
 Integration from very beginning solves a lot of
integration issues.

Disadvantages of RAD :

 Depends on strong team and individual


performances for identifying business
requirements.
 Only system that can be modularized can be
built using
RAD
 Requires highly skilled developers/designers.
 High dependency on modeling skills
 Inapplicable to cheaper projects as cost of

modeling and automated code generation is


very high.

iv.

To achieve rapid development you need to avoid


making any big mistakes.
Some inefficient development practices have
been chosen so often with such predictable bad
results that they deserve to be
called “classic mistakes”.
They have been made so often and their
consequences have become easy to predict.
The classic mistakes rarely produce the
results that people hope for.
4 types of classic mistakes

• People related classic mistakes


• Product related classic mistakes
• Technology related classic mistakes
• Process related classic mistakes

v.
 Using the right mix of methodologies, tools,
personnel and management and the correct
use of best practices.
 The optimal is a team of users and
developers who can communicate
effectively and successfully develop their
products without schedule delays or cost
over runs.
 Experience counts. An experienced team,
developing a similar system to one that it has
previously developed, with a customer and end
user with whom it can communicate well, is much
more likely to produce high-quality software
intensive systems on time and at cost.
 Having a well-trained, fully collaborative team is
an essential ingredient for success in a RAD
project.
• The core of the team
– should be full participants in project planning.
– should stay together from start to finish.
– Support tools should be provided to those
who have skills in using them
Q3

a) Do While count <= 15

sum += count ^ 2
count += 2
Loop

b) Do Until counterIndex < 1

MessageBox.Show(counterIndex)
counterIndex -= 1
Loop
ii

a) Error: The sentinel value (-1) is added to total


producing an incorrect sum.

total = 0
Console.Write("Enter a value")
number = Console.ReadLine()
Do Until number = -1
total += number
Console.WriteLine("Enter a value")
number = Console.ReadLine()
Loop
Console.WriteLine(total)
b) Errors: The counter is never incremented,
resulting in an infinite loop. The repetition
condition
uses the wrong comparison operator.
Keywords While End are used instead of keyword
Loop.

Dim number As Integer = 1


Do While number <= 10
MessageBox.Show(number ^ 2)
number += 1
Loop

iii a) True.

b)False. Different namespaces can have classes,


methods and properties with the same names.
c)True.

d)False. A module cannot access


Protected members directly, and must
use the class’s Public methods and
properties to access the data.

e) True

Q4
i.
 Disconnected data architecture
 Data cached in Datasets
 Supports scalability by working with Dataset
 Data transfer in XML format
 Interaction with the database is done
through data command
ii.

VB.NET
Application

Data
Accessing retrieved data Retrieve
Provider Data
Databa
se

Dataset

 The data residing in a database is retrieved


through
Data Provider
 An application can access the database
either via a Dataset or Data Reader
objects
iiii.
 Dataset is a cached set of database records.
 (Data Adapter resides between the
Dataset and the Database
 It is filled by the data from the Data Adapter.
 Modified data directly transfer to the Data
Adapter not to the Database.

iv.

OLEDB Data SQL Server Data


Provider Provider
 Works with all  Works specifically
OLEDB providers with Microsoft SQL
such as SQL server
OLEDB,JET OLEDB ,
Oracle OLEDB
 OLEDB data  SQL server data
provider classes provider classes are
are present in the present in the
namespace namespace
System,Data.Oledb System,Data.Sqlclie
nt

v.

 Connection: Used to established a connection


with a data source
 Data Adapter: Retrieves data from a database
into a dataset When changes made to the
dataset, then Data Adapter make those
changes in the database.Data adapter first
compare the data in the dataset with that in
the database and then updates the database
Data Command: An object representing a SQL
statement or a stored procedure that is used to
retrieve, insert, delete, and modify data in a data
source.

For retrieving data through data commands, a


connection object is created first to connect the
database from where the data is to be retrieved.

Data Reader:used to retrieve data from a data source in


read only and forward only mode.A data reader uses
connection object to connect the database The command
object to execute SQL statements or procedures on the
database and retrieves the data in sequential mode Using
data reader results in faster access to data and less
memory usage since at any time Only a single row is
stored in the memory

Q6

i.
Class : Generic name that describe the set
of objects
Object : Instance of a class that perform
task
Namespace : Organization of the system
ii.
amount
accountHolder
Value
iii.
(a)
Create class library name BankAccount
Create windows Form Application
BankAccountClient Add Reference class library
to windows form application

(b)
PrivateSub btnDisplay_Click(sender As
System.Object, e As System.EventArgs)Handles
btnDisplay.Click
Dim account As New BankAccount.BAccount
account.Name = "HNDIT"
account.Deposit(100.0)
txtName.Text = account.Name()
txtBalance.Text = account.balance
End Sub
Answer

Q1
a) Usable systems are built within a short period of
time.

b)
 Cost and schedule overruns
 Product not fit for business
 High workload
 Projects get cancelled
 Friction among managers, developers and
customers
c)
 People related
 Product related
 Technology related
 Process related
d)
 Visual studio dot net
 Netbeans
 EasyEclipse
 Jbuilder

e) The Developments are time boxed, delivered and


then assembled into a working prototype. This can
quickly give the customer something to see and use
and to provide feedback regarding the delivery and
their requirements. Users have to be involved in the
development. which means system is more likely to
meet their requirement. there fore RAD is customer
oriented
Q2
a) > Greater
then <
Less then
= equal to
<> Not equal to
>= Greater then or equal to
<= Less then or equal to

b)
 Not
 Or
 And
 Xor

c) Dim a As
Integer Dim b
As Integer
Dim t As
Integer Dim d
As Integer
a= InputBox(“Enter first number:”)
b =InputBox(“Enter second
number:”) if(a>b)Then
t=a
a=b
b=t
End if
d = b-a
MsgBox(“The positive differencr is “ & d)
d)
i. IbIUnits,txtUnits
btnCalculate
IbIAmount,txtAmo
unt
ii. Private Sub btnCalculate_click
Dim units As
Integer Dim
amount As Double

units = txtUnits.Text
If(units <= 30 )Then
amount = units * 5
Elseif (units <= 60) Then
amount = 30*5+(units-30)*7.5
Elseif (units <= 90) Then
amount = 30*5+30*7.5+(units-60)*11
Else
Amount=
30*5+30*7.5+30*11(units-90)*15 End
if
txtAmount.Text=amount
End Sub

Q3
a) The while loop is run until condition is
true once condition false loop is
terminate. until loop is run until condition
is false and once condition become true
loop is terminate.
b) Dim p , n, I As Integer
P=1
Print(“Prime numbers 1-100 are :”)
For n= 1 to 100
For i = 2 to n-1
If n mod I =0 Then
P=0
Exit for
Else
P=1
End if
Next
If p =1 Then
TextBox1.Text=TextBox.Text & n & vbcrlf
End if
Next

c)
i. *
**
***
****
*****

ii. textbox1=
>30
textbox
2=>55
Q4

a) A set or block of code statements, used for


repeated or shared task that is gives a name so
that it can be invoked by another part of the
program

b)
Keyword Definition

Public Accessible everywhere

Private Accessible only within the type itself

Accessible within the type itself and all


Friend namespaces
and code within the same assembly
Only for use on class members, accessible
Protected within
the class itself and any derived classes
Protected friend The union of protected and friend

c) By Val = pass only the value of original


variable By Ref = pass a reference to
original variable

d) a) privatefunction TotalMarks(ByVal sub1 AsInteger,


ByValsub2 AsInteger, ByVal sub3 AsInteger) AsInteger
Dim tot as
integer
Tot=sub1+sub2
+sub3 Return tot
End function
b)privatefunction AverageMarks(ByVal sub1 AsInteger,
ByValsub2 AsInteger, ByVal sub3 AsInteger) AsInteger
Dim avg as integer
avg =
(sub1+sub2+sub3)/3
Return avg
End function

Q5
a) A class is a blue print that describes as object and
defines attributes and operations for the object
As object is instance of a class

b)Identity : objects are distinguishable from one another


Behavior : objects can perform tasks
State : objects store information that can very over time

c) You can define method or property multiple times


with different argument list
Derived class can override an Inherited property or
method

d)Inheritance specifies an “is-a—kind-of” relationship


Multiple classes share the same attributes and
operatiojs,allowing efficient code reuse

e)Base OtherMethod- not


overridable Derived
overrideMethod
Q6
a) import system.Data.sqlclient
Dim connection As sqlconnection = new
sqlconnection() Connection.connectionString
= “Data Source= ATI;
Initial catlog = studentReg;Integerated
Security=True”

b) connection.Open()
Dim cmsql As New SqlCommand
Cmsql.connection = connection
Cmsql.commandText = “INSERT INTO
VALUES (‘ “ &txtStNo.Text & “ ‘,’” &
txtStFName.Text & “ ‘, “ & val(txtAge.Text)&”,”&
cboCourse.SelectedValue.ToString & “,”&
cboDiA.Value.Date & “)”
Cmsql.ExecuteNonquery()
MsgBox(“Data inserted”)

c) connection.Open()
Dim cmsql As New
SqlCommand
Cmsql1.connection =
connection
Cmsql1.commandText=”UPDATE
studentReg SET Course= “ +
cboCourse.SelectedItem+ “ WHERE
StNo=”+txtStNo.Text + “”
cmsql1.ExecuteNonQuery()

MsgBox(“Data updated”)
d) connection.open()
Dim cmsql2 As New SqlCommand
Cmsql2.connection=connection
Cmsql2.CommandText=”SELECT * from
studentReg
WHERE stNo=”+
txtStNo.Text + “”
adeptor = New01eDbDataAdapter(cmsql2)
dataset = NewDataSet()
adaptor.fill(dataset,”ST”)

txtStFname.Text=dataset.Tables(0),Rows(0),Item(“st
Fname”)
txtAge.Text=dataset.Tables(0),Rows(0),Item(“Ag
e”)

cmbCource.Text =
dataset.Tables(0).Rows(0),Item(“Course”)
cboDoA.Value=
dataset.Tables(0).Rows(0),Item(“DoA”)
cmsql2.Excw=ecuteNonQuery()
2017
Question-01
a) Give four (04) characteristics of rapid application
development
 RAD uses hybrid teams
 RAD Uses specialized tools that can support
 RAD uses “Time boxing”
 RAD uses iterative, evolutionary prototyping
 RAD uses iterative, evolutionary prototyping
(contd...)

b) Briefly explain the team “classic mistake”.


To achieve rapid application development you needed to
avoid making any big mistakes. Some inefficient
development practice have been chosen so often with such
predictable bad results that they deserve to be called
“classic mistakes”

c) Give four categories of “classic mistake”.


 People related
 Product related
 Technology related
 Process related

d) What do you mean by “commercial off-the-shelf”(COST)


based development. give the advantages of COTS based
development rather than other traditional development

• COTS based approach reuses components that are complete


application systems.

• A prototype can be created by linking a database, a word


processor, a spreadsheet, and written code to find
relationships between the requirements
• Advantage of this approach:
– A lots of application functionality can be implemented
quickly at a very low cost.
e) Briefly explain when it is more suitable to use rapid application
development
 Quick delivery
 Faster market analysis
 User feedback
 Ease to incorporate changes
 System integration

Question-02

a) Write three (03) properties of variable.


 Integral types (SByte, Byte, Short, UShort, Integer,
UInteger, Long, ULong and Char )
 Floating point types (Single and Double)
 Decimal types (Decimal)
 Boolean types (True or False values, as assigned)
 Data type

b) Give three (03) rules you follow when you define a variable.
 A variable name must be of the form $name or ${name}.
 The string name can consist of letters (a-z and A-Z),
numbers (0-9), and underscore characters (_).
 The first character of name must be an alphabetic character
(a-z or A-Z).
 If the ${name} form is used, spaces can also appear in
name. This allows you to use multiple word names without
the underscore character
c) What is the difference implicit type conversion and explicit type
conversion?

Explicit
Implicit Conversion Conversion

Conversio
Implicit Conversion is done automatically. Explicit n is
done programmatically.
In Implicit conversion, no data loss take place In explicit conversion, data loss may
during the or may
not be take place during data
data conversion. conversion.
Hence there is a risk of information
loss.
No possibility of throwing exception during It might throw error if
the tried to do
without type
conversion and therefore is called type safe. casting.
Implicit conversion do not require any special conversi require
syntax. Explicit on do cast
operator to perform
conversion.

Example: Example:
Conversion of smaller number to larger number Conversion large
is implicit of r number to smaller
number is explicit
conversion. conversion.
float
Conversion of integer type data to float. k=123.45
int i= (int)
float I=0; k
int j= 10;
// This is implicit conversion since float
is larger
than integer, hence no loss of data & no
exception.

d) Following interface has been created to register student for


SLIATE examination Fill in the blanks (1 to 10) of following source
code considering above form and table.
Dim name As String
Dim ati As String
Dim sex As String
Dim DOB As (1) . . . . . . .
Dim age As (2) . . . . . . .
Dim rengo As String

Name = (3) . . . . . . .
Ati = (4) . . . . . . . .
Category Control Property Value

Label lblName Name IbIName

Text Name

lblAti Name IbIAti

Text ATI/ATI section

lblSex Name IbISex

Text Sex

lblDob Name IbIDob

Text Date of Birth

lblAge Name IbIAge

Text Age

lblRegno Name Iblregno

Text Name

Text box txtName Name txtName

Text Name

MaskedTextBox maskedtxtRegno Name maskedtxtRengo

/
A/MP/IT/2/0/17/F/000
Mask 0

DateTimePicker dtpDob Name dtpDob

Radio Button radMale Name dtpMale

Text Male

checked Ture
radFemale Name dtpFemale
Text Female

checked False

Combo box cmbAti Name cmbAti

Item Ampara
Anuradapura
Badula
Batticaloa

List box 1stDetails Name 1st Details


text

btnSubm
Button it Name btnSubmit

Text Submit

If radMale.
(5) . . . . . . . Then
Sex =
“Male”
ElseIf RadFemale.(6) . . .
..... Then
Sex = “Female”
End If
Dob =
(7) . . . . . . . ..
Age =
(8) . . . . . . . . .
Regno =
(9) . . . . . ....
(10) . . . . . .
... . (“Student Information”)
.........
... (“-------------------”)
.........
... (“Student name:” & name)
.........
... (“ATI/ATI Section:” & ati)
. . . . . . . . . . . . (“Sex:” & sex)
. . . . . . . . . . . . (“Date of birth:” & dob)
. . . . . . . . . . . . (“Age:” & age)
. . . . . . . . . . . . (“Reg number:” & regno)
d.
1.date
2.int
3.txtname.Text
4.cmbAti.SelectedItem
5.True
6.True
7.dtp.Dob
8.Txtage
9.TxtRego
10. Message.show()
Message.show()
Message.show()
Message.show()

Question-03

a) Give four (04) control structures available in VB.NET for


repetitions
 Sequential
 Selection / Decisions
 Repetition / Looping

b) Write visual basic code (Windows Application) to find the


factorial value of any given number using input box and
display in textbox.
Hind: factorial of 4 is 4*3*2*1=24

Private Sub Label1_Click(sender As Object, e As EventArgs)


Handles Label1.Click Dim n, i, f As Integer
n = Val(InputBox("Enter the number"))
i=1
f=1
While (i <= n)
f=f*i
i=i+1
End While
TextBox2.Text = f

End Sub
End Class

c) Write VB.NET array declaration for a multi-dimensional


array to keep following data
ATI Name No of Student

Gampaha 2500
Kurunegala 3000
Jaffna 2800
Kandy 1500
d) Write a VB.NET code segment to display the content of
above multidimensional array in a textbox as shows in
following figure
Hint: use for loop

e) What is the method available in VB.NET to take total number


of elements in a multidimensional array?

Clear, GetLength, GetUpperBound

Question-04
a) Write the syntaxes for VB.NET functional and sub procedure.
Function
Attributelist
Accessmodifier
Proceduremodifier

Sub procedure
Declaration.00
Calling

b) What is the different between passings by Value reference?


Give an example for each.
When a parameter is passed by reference, the caller and
the called use the same Variable for the parameter. If the
called modifies the parameter variable, the effect is visible to
the caller's variable.
void Func2(int& x, double& y)
{
x = 12;
y = 20.5;
}

When a parameter is passed by value, the caller and caller


have two independent variables with the same value. If
the caller modifies the parameter variable, the effect is not
visible to the caller.

void Func1(int x, double y)


{
x = 12;
y = 20.5;
}
c) Write suitable VB.NET functions or sub procedures for the
following interface

I) Adding of two number


Private Sub btnadd_Click(sender As Object, e As
EventArgs) Handles btnadd.Click

Dim a, b, c As New Double


a = Val(txtnum1.Text)
b = Val(txtnum2.Text)
c = (a + b)
txtresult.Text = c
End Sub

II) Subtraction of two number


Private Sub btnsub_Click(sender As Object, e As
EventArgs) Handle
btnsub.Click Dim a, b,
c As New Double a =
Val(txtnum1.Text)
b = Val(txtnum2.Text)

c = (a - b)
txtresult.Text = c
End Sub

III) Multiplication of two number


Private Sub btnmul_Click(sender As Object, e As
EventArgs) Handles btnmul.Click
Dim a, b, c As New
Double a =
Val(txtnum1.Text)
b = Val(txtnum2.Text)

c = (a * b)
txtresult.Text = c
End Sub

IV) Division of two number


Private Sub btndiv_Click(sender As Object, e As
EventArgs) Handles btndiv.Click
Dim a, b, c As New Double
a = Val(txtnum1.Text)
b = Val(txtnum2.Text)

c = (a / b)
txtresult.Text = c
End Sub

Question-05
a) Consider the following two programs and answer the
questions given below.
Program A
Public class form4
Private sub button_click (ByVal sender As System.object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objv As New Toyota
Objv.drive (“driving a Toyota
car . . .”)
End sub
End class

Public Class vehicle


Public sub drive
msgBox(“Driving a car . . .”)
End sub
End class

Public class Toyota


Inherits vehicle
Public Overloads sub drive (ByVal text String)
msgBox(Text)
End Sub
End Class
Program B
Public class form4
Private sub button_click (ByVal sender As System.object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim objv As New Toyota
Objv.drive (“driving a Toyota
car . . .”)
End sub
End class

Public Class vehicle


Public sub drive
msgBox(“Driving a car . . .”)
Endsub
i) What will be the output of program A?
End class

Driving a Toyota car….

Public class Toyota


Inherits vehicle
ii) What will be the output of program B?
Public Overloads sub drive ()
Driving a Toyota car….
msgBox( “Driving a Toyota car . . .”)
End Sub
End Class

iii) What are the object oriented concepts use in above


program? Briefly explain it.

Polymorphism is the ability of an object to take on many


forms. The most common use of polymorphism in OOP
occurs when a parent class reference is used to refer to a
child class object.
Any Java object that can pass more than one IS-A test is
considered to be polymorphic. In Java, all Java objects are
polymorphic since any object will pass the IS-A test for
their own type and for the class Object.
There are two
types
Overloading
Overriding
iv) Briefly explain the difference of overloading method
and overriding method.

 Method overloading is used to increase the readability of


the program. Method overriding is used to provide the
specific implementation of the method that is already
provided by its super class.

performed
 Method overloading is within class.
Method overriding occurs in two classes that have IS-A
(inheritance)
relationshi
p.
method overloading, parameter differen
 In case of must be t.
In case of method overriding, parameter must be same.

 Method overloading is the example of compile time


polymorphism. Method overriding is the example of run
time polymorphism.

 In java, method overloading can't be performed by


changing return type of the method only. Return type can
be same or different in method overloading. But you must
have to change the parameter. Return type must be same
or covariant in method overriding.

b) Write a classed “Cal” for calculate followings.

i) Take addition of two number.


Public Class Cal

Private Sub Button1_Click(sender As Object, e As EventArgs)


Handles
Button1.Click
Dim a, b, c As New ComplexNumber
a.realNum = Val(TextBox1.Text)

b.realNum = Val(TextBox2.Text)
c = c.Addition(a, b)

TextBox3.Text = c.realNum
End Sub
End Class

Public Class ComplexNumber


Public realNum As Integer

Public Function Addition(num1 As


ComplexNumber, num2 As ComplexNumber) As
ComplexNumber
Dim result As New COmplexNumber
result.realNum = (num1.realNum +
num2.realNum)

Addition = result
End Function

End Class

ii) Take power (x2) of a number.


Private Sub Button1_Click(sender As Object, e As EventArgs)
Handles
Button1.Click
Dim a, b, c As New ComplexNumber
a.realNum = Val(TextBox1.Text)

b.realNum = Val(TextBox2.Text)

c = c.power(a, b)

TextBox3.Text = c.realNum
End Sub
End Class
Public Class ComplexNumber
Public realNum As Integer
Public Function reminder(num1 As
ComplexNumber, num2 As ComplexNumber) As
ComplexNumber
Dim result As New ComplexNumber
result.realNum = (num1.realNum ^
num2.realNum)

reminder = result
End Function

End Class

iii) Take reminder of two number.


Private Sub Button1_Click(sender As Object, e As
EventArgs) Handles Button1.Click
Dim a, b, c As New ComplexNumber
a.realNum = Val(TextBox1.Text)

b.realNum = Val(TextBox2.Text)

c = c.reminder(a, b)

TextBox3.Text = c.realNum
End Sub
End Class
Public Class ComplexNumber
Public realNum As Integer

Public Function reminder(num1 As


ComplexNumber, num2 As ComplexNumber) As
ComplexNumber
Dim result As New ComplexNumber
result.realNum = (num1.realNum Mod num2.realNum)

reminder = result
End Function

End Class
Question-06

a) Write the code segment for creating a database connection


for above form with the SQL Server Database.
Hint: Data Source = SLIATE (database name); Initial collage
= lecturer (table name); Integrated Security = true
Table name: Lecturer

Imports

System.Data.SqlClient

Public Class StudentManagementSystem


Dim Con as new SqlConnection ("SLIATE (database
name); Initial collage = lecturer (table name);
Integrated Security = true")
End Class

Вам также может понравиться