
Meyer’s Purple Bakery
Create a Visual Basic Windows Application:
- Open Microsoft Visual Basic 2010.
- Click “File” Menu -> “New Project”.
- In the New Project pop-up window, select the “Windows Form Application” and give the name as “Bakery Project”, and specify the location as “\VB2015\Chap01\”.
Form Design:
- Design the main form and print form by placing the labels, textbox, and button and then change their name and properties.
- Inside the “Calculate” button,
- Calculate total sales, sales tax and sales clerk’s name..
- Inside the “Print” button,
- Print the form data.
- Inside the “Clear” button,
- Clear the screen.
- Inside the “Exit” button,
- Close the form.
Screenshot of the Main form design
Screenshot of the Name Entry form design
Screenshot of the Item price form design

Explanation of Solution
Program:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmMain
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.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain))
Me.lblTotalSales = New System.Windows.Forms.Label()
Me.lblTotalItems = New System.Windows.Forms.Label()
Me.txtDate = New System.Windows.Forms.TextBox()
Me.btnExit = New System.Windows.Forms.Button()
Me.btnPrint = New System.Windows.Forms.Button()
Me.btnClear = New System.Windows.Forms.Button()
Me.btnCalc = New System.Windows.Forms.Button()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtDonuts = New System.Windows.Forms.TextBox()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.Label6 = New System.Windows.Forms.Label()
Me.txtMuffins = New System.Windows.Forms.TextBox()
Me.PrintForm1 = New Microsoft.VisualBasic.PowerPacks.Printing.PrintForm(Me.components)
Me.lblMsg = New System.Windows.Forms.Label()
CType(Me.PictureBox1,System.ComponentModel.ISupportInitialize).BeginInit
Me.SuspendLayout
'
'lblTotalSales
'
Me.lblTotalSales.BackColor = System.Drawing.Color.FromArgb(CType(CType(255,Byte),Integer), CType(CType(255,Byte),Integer), CType(CType(192,Byte),Integer))
Me.lblTotalSales.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblTotalSales.Location = New System.Drawing.Point(110, 230)
Me.lblTotalSales.Name = "lblTotalSales"
Me.lblTotalSales.Size = New System.Drawing.Size(94, 27)
Me.lblTotalSales.TabIndex = 14
Me.lblTotalSales.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'lblTotalItems
'
Me.lblTotalItems.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblTotalItems.Location = New System.Drawing.Point(110, 187)
Me.lblTotalItems.Name = "lblTotalItems"
Me.lblTotalItems.Size = New System.Drawing.Size(47, 27)
Me.lblTotalItems.TabIndex = 13
Me.lblTotalItems.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'txtDate
'
Me.txtDate.Location = New System.Drawing.Point(156, 67)
Me.txtDate.Name = "txtDate"
Me.txtDate.Size = New System.Drawing.Size(111, 27)
Me.txtDate.TabIndex = 1
'
'btnExit
'
Me.btnExit.Location = New System.Drawing.Point(228, 216)
Me.btnExit.Name = "btnExit"
Me.btnExit.Size = New System.Drawing.Size(114, 31)
Me.btnExit.TabIndex = 9
Me.btnExit.Text = "E&xit"
Me.btnExit.UseVisualStyleBackColor = true
'
'btnPrint
'
Me.btnPrint.Location = New System.Drawing.Point(228, 148)
Me.btnPrint.Name = "btnPrint"
Me.btnPrint.Size = New System.Drawing.Size(114, 31)
Me.btnPrint.TabIndex = 7
Me.btnPrint.Text = "&Print Receipt"
Me.btnPrint.UseVisualStyleBackColor = true
'
'btnClear
'
Me.btnClear.Location = New System.Drawing.Point(228, 182)
Me.btnClear.Name = "btnClear"
Me.btnClear.Size = New System.Drawing.Size(114, 31)
Me.btnClear.TabIndex = 8
Me.btnClear.Text = "C&lear Screen"
Me.btnClear.UseVisualStyleBackColor = true
'
'btnCalc
'
Me.btnCalc.Location = New System.Drawing.Point(228, 114)
Me.btnCalc.Name = "btnCalc"
Me.btnCalc.Size = New System.Drawing.Size(114, 31)
Me.btnCalc.TabIndex = 6
Me.btnCalc.Text = "&Calculate"
Me.btnCalc.UseVisualStyleBackColor = true
'
'Label5
'
Me.Label5.AutoSize = true
Me.Label5.Location = New System.Drawing.Point(24, 190)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(86, 20)
Me.Label5.TabIndex = 11
Me.Label5.Text = "Total items:"
'
'Label4
'
Me.Label4.AutoSize = true
Me.Label4.Location = New System.Drawing.Point(24, 153)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(61, 20)
Me.Label4.TabIndex = 4
Me.Label4.Text = "&Muffins:"
'
'Label3
'
Me.Label3.AutoSize = true
Me.Label3.Location = New System.Drawing.Point(24, 114)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(84, 20)
Me.Label3.TabIndex = 2
Me.Label3.Text = "&Doughnuts:"
'
'Label2
'
Me.Label2.AutoSize = true
Me.Label2.Location = New System.Drawing.Point(106, 70)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(44, 20)
Me.Label2.TabIndex = 0
Me.Label2.Text = "Da&te:"
'
'Label1
'
Me.Label1.AutoSize = true
Me.Label1.Font = New System.Drawing.Font("Segoe UI", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte))
Me.Label1.Location = New System.Drawing.Point(103, 18)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(172, 37)
Me.Label1.TabIndex = 10
Me.Label1.Text = "Sales Receipt"
'
'txtDonuts
'
Me.txtDonuts.Location = New System.Drawing.Point(110, 111)
Me.txtDonuts.Name = "txtDonuts"
Me.txtDonuts.Size = New System.Drawing.Size(47, 27)
Me.txtDonuts.TabIndex = 3
'
'PictureBox1
'
Me.PictureBox1.Image = Global.Bakery_Project.My.Resources.Resources.Chef
Me.PictureBox1.Location = New System.Drawing.Point(22, 12)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(71, 68)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 34
Me.PictureBox1.TabStop = false
'
'Label6
'
Me.Label6.AutoSize = true
Me.Label6.Location = New System.Drawing.Point(24, 230)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(82, 20)
Me.Label6.TabIndex = 12
Me.Label6.Text = "Total sales:"
'
'txtMuffins
'
Me.txtMuffins.Location = New System.Drawing.Point(110, 148)
Me.txtMuffins.Name = "txtMuffins"
Me.txtMuffins.Size = New System.Drawing.Size(47, 27)
Me.txtMuffins.TabIndex = 5
'
'PrintForm1
'
Me.PrintForm1.DocumentName = "document"
Me.PrintForm1.Form = Me
Me.PrintForm1.PrintAction = System.Drawing.Printing.PrintAction.PrintToPreview
Me.PrintForm1.PrinterSettings = CType(resources.GetObject("PrintForm1.PrinterSettings"),System.Drawing.Printing.PrinterSettings)
Me.PrintForm1.PrintFileName = Nothing
'
'lblMsg
'
Me.lblMsg.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lblMsg.Location = New System.Drawing.Point(28, 276)
Me.lblMsg.Name = "lblMsg"
Me.lblMsg.Size = New System.Drawing.Size(314, 49)
Me.lblMsg.TabIndex = 15
Me.lblMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'frmMain
'
Me.AcceptButton = Me.btnCalc
Me.AutoScaleDimensions = New System.Drawing.SizeF(8!, 20!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(366, 346)
Me.Controls.Add(Me.lblMsg)
Me.Controls.Add(Me.txtMuffins)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.txtDonuts)
Me.Controls.Add(Me.lblTotalSales)
Me.Controls.Add(Me.lblTotalItems)
Me.Controls.Add(Me.txtDate)
Me.Controls.Add(Me.btnExit)
Me.Controls.Add(Me.btnPrint)
Me.Controls.Add(Me.btnClear)
Me.Controls.Add(Me.btnCalc)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte))
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Name = "frmMain"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Meyer's Purple Bakery"
CType(Me.PictureBox1,System.ComponentModel.ISupportInitialize).EndInit
Me.ResumeLayout(false)
Me.PerformLayout
End Sub
Friend WithEvents lblTotalSales As Label
Friend WithEvents lblTotalItems As Label
Friend WithEvents txtDate As TextBox
Friend WithEvents btnExit As Button
Friend WithEvents btnPrint As Button
Friend WithEvents btnClear As Button
Friend WithEvents btnCalc As Button
Friend WithEvents Label5 As Label
Friend WithEvents Label4 As Label
Friend WithEvents Label3 As Label
Friend WithEvents Label2 As Label
Friend WithEvents Label1 As Label
Friend WithEvents txtDonuts As TextBox
Friend WithEvents PictureBox1 As PictureBox
Friend WithEvents Label6 As Label
Friend WithEvents txtMuffins As TextBox
Friend WithEvents PrintForm1 As PowerPacks.Printing.PrintForm
Friend WithEvents lblMsg As Label
End Class
- Run the program, by pressing the F5.
Screenshot of the output form
Screenshot of Calculation after entering the quantity
Screenshot of getting salesclerk’s name
Screenshot of getting the item price
Screenshot of Calculate
Screenshot of Print Preview
Want to see more full solutions like this?
Chapter 3 Solutions
Programming with Microsoft Visual Basic 2015 (MindTap Course List)
- you can select multipy optionsarrow_forwardFor each of the following, decide whether the claim is True or False and select the True ones: Suppose we discover that the 3SAT can be solved in worst-case cubic time. Then it would mean that all problems in NP can also be solved in cubic time. If a problem can be solved using Dynamic Programming, then it is not NP-complete. Suppose X and Y are two NP-complete problems. Then, there must be a polynomial-time reduction from X to Y and also one from Y to X.arrow_forwardMaximum Independent Set problem is known to be NP-Complete. Suppose we have a graph G in which the maximum degree of each node is some constant c. Then, is the following greedy algorithm guaranteed to find an independent set whose size is within a constant factor of the optimal? 1) Initialize S = empty 2) Arbitrarily pick a vertex v, add v to S delete v and its neighbors from G 3) Repeat step 2 until G is empty Return S Yes Noarrow_forward
- Please help me answer this coding question in the images below for me(it is not a graded question):write the code using python and also provide the outputs requiredarrow_forwardWhat does the reduction showing Vertex Cover (VC) is NP-Complete do: Transforms any instance of VC to an instance of 3SAT Transforms any instance of 3SAT to an instance of VC Transforms any instance of VC to an instance of 3SAT AND transforms any instance of 3SAT to an instance of VC none of the abovearrow_forwardPlease assist me by writing out the code with its output (in python) using the information provided in the 2 images below.for the IP Address, it has been changed to: 172.21.5.204the serve code has not been open yet though but the ouput must be something along these lines(using command prompt):c:\Users\japha\Desktop>python "Sbongakonke.py"Enter the server IP address (127.0.0.1 or 172.21.5.199): 172.21.5.204Enter your student number: 4125035Connected to server!It's your turn to pour! Enter the amount to your pour (in mL):Please work it out until it gets the correct outputsNB: THIS QUESTION IS NOT A GRADED QUESTIONarrow_forward
- need help with a html code and css code that will match this image.arrow_forwardneed help with a html code and css code that will match this image. Part B - A Navigation Part B is the navigation component of a page. Information you need includes: Color Codes: Visiting links: #ff6666 Unvisited links: #ccff66 Hovered links: white Search box: #2ec4b6 rebeccapurple white Font: Google Font (Roboto) Icons: Font Awesome (fa-quidditch, fa-search) This is a flexbox based navigation menu. Other then padding, all spacing/positioning should be controlled using flex properties. The home link in the nav should point to your assignment file (to triggers visited styling). In the "state" screenshot below, Home is visited, Services is hovered (the mouse doesn't show up in the screenshot) and Products is unvisited.arrow_forwardMGMT SS STATS, an umbrella body that facilitates and serves various Social Security Organizations/Departments within the Caribbean territories, stood poised to meet the needs of its stakeholders by launching an online database. The database will provide members and the public access to the complete set of services that can (also) be initiated face-to-face, and it will provide managed, private, secure access to a repository of public and/or personal information. Ideally, the database will have basic details of pension plans recorded in the registry, member plan statistics, and cash inflows and outflows from pension funds.For example, insured persons accumulate contributions. Records for these persons will include information on the insured persons able to acquire various benefits once work is interrupted due to sickness, death, retirement, and maternity or employment injury. They will also include information on pensions such as invalidity, disability, and survivors that stem from one…arrow_forward
- Why all appvif i want to sign in its required phone number why not using google or apple its make me frustratedarrow_forwardWhy is the accuracy of time important in data visualizations? Detail a scenario from your professional experience in which time was structured poorly in a data visualization. How did this affect the understanding of the data presented? How do you think this error or oversight occurred?arrow_forwardWrite the KeanStudent class. The UML diagram of the class is represented below: KeanStudent - fullName: String - keanID: int -keanEmailAddress: String cellPhoneNumber: String + numberOfStudent: int + KeanStudent() + KeanStudent(fullName: String, keanID: int, keanEmailAddress: String, cellPhoneNumber: String) +getFullName(): String +setFullName(newFullName: String): void +getKeanIDO): int +getKeanEmailAddress(): String +getCellPhoneNumber(): String + setCellPhoneNumber(newCellPhoneNumber: String): void +toString(): String 1. Implement the KeanStudent class strictly according to its UML one-to-one (do not include anything extra, do not miss any data fields or methods) 2. Implement a StudentTest class to test the class KeanStudent you just created. • Create two KeanStudent objects using a no-args constructor and one from the constructor with all fields. o Print the contents of both objects. 。 Print numberOfStudent. 3. Add comments to your program (mark where data fields, constructors,…arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT


