

Form1.vb
-------------------------------
' Name: Theater
Revenue Form
' Purpose: Gets price & tickets
sold per adult & child tickets & caculates revenue
Public Class Form1
Private Sub btnCalculate_Click(sender As
Object, e As EventArgs) Handles btnCalculate.Click
Const Net As Decimal =
0.2
lblStatus.Text =
String.Empty
Try
lblGrossAdult.Text = CDec(txtAdultPrice.Text) *
CDec(txtAdultTickets.Text)
lblGrossChild.Text = CDec(txtChildPrice.Text) *
CDec(txtChildTickets.Text)
lblTotalGross.Text = CDec(lblGrossAdult.Text) +
CDec(lblGrossChild.Text)
lblNetAdult.Text = CDec(lblGrossAdult.Text) * Net
lblNetChild.Text = CDec(lblGrossChild.Text) * Net
lblTotalNet.Text = CDec(lblNetAdult.Text) +
CDec(lblNetChild.Text)
Catch
lblStatus.Text = ("All input must be valid numeric values.")
End Try
End Sub
Private Sub btnClear_Click(sender As Object,
e As EventArgs) Handles btnClear.Click
txtAdultPrice.Clear()
txtAdultTickets.Clear()
txtChildPrice.Clear()
txtChildTickets.Clear()
lblGrossAdult.Text =
String.Empty
lblGrossChild.Text =
String.Empty
lblTotalGross.Text =
String.Empty
lblNetAdult.Text =
String.Empty
lblNetChild.Text =
String.Empty
lblTotalNet.Text =
String.Empty
txtAdultPrice.Focus()
End Sub
Private Sub btnExit_Click(sender As Object, e
As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
-----------------------------------------------------------------
Form1.Designer.vb
-----------------------------
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
_
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the
component list.
<System.Diagnostics.DebuggerNonUserCode()>
_
Protected Overrides Sub Dispose(ByVal disposing
As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As
System.ComponentModel.IContainer
'NOTE: The following procedure is required by
the Windows Form Designer
'It can be modified using the Windows Form
Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
_
Private Sub InitializeComponent()
Me.grpAdult = New
System.Windows.Forms.GroupBox()
Me.txtAdultTickets = New
System.Windows.Forms.TextBox()
Me.txtAdultPrice = New
System.Windows.Forms.TextBox()
Me.Label2 = New
System.Windows.Forms.Label()
Me.Label1 = New
System.Windows.Forms.Label()
Me.grpChild = New
System.Windows.Forms.GroupBox()
Me.txtChildTickets = New
System.Windows.Forms.TextBox()
Me.txtChildPrice = New
System.Windows.Forms.TextBox()
Me.Label4 = New
System.Windows.Forms.Label()
Me.Label3 = New
System.Windows.Forms.Label()
Me.grpGross = New
System.Windows.Forms.GroupBox()
Me.lblTotalGross = New
System.Windows.Forms.Label()
Me.lblGrossChild = New
System.Windows.Forms.Label()
Me.lblGrossAdult = New
System.Windows.Forms.Label()
Me.Label7 = New
System.Windows.Forms.Label()
Me.Label6 = New
System.Windows.Forms.Label()
Me.Label5 = New
System.Windows.Forms.Label()
Me.grpNet = New
System.Windows.Forms.GroupBox()
Me.lblTotalNet = New
System.Windows.Forms.Label()
Me.lblNetChild = New
System.Windows.Forms.Label()
Me.lblNetAdult = New
System.Windows.Forms.Label()
Me.Label13 = New
System.Windows.Forms.Label()
Me.Label12 = New
System.Windows.Forms.Label()
Me.Label11 = New
System.Windows.Forms.Label()
Me.btnCalculate = New
System.Windows.Forms.Button()
Me.btnClear = New
System.Windows.Forms.Button()
Me.btnExit = New
System.Windows.Forms.Button()
Me.StatusStrip1 = New
System.Windows.Forms.StatusStrip()
Me.lblStatus = New
System.Windows.Forms.ToolStripStatusLabel()
Me.grpAdult.SuspendLayout()
Me.grpChild.SuspendLayout()
Me.grpGross.SuspendLayout()
Me.grpNet.SuspendLayout()
Me.StatusStrip1.SuspendLayout()
Me.SuspendLayout()
'
'grpAdult
'
Me.grpAdult.Controls.Add(Me.txtAdultTickets)
Me.grpAdult.Controls.Add(Me.txtAdultPrice)
Me.grpAdult.Controls.Add(Me.Label2)
Me.grpAdult.Controls.Add(Me.Label1)
Me.grpAdult.Font = New
System.Drawing.Font("Microsoft Sans Serif", 12.0!)
Me.grpAdult.Location =
New System.Drawing.Point(9, 7)
Me.grpAdult.Margin = New
System.Windows.Forms.Padding(4, 5, 4, 5)
Me.grpAdult.Name =
"grpAdult"
Me.grpAdult.Padding =
New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.grpAdult.Size = New
System.Drawing.Size(360, 166)
Me.grpAdult.TabIndex =
0
Me.grpAdult.TabStop =
False
Me.grpAdult.Text =
"Adult Ticket Sales"
'
'txtAdultTickets
'
Me.txtAdultTickets.Location = New System.Drawing.Point(186,
86)
Me.txtAdultTickets.Margin = New System.Windows.Forms.Padding(4, 5,
4, 5)
Me.txtAdultTickets.Name
= "txtAdultTickets"
Me.txtAdultTickets.Size
= New System.Drawing.Size(148, 26)
Me.txtAdultTickets.TabIndex = 3
'
'txtAdultPrice
'
Me.txtAdultPrice.Location = New System.Drawing.Point(186, 42)
Me.txtAdultPrice.Margin
= New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.txtAdultPrice.Name =
"txtAdultPrice"
Me.txtAdultPrice.Size =
New System.Drawing.Size(148, 26)
Me.txtAdultPrice.TabIndex = 2
'
'Label2
'
Me.Label2.AutoSize =
True
Me.Label2.Location = New
System.Drawing.Point(63, 92)
Me.Label2.Margin = New
System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label2.Name =
"Label2"
Me.Label2.Size = New
System.Drawing.Size(99, 20)
Me.Label2.TabIndex =
1
Me.Label2.Text =
"Tickets Sold:"
'
'Label1
'
Me.Label1.AutoSize =
True
Me.Label1.Location = New
System.Drawing.Point(40, 48)
Me.Label1.Margin = New
System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Name =
"Label1"
Me.Label1.Size = New
System.Drawing.Size(122, 20)
Me.Label1.TabIndex =
0
Me.Label1.Text = "Price
Per Ticket:"
'
'grpChild
'
Me.grpChild.Controls.Add(Me.txtChildTickets)
Me.grpChild.Controls.Add(Me.txtChildPrice)
Me.grpChild.Controls.Add(Me.Label4)
Me.grpChild.Controls.Add(Me.Label3)
Me.grpChild.Location =
New System.Drawing.Point(374, 7)
Me.grpChild.Name =
"grpChild"
Me.grpChild.Size = New
System.Drawing.Size(360, 166)
Me.grpChild.TabIndex =
1
Me.grpChild.TabStop =
False
Me.grpChild.Text =
"Child Ticket Sales"
'
'txtChildTickets
'
Me.txtChildTickets.Location = New System.Drawing.Point(187,
97)
Me.txtChildTickets.Name
= "txtChildTickets"
Me.txtChildTickets.Size
= New System.Drawing.Size(148, 26)
Me.txtChildTickets.TabIndex = 3
'
'txtChildPrice
'
Me.txtChildPrice.Location = New System.Drawing.Point(187, 50)
Me.txtChildPrice.Name =
"txtChildPrice"
Me.txtChildPrice.Size =
New System.Drawing.Size(148, 26)
Me.txtChildPrice.TabIndex = 2
'
'Label4
'
Me.Label4.AutoSize =
True
Me.Label4.Location = New
System.Drawing.Point(58, 103)
Me.Label4.Name =
"Label4"
Me.Label4.Size = New
System.Drawing.Size(99, 20)
Me.Label4.TabIndex =
1
Me.Label4.Text =
"Tickets Sold:"
'
'Label3
'
Me.Label3.AutoSize =
True
Me.Label3.Location = New
System.Drawing.Point(35, 53)
Me.Label3.Name =
"Label3"
Me.Label3.Size = New
System.Drawing.Size(122, 20)
Me.Label3.TabIndex =
0
Me.Label3.Text = "Price
Per Ticket:"
'
'grpGross
'
Me.grpGross.Controls.Add(Me.lblTotalGross)
Me.grpGross.Controls.Add(Me.lblGrossChild)
Me.grpGross.Controls.Add(Me.lblGrossAdult)
Me.grpGross.Controls.Add(Me.Label7)
Me.grpGross.Controls.Add(Me.Label6)
Me.grpGross.Controls.Add(Me.Label5)
Me.grpGross.Location =
New System.Drawing.Point(9, 183)
Me.grpGross.Name =
"grpGross"
Me.grpGross.Size = New
System.Drawing.Size(360, 194)
Me.grpGross.TabIndex =
2
Me.grpGross.TabStop =
False
Me.grpGross.Text =
"Gross Ticket Revenue"
'
'lblTotalGross
'
Me.lblTotalGross.AutoSize = True
Me.lblTotalGross.Location = New System.Drawing.Point(186,
122)
Me.lblTotalGross.Name =
"lblTotalGross"
Me.lblTotalGross.Size =
New System.Drawing.Size(18, 20)
Me.lblTotalGross.TabIndex = 5
Me.lblTotalGross.Text =
"?"
'
'lblGrossChild
'
Me.lblGrossChild.AutoSize = True
Me.lblGrossChild.Location = New System.Drawing.Point(186, 81)
Me.lblGrossChild.Name =
"lblGrossChild"
Me.lblGrossChild.Size =
New System.Drawing.Size(18, 20)
Me.lblGrossChild.TabIndex = 4
Me.lblGrossChild.Text =
"?"
'
'lblGrossAdult
'
Me.lblGrossAdult.AutoSize = True
Me.lblGrossAdult.Location = New System.Drawing.Point(186, 42)
Me.lblGrossAdult.Name =
"lblGrossAdult"
Me.lblGrossAdult.Size =
New System.Drawing.Size(18, 20)
Me.lblGrossAdult.TabIndex = 3
Me.lblGrossAdult.Text =
"?"
'
'Label7
'
Me.Label7.Location = New
System.Drawing.Point(6, 122)
Me.Label7.Name =
"Label7"
Me.Label7.Size = New
System.Drawing.Size(160, 62)
Me.Label7.TabIndex =
2
Me.Label7.Text = "Total
Gross Revenue for Ticket Sales:"
'
'Label6
'
Me.Label6.AutoSize =
True
Me.Label6.Location = New
System.Drawing.Point(28, 81)
Me.Label6.Name =
"Label6"
Me.Label6.Size = New
System.Drawing.Size(138, 20)
Me.Label6.TabIndex =
1
Me.Label6.Text = "Child
Ticket Sales:"
'
'Label5
'
Me.Label5.AutoSize =
True
Me.Label5.Location = New
System.Drawing.Point(26, 42)
Me.Label5.Name =
"Label5"
Me.Label5.Size = New
System.Drawing.Size(140, 20)
Me.Label5.TabIndex =
0
Me.Label5.Text = "Adult
Ticket Sales:"
'
'grpNet
'
Me.grpNet.Controls.Add(Me.lblTotalNet)
Me.grpNet.Controls.Add(Me.lblNetChild)
Me.grpNet.Controls.Add(Me.lblNetAdult)
Me.grpNet.Controls.Add(Me.Label13)
Me.grpNet.Controls.Add(Me.Label12)
Me.grpNet.Controls.Add(Me.Label11)
Me.grpNet.Location = New
System.Drawing.Point(374, 183)
Me.grpNet.Name =
"grpNet"
Me.grpNet.Size = New
System.Drawing.Size(360, 194)
Me.grpNet.TabIndex =
3
Me.grpNet.TabStop =
False
Me.grpNet.Text = "Net
Ticket Revenue"
'
'lblTotalNet
'
Me.lblTotalNet.AutoSize
= True
Me.lblTotalNet.Location
= New System.Drawing.Point(183, 122)
Me.lblTotalNet.Name =
"lblTotalNet"
Me.lblTotalNet.Size =
New System.Drawing.Size(18, 20)
Me.lblTotalNet.TabIndex
= 5
Me.lblTotalNet.Text =
"?"
'
'lblNetChild
'
Me.lblNetChild.AutoSize
= True
Me.lblNetChild.Location
= New System.Drawing.Point(183, 81)
Me.lblNetChild.Name =
"lblNetChild"
Me.lblNetChild.Size =
New System.Drawing.Size(18, 20)
Me.lblNetChild.TabIndex
= 4
Me.lblNetChild.Text =
"?"
'
'lblNetAdult
'
Me.lblNetAdult.AutoSize
= True
Me.lblNetAdult.Location
= New System.Drawing.Point(183, 42)
Me.lblNetAdult.Name =
"lblNetAdult"
Me.lblNetAdult.Size =
New System.Drawing.Size(18, 20)
Me.lblNetAdult.TabIndex
= 3
Me.lblNetAdult.Text =
"?"
'
'Label13
'
Me.Label13.Location =
New System.Drawing.Point(16, 122)
Me.Label13.Name =
"Label13"
Me.Label13.Size = New
System.Drawing.Size(141, 53)
Me.Label13.TabIndex =
2
Me.Label13.Text = "Total
Net Revenue for Ticket Sales:"
'
'Label12
'
Me.Label12.AutoSize =
True
Me.Label12.Location =
New System.Drawing.Point(19, 81)
Me.Label12.Name =
"Label12"
Me.Label12.Size = New
System.Drawing.Size(138, 20)
Me.Label12.TabIndex =
1
Me.Label12.Text = "Child
Ticket Sales:"
'
'Label11
'
Me.Label11.AutoSize =
True
Me.Label11.Location =
New System.Drawing.Point(17, 42)
Me.Label11.Name =
"Label11"
Me.Label11.Size = New
System.Drawing.Size(140, 20)
Me.Label11.TabIndex =
0
Me.Label11.Text = "Adult
Ticket Sales:"
'
'btnCalculate
'
Me.btnCalculate.Location
= New System.Drawing.Point(115, 405)
Me.btnCalculate.Name =
"btnCalculate"
Me.btnCalculate.Size =
New System.Drawing.Size(228, 34)
Me.btnCalculate.TabIndex
= 4
Me.btnCalculate.Text =
"Calculate Ticket Revenue"
Me.btnCalculate.UseVisualStyleBackColor = True
'
'btnClear
'
Me.btnClear.Location =
New System.Drawing.Point(374, 405)
Me.btnClear.Name =
"btnClear"
Me.btnClear.Size = New
System.Drawing.Size(75, 34)
Me.btnClear.TabIndex =
5
Me.btnClear.Text =
"Clear"
Me.btnClear.UseVisualStyleBackColor = True
'
'btnExit
'
Me.btnExit.Location =
New System.Drawing.Point(479, 405)
Me.btnExit.Name =
"btnExit"
Me.btnExit.Size = New
System.Drawing.Size(75, 34)
Me.btnExit.TabIndex =
6
Me.btnExit.Text =
"Exit"
Me.btnExit.UseVisualStyleBackColor = True
'
'StatusStrip1
'
Me.StatusStrip1.Items.AddRange(New
System.Windows.Forms.ToolStripItem() {Me.lblStatus})
Me.StatusStrip1.Location
= New System.Drawing.Point(0, 454)
Me.StatusStrip1.Name =
"StatusStrip1"
Me.StatusStrip1.Size =
New System.Drawing.Size(741, 22)
Me.StatusStrip1.TabIndex
= 7
Me.StatusStrip1.Text =
"StatusStrip1"
'
'lblStatus
'
Me.lblStatus.Name =
"lblStatus"
Me.lblStatus.Size = New
System.Drawing.Size(0, 17)
'
'Form1
'
Me.AutoScaleDimensions =
New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New
System.Drawing.Size(741, 476)
Me.Controls.Add(Me.StatusStrip1)
Me.Controls.Add(Me.btnExit)
Me.Controls.Add(Me.btnClear)
Me.Controls.Add(Me.btnCalculate)
Me.Controls.Add(Me.grpNet)
Me.Controls.Add(Me.grpGross)
Me.Controls.Add(Me.grpChild)
Me.Controls.Add(Me.grpAdult)
Me.Font = New
System.Drawing.Font("Microsoft Sans Serif", 12.0!)
Me.Margin = New
System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Name = "Form1"
Me.Text = "Theater
Revenue"
Me.grpAdult.ResumeLayout(False)
Me.grpAdult.PerformLayout()
Me.grpChild.ResumeLayout(False)
Me.grpChild.PerformLayout()
Me.grpGross.ResumeLayout(False)
Me.grpGross.PerformLayout()
Me.grpNet.ResumeLayout(False)
Me.grpNet.PerformLayout()
Me.StatusStrip1.ResumeLayout(False)
Me.StatusStrip1.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents grpAdult As
System.Windows.Forms.GroupBox
Friend WithEvents txtAdultTickets As
System.Windows.Forms.TextBox
Friend WithEvents txtAdultPrice As
System.Windows.Forms.TextBox
Friend WithEvents Label2 As
System.Windows.Forms.Label
Friend WithEvents Label1 As
System.Windows.Forms.Label
Friend WithEvents grpChild As
System.Windows.Forms.GroupBox
Friend WithEvents txtChildTickets As
System.Windows.Forms.TextBox
Friend WithEvents txtChildPrice As
System.Windows.Forms.TextBox
Friend WithEvents Label4 As
System.Windows.Forms.Label
Friend WithEvents Label3 As
System.Windows.Forms.Label
Friend WithEvents grpGross As
System.Windows.Forms.GroupBox
Friend WithEvents lblTotalGross As
System.Windows.Forms.Label
Friend WithEvents lblGrossChild As
System.Windows.Forms.Label
Friend WithEvents lblGrossAdult As
System.Windows.Forms.Label
Friend WithEvents Label7 As
System.Windows.Forms.Label
Friend WithEvents Label6 As
System.Windows.Forms.Label
Friend WithEvents Label5 As
System.Windows.Forms.Label
Friend WithEvents grpNet As
System.Windows.Forms.GroupBox
Friend WithEvents lblTotalNet As
System.Windows.Forms.Label
Friend WithEvents lblNetChild As
System.Windows.Forms.Label
Friend WithEvents lblNetAdult As
System.Windows.Forms.Label
Friend WithEvents Label13 As
System.Windows.Forms.Label
Friend WithEvents Label12 As
System.Windows.Forms.Label
Friend WithEvents Label11 As
System.Windows.Forms.Label
Friend WithEvents btnCalculate As
System.Windows.Forms.Button
Friend WithEvents btnClear As
System.Windows.Forms.Button
Friend WithEvents btnExit As
System.Windows.Forms.Button
Friend WithEvents StatusStrip1 As
System.Windows.Forms.StatusStrip
Friend WithEvents lblStatus As
System.Windows.Forms.ToolStripStatusLabel
End Class
Can you write the code for this It's for Visual Basic I am having a hard...
"basic stamp 2" I’m having a hard time making a code with conditional statements. Please can you help me out Basically it is Since I have three options which are A or B or C I want to to pick let’s say B, so that means I want to open just this one. But I can’t seem to master the IF and ELSE codes as I know I need this ones in the loop Please provide me the code will...
"basic stamp 2" I’m having a hard time making a code with conditional statements. Please can you help me out Basically it is Since I have three options which are A or B or C I want to to pick let’s say B, so that means I want to open just this one. But I can’t seem to master the IF and ELSE codes as I know I need this ones in the loop Please provide me the code will...
Thank you to the ones who have tried to help me and I apologize for having to repost this question. I'm having a hard time trying to comprehend coding. I am supposed to code a joke and punchline. The joke is:"why did the chicken cross the road?" And the punchline is: "The hen got on its nerves." Or any answer will do actually. I have two labels and one button to make it run. If anyone can help me understand...
Java. I am having a hard time figuring out how to take user input and then write a method that returns the answer. All the examples I find have numbers hard coded. Can you show me how this is done. For example, maybe add two numbers. Thank you
: LP 4: Assignment 4 - Penny or Nickel Challenge in visual basic 2017, I am stuck need help on form and code in c++ this is for practice to get my right form and coding to be able to do my in-class assignment. The instructor said to perfect this and when we did class program we will be able to do it all. Oh hello, I am struggling on getting it right especially looping. Thank you, your answer may...
Hey there, I am having a hard time using GUI for c# in visual studio. I am making an alarm clock. I have a few questions that I would like to know how to do: --using a button called set time to capture text from a box containing a user-inputted hour, minute, second, and setting the current time to that. --using a button called alarm, Capture the Text in the TextBoxes - the Hours, Minutes, Seconds and Text (am/pm) and...
can somebody help me with this please. This is for Visual Basic Write the code for an application that calculates the sum of two integer variables (intVar1, intVar2) and store it in a third integer variable (intSum). You should have two text boxes (txtVar1, txtVar2) and a label (lblSum) to show your result.
I am having a hard time writing an IDLE code (Python 3.7.2) and I need help. Here are the parameters. 1. Write a program that will generate a random backpack. This program will have a menu that allows the user to continuously select between generating a new backpack, printing the current backpack, adding a given number of an item, removing a given number of an item or quitting. Every backpack will have a variable number of the following 7 items:...
I am trying to program a dice game in Visual Studios c++ but am having trouble. The program allows the user to choose the number of rolls, not exceeding 100,000. I am trying to print out the number of times each number(1-6) was rolled, but it's not working. What am I doing wrong? The link below is a copy of my code. https://docs.google.com/document/d/1baKfnof4pjdQ4905hwXluFtbcA1Fs7QESMQKy45xdpE/edit
I really need some help fixing a code error in Visual Basic I was wondering if anyone could help fix the error that I'm about to provide in bold thanks so much! I'll also tell what the error is. Public Class MainForm Private Sub exitButton_Click(sender As Object, e As EventArgs) Handles exitButton.Click Me.Close() End Sub Dim img As Image = Image.FromFile("C:\Users\Pranesh\Pictures\11599264.jpg") house1PictureBox.Image = img house2PictureBox.Image = img house3PictureBox.Image = img house4PictureBox.Image = img house1PictureBox.Visible = False house2PictureBox.Visible = False house3PictureBox.Visible...