Even complicated and confusing topics will be easily developed and covered if you request our help writing an essay. Place an order today!

CSC139 Chapter 11 Lab Assignments

 

Objectives

In this lab assignment, students will learn:

- How to define LINQ statement

- How to use LINQ to query data from object array

 

Goals

 

In this lab assignment, students will demonstrate the abilities to:

- Define LINQ statement

- Use LINQ to query data from object array

 

 

 

Grading rubric 

Category

High Proficiency

Medium Proficiency

Low Proficiency

Define the LINQ which get all scores in ascending order [40 pts]

Successfully define the LINQ which get all scores in ascending order. [40ts]

LINQ statement works, however, does not generate correct results. [20–39 pts]

LINQ statement is not defined correctly. [0-19 pts]

Define the LINQ which get all students who passed the exam [40 pts]

Successfully define the LINQ which get all students who passed the exam. [40ts]

LINQ statement works, however, does not generate correct results. [20-39 pts]

LINQ statement is not defined correctly. [0-19 pts]

Define the code to display the LINQ results correctly (20 pts)

Successfully define the code to display the LINQ results correctly. [20 pts]

The results can be displayed, however, some data or format are not correct. [10-19 pts]

Results can not be displayed, or most data or formats are not correct. [0-9 pts]

 

 

  1. Create a console application “ LINQGradeBook
  2. Add the following class definition:

 

Public Class GradeBook

    Private nameValue As String

    Private scoreValue As Integer

    Public Sub New(ByVal n As String, ByVal s As Integer)

        nameValue = n

        scoreValue = s

    End Sub

    Public Property Name() As String

        Get

            Return nameValue

        End Get

        Set(ByVal value As String)

            nameValue = value

        End Set

    End Property

 

    Public Property Score() As Integer

        Get

            Return scoreValue

        End Get

        Set(ByVal value As Integer)

            scoreValue = value

        End Set

    End Property

    Public Sub displayGradeBook()

        Console.WriteLine("Name: " & Name & vbTab & "Score: " & Score)

    End Sub

 

End Class

 

  1. Rename the file “Module1.vb” to “ LINQGradeBookTester.vb
  2. Complete the missing code following the comments. You are required to create two LINQstatements which will select specific gradeBook object from a GradeBook objects array.

 

Option Strict On

Module LINQGradeBookTester

 

    Sub Main()

        Dim g1 As New GradeBook("AAA", 70)

        Dim g2 As New GradeBook("BBB", 50)

        Dim g3 As New GradeBook("CCC", 100)

        Dim g4 As New GradeBook("DDD", 80)

        'add g1, g2, g3 and g4 in a array and display all student scores

        Dim gradeBooks As GradeBook() = {g1, g2, g3, g4}

        display(gradeBooks, "Scores for all students: ")

       

'create a LINQ which get all scores in ascending order and display them.

       

 

 

 

 

 

 

        'create a LINQ which get all students who passed the exam

 

 

 

 

        'display number of passed students, their names and scores 

       

 

 

 

    End Sub

 

 

    'display gradeBook's information

    Private Sub display(ByVal gradeBooks As IEnumerable, ByVal header As String)

        Console.WriteLine(header)

        For Each g As GradeBook In gradeBooks

            g.displayGradeBook()

        Next

        Console.WriteLine()

    End Sub

 

End Module

 

Here is output: (See next page)

 

 

testimonials icon
In a seamless posting, please incorporate the answer to the following questions into your initial postings:Discuss why knowledge of...
testimonials icon
History of the American EconomyCSUN - Economics 175Written Assignment (10% of your overall grade)Please provide a...
testimonials icon
no plagarizim...
testimonials icon
25 questions enclosed | Nursing homework help ...
testimonials icon
EXERCISE 9-8AAEventAssets=1.2.3a.3b.4.5.6.7.8.9.10.+50,000+380,000+550,800-330,000NA-32000+50,000-6,200-78000-250,000NALiab.+ Equity=NA+ +50,000= +38...
testimonials icon
See attached assignment and rubric.1. Calculate the firm’s 2007 financial ratios. 2. Prepare an executive summary on the firm’s...
testimonials icon
PERPETUAL INVENTORY SYSTEMPerpetual Inventory SystemUnder Perpetual Inventory System Companies maintain Physical InventoriesYour nameYour Instructors...
testimonials icon
68. RULE OF 70 Investors are often interested in knowing how long it takes for a particular investment to double. A simple means for making this de...
testimonials icon
Kristen RusherLina MaxwellIntro to Human ServicesFeb. 16, 2016 Girls On the Ru...
testimonials icon
What advantages has containerization in maritime shipping brought? Are there any parallels with the air freight industry?...
testimonials icon
 50 words or more...

Other samples, services and questions:

Calculate Price

When you use PaperHelp, you save one valuable — TIME

You can spend it for more important things than paper writing.

Approx. price
$65
Order a paper. Study better. Sleep tight. Calculate Price!
Created with Sketch.
Calculate Price
Approx. price
$65