A Bagels store charges 75 cents per bagel for orders of less than a half-dozen bagels and 60 cents per bagel for orders of a half-dozen or more. Assume that the number of bagels ordered has been stored in a variable named NumBagels. Write VB code that calculates and stores the total cost in a variable named Cost. Make sure to declare all variables used.

for Visual basic 2012 programming by the way

Write a Boolean valued Function that takes two student grades and returns True if the average is greater than or equal to 90 and False otherwise. Write a VB statement that calls the function and displays in a MessageBox whether or not the student grade is an A average.

Here is the VB code to calculate and store the total cost of bagels based on the number of bagels ordered:

```vb
Dim NumBagels As Integer
Dim Cost As Double

' Get the number of bagels ordered
NumBagels = Integer.Parse(Console.ReadLine())

' Calculate the total cost based on the number of bagels
If NumBagels < 6 Then
Cost = NumBagels * 0.75
Else
Cost = NumBagels * 0.6
End If

' Display the total cost
Console.WriteLine("The total cost is $" & Cost)
```

In this code, we store the number of bagels ordered in the variable `NumBagels`. Then, using an `If-Else` statement, we check if the number of bagels is less than 6. If it is, we multiply the number of bagels by 0.75 to calculate the total cost. Otherwise, if the number of bagels is 6 or more, we multiply it by 0.6. The calculated total cost is stored in the variable `Cost`. Finally, we display the total cost using `Console.WriteLine`.

To calculate the total cost based on the number of bagels ordered, you can use conditional statements in VB. Here's the code:

```vb
Dim NumBagels As Integer
Dim Cost As Double

' Prompt the user to input the number of bagels ordered
NumBagels = CInt(InputBox("Enter the number of bagels ordered"))

' Calculate the total cost based on the number of bagels
If NumBagels < 6 Then
Cost = NumBagels * 0.75 ' 75 cents per bagel for less than half-dozen
Else
Cost = NumBagels * 0.6 ' 60 cents per bagel for half-dozen or more
End If

' Display the total cost to the user
MsgBox "The total cost is $" & Cost
```

In this code:

- `Dim NumBagels As Integer` declares the variable `NumBagels` as an integer type to store the number of bagels ordered.
- `Dim Cost As Double` declares the variable `Cost` as a double type to store the total cost.
- `NumBagels = CInt(InputBox("Enter the number of bagels ordered"))` prompts the user to input the number of bagels ordered and converts the input to an integer using `CInt`.
- The conditional statements `If...Else...End If` check if the number of bagels is less than 6. If it is, then the total cost is calculated as the number of bagels multiplied by 0.75 (75 cents per bagel for less than half-dozen). Otherwise, the total cost is calculated as the number of bagels multiplied by 0.6 (60 cents per bagel for half-dozen or more).
- `MsgBox "The total cost is $" & Cost` displays the total cost to the user using a message box. The `&` is used to concatenate the string with the value stored in the `Cost` variable.

By following these steps, you can calculate the total cost based on the number of bagels ordered in VB.