Question
Visual Studio and Visual Basic program
b. Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each mo
0 0
Add a comment Improve this question Transcribed image text
Answer #1

VB Window application code

============================================================================================

Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim str As String
Dim quantity As Integer
Label2.Text = ""
str = TextBox1.Text

If Integer.TryParse(TextBox1.Text, quantity) Then
If quantity = 0 Then
Label2.Text = "You have earned 0 points"
ElseIf quantity = 1 Then
Label2.Text = "You have earned 5 points"
ElseIf quantity = 2 Then
Label2.Text = "You have earned 15 points"
ElseIf quantity = 3 Then
Label2.Text = "You have earned 30 points"
Else
Label2.Text = "You have earned 60 points"

End If

Else
MessageBox.Show("The quantity entered is not numeric. Please add a numeric quantity(Inetger only).")
End If


End Sub
End Class

============================================================================================

output

Ouick Launch (Ctri+O) Y D Ve W Booksloint (Running) Microsoft Visual Studio Filc Edit Vicw Project Build Debug Team Tools Tes

Ouick Launch (Ctri+O) Y D Ve W Booksloint (Running) Microsoft Visual Studio Filc Edit Vicw Projcct Build Debug Team Tools Tes

Add a comment
Know the answer?
Add Answer to:
Visual Studio and Visual Basic program b. Serendipity Booksellers has a book club that awards points...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python 11. Book Club Points Serendipity Booksellers has a book club that awards points to its...

    Python 11. Book Club Points Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases 0 books, he or she earns 0 points If a customer purchases 2 books, he or she earns 5 points. O If a customer purchases 4 books, he or she earns 15 points If a customer purchases 6 books, he or she earns 30...

  • Directions: Complete all the three programming assignments below. Please be sure to follow the programming rubric...

    Directions: Complete all the three programming assignments below. Please be sure to follow the programming rubric provided. Turn in three separate “.py" files. Be sure to run your programs before submission. Color Mixer The colors red, blue, and yellow are called primary colors, because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color, as shown here: • When you mix red and blue, you get purple. • When you mix...

  • Code in c++ please Q1: Software Sales A software company sells a package that retails for...

    Code in c++ please Q1: Software Sales A software company sells a package that retails for $99. Quantity discounts are given according to the following table: QuantityDiscount 10-19 20-49 50-99 100 or more 20% 30% 40% 50% : Write a program that asks for the number of units sold and computes the total cost of the purchase. Input validation: Make sure the number of units is greater than 0. Q2: Book Club Points Community Booksellers has a book club that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT