ICT 3611 EXAM PREP
ICT3611 Exam Pack Exam Prep MCQ study it File Processing always repeats just fit into the context Object and classes same just fit into the context Refer to oct/nov 2016 and may/June 2017 {Q4} The explanation you can do but code see below Dim m As Integer Dim n As Integer Try m = factorial(n) Catch e As PositiveIntegerException MsgBox (" Cannot pass a non - negative integer ...") End Try Definition refer to oct/nov 2016 and may/june 2017 {Q6} ICT3611 Exam Pack May/June 2017 P1 Question 2 2.1 Public Function CountEntriesFile(filename As String) As Integer Dim count As Integer = 0 Dim strmrdr As System.IO.StreamReader 'Open the file for reading strmrdr = new System .IO. StreamReader(fileName) 'Read one line of text until the end of the file Do Until strmrdr.EndOfStream Dim line As String = strmrdr.ReadLine() 'for both reading and adding to counter count += 1 Loop 'close the file () return count End Function 2.2 Public Function CountEntriesAge(filename As String) As Integer Dim entry_counter As Integer = 0 Dim age_counter As Integer = 0 If (System.File.Exists(filename)) Then entry_counter As Integer = CountEntires( filename ) age_counter As Integer = CountAges(age , filename ) Else MsgBox ("File does not exist") End If age_counter += 1 Return age_counter End Function 2.3 Public Function FrequencyOfAge(noTImes As Integer, noPlayers As Integer) As Integer Dim i, x As Integer = 0 Dim freqWord As Integer i = noTImes(CountEntriesAge(filename)) x = noTImes(CountEntriesFile(filename)) freqWord = x / i Return freqWord End Function ICT3611 Exam Pack Question 3 3.1 Classes that are extended by other classes and can be inherited from in terms of properties and methods. 3.2 Class MustInherit RentalCar Protected Dim car_type As String Public Readonly Property CarType() As String Get Return car_type End Get End Property Public MustOverride Function CalculateRental (week As Integer) As Double End Function End Class 3.3 Public Overrides Function CalculateRental (week As Integer) As Double If week 1 Then rate = 700 Else if week 1 Then rate = 600 Else rate = 500 End If Return rate End Function End Class Question 4 4.1 Click on Tools and go to the database 4.2 • The DataGridView control provides a customizable table for displaying data. • This control is designed to be a complete solution for displaying tabular data with Windows Forms. • Also, the DataGridView class allows us to customization of cells, rows, columns, and borders using its properties • You can extend the DataGridView control in many ways to build custom behaviours into your applications. • The DataGridView control makes it easy to define the basic appearance of cells and the display formatting of cell values. ICT3611 Exam Pack • The cell is the fundamental unit of interaction for the DataGridView. All cells derive from the DataGridViewCell base class. Each cell within the DataGridView control can have its own style, such as text format, background colour, foreground colour, font etc. Question 5 Public Sub DisplayMsg(stringMsg As String) if stringMsg.Length() = 40 Then MsgBox(stringMsg) Else MsgBox("Invalid") End if End Sub ICT3611 Exam Pack May/June 2017 P2 Question 2 2.1 Public Function CountEntriesFile(filename As String) As Integer Dim count As Integer = 0 Dim strmrdr As System.IO.StreamReader 'Open the file for reading strmrdr = new System .IO. StreamReader(fileName) 'Read one line of text until the end of the file Do Until strmrdr.EndOfStream Dim line As String = strmrdr.ReadLine() 'for both reading and adding to counter count += 1 Loop 'close the file () return count End Function 2.2 Public Function CountEntriesAge(filename As String) As Integer Dim entry_counter As Integer = 0 Dim age_counte
Geschreven voor
- Instelling
- University of South Africa
- Vak
- ICT 3611
Documentinformatie
- Geüpload op
- 20 september 2021
- Aantal pagina's
- 16
- Geschreven in
- 2021/2022
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
ict
-
3611