# Section B Introduction

This section will ask you questions that you will have to find programming solutions to. There will be more than one way of answering each question, so the answers below are only indicative of what we are looking for. As long as you get the same answers it doesn't matter how you do it. You may be given pseudeocode to help you program the problem.

## Batting Averages

Write a program to enter batting scores until the number -1 is input. And then output the total and average score.

Mirayde's One

``` Dim Score As Integer
Dim Ave As Integer = 0
Dim Total As Integer = 0
Dim C As Integer = 0
Do
Console.Write("Enter Score: ")
If (Score <> -1) Then
Total = Total + Score
End If
C = C + 1
Loop Until Score = -1

Ave = Total / C

Console.Write(" Your Total Is: " & Total)
Console.WriteLine()
Console.Write(" Your Average Is: " & Ave)

```

```Dim username As String

Do

Console.WriteLine("Hacked!")
Else
Console.WriteLine("Not Hacked yet")
End If
```

## Christmas Trees

Write code to print out a Christmas tree of a user defined size: even rows = *, odd = #. For example for the number 4 it should output:

```Dim number As Integer
For count = 1 To number
If count Mod 2 = 0 Then
For x = 1 To count
Console.Write("*")
Next
Console.WriteLine()
Else
For x = 1 To count
Console.Write("#")
Next
Console.WriteLine()
End If
Next