VB 10 - Program - Calculate The Number Of Slices That Can Be Cut From A Pizza That Size - Errors Saying "With Held " Events

May 23, 2012

Write a complete Visual Basic program to do the following: Joe's Pizza Palace needs an application to calculate the number of slicesa pizza of any size can be divided into.

The application should do the following:
 Allow the user to enter the diameter of the pizza, in inches.
 Calculate the number of slices that can be cut from a pizza that size.
 Display a message that indicates the number of slices.
To calculate the number of slices that can be cut from the pizza, you must know these facts:
 Each slice should have an area of 14.125 inches.
 To calculate the number of slices, divide the area of the pizza by 14.125.
 The area of the pizza is calculated with the formula: Area = π r2

Note: The π is pi which is equal to 3.14159.The r is the radius of the pizza. Divide the diameter
by 2 to get the radius.

Form:
The application should be done form-based. You may design your own form. It must have the following:
 a label indicating that it is Joe's Pizza Palace
 a field with label to enter the size (diameter) of the pizza
 a field with label to display the number of slices
 buttons to calculate the number of slices and to exit the application

Output:
Use the following test data to determine if the application is calculating properly:
Diameter of Pizza Number of Slices
22 inches 27
15 inches 13
12 inches 8

Requirements:
 Name the project Pizza.
 Be sure to include your name included in a comment
 No credit is given for a program that will not execute.
 All rules of academic integrity should be applied as stated in the syllabus.
 Submit the zipped project into Moodle.

I have errors saying "With Held " events

WHAT IS WRONG WITH what I HAVE

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click
' End the application
End
End Sub

[CODE]...

View 3 Replies


ADVERTISEMENT

TCP - Send A String Held In A Var To An IP Address And Port Number Both Also Held In Vars

Dec 9, 2011

I wish to send a string held in a var to an IP address and Port number both also held in vars. I also wish to listen to a signals coming in on a particular port number so when particular strings are received I can trigger other transmissions.

View 2 Replies

Sub Procedures - Pizza Vendor - Display An Itemized Bill - Calculate The Total Cost

Oct 27, 2009

This is my project for class and this is what i have so far but my teacher gave me no credit. What am i doing wrong? i tried rearranging it but no success.

A fast-food vendor sells pizza slices at $1.25 each, fries at $1.00, and soft drinks at $0.75. Write a program to computer a customers bill. The program should use 4 subprocedures that do the following:

1. read in the amount of each item ordered

2. calculate the total cost

3. display an itemized bill

4. read in the users full name from a textbox, and display a sentence, addressing the user by first name only and in upper case characters, informing the user of their bill

Here is an example itemized bill:
Item Quantity Price
Pizza slices 3 $1.25
Fries 4 $1
Soft drinks 5 $0.75
Total $11.50

Example sentence for point 4: if the user name was entered as John Smith, you would display the sentence JOHN, your bill is $11.50.

MY

Public Class Form1

Sub pizza(ByVal pizzap As Double, ByVal pizzanum As Double)
lstoutput.Items.Add("Pizza Slices" & pizzap & "and" & pizzanum & "is" & (pizzap * pizzanum) & ".")

[CODE]....

View 6 Replies

Keeping A Total - Size Of Pizza Which Is A Combo Box (CmbSize)

Apr 7, 2011

Anyway I am writing a program to allow the user to enter:

-size of pizza which is a combo box (CmbSize)
-type (thin crust or standard) of pizza which is a combo box (CmbType)
-pizza choice (spicy chicken, maryland etc) using a checked listed box (ChkdListChoice)

The problem I have that will probably be simple to a lot of you who are using this language frequently is that I simply want keep a running subtotal of the users choice. So for example the user chooses 8" Spicy Chicken - 3.50, then they press the BtnAddToOrder button to output it to the Textbox (TxtPizzaChoi). When the user adds the next pizza I simply want the previous pizza price to be added to this one giving a new subtotal. I have not made the price change if the user changes the size to 12" spicy chicken, the price is still 3.50, simply because I think this could make it more difficult to me and I don't have lots of time to work on this. My declarations are not all in use and i may not need them by the way.

Heres the code:

Public Class PizzaChoices
Dim price As Decimal
Dim topping As Decimal

[CODE]...

View 2 Replies

Pizza Program Calculation?

May 23, 2010

I just need help with my Pizza Program in calculations. It keeps on adding on top of the original calculations. I did try to set the variables to 0, but that really didn't work out since the price that is shown turns out to be 0.

View 1 Replies

Creating A Program For Which Will Calculate The Time Taken For A User To Make A Number Keystrokes?

Feb 18, 2012

I am creating a program for which will calculate the time taken for a user to make a number keystrokes. I want to start the timer running from the beginning of the first key stroke and end on the final keystroke. Each keystroke has been linked to a label which will change colour according to whether the key has been pressed. When the keystrokes have been finished I want to save this timespan in a field in a database. To test that the timer is running I have made a messagebox which will show the time taken however it is constantly showing zero and the label for the final keystroke is remaining in the keydown colour.

Public Class Form1
Dim dteStart, dteFinish As Date
Dim span As TimeSpan

[code]....

View 19 Replies

Make A Program Calculate The Number Of Comparisons An Insertion Sort Makes?

Jul 15, 2009

I got a list of 16 items and I have sorted them and I want to show the number of comparisons the program had to make using the insertion sort?(in a textbox for example)I mean is there a formula?

View 10 Replies

Write A Program That Calculates A Bill For Pizza Shop?

Oct 12, 2009

I am trying to write a program that compute the bill for a pizza shop and I cannot figure out what I am doing wrong when I build it there are no errors but when I debug it it will not run [code]...

View 4 Replies

Date Method - Calculate The Number Of Years For My Calculate Age Event Handler

Mar 30, 2009

I am trying to calculate the number of years for my calculate age event handler, however i am apparently missing a method or whatnot because im trying to calculate the age , can anyone suggest help on this. I need to subtract years to get my age but when i try the birthdate.Subtract (currentDate) method i get an error about not able to convert from LONG?

So below is what I have.

Private Sub btnCalculateAge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateAge.Click
Dim currentDate As Date
Dim BirthDate As Date
Dim Age As Long

[CODE]

View 7 Replies

Errors When Calculating - Doesn't Calculate Anything Correctly ?

Sep 9, 2009

I am making this program for a school assignment but it has errors when calculating

Private Sub frmReceipt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'When this form is loaded, assign the date to the date label & start the timer
lblDate.Text = Date.Now

[CODE]...

So if counter finishes, execute the following code

If counter > 4 And km >= 1 And kmcashset = 0 Then 'If there is still kms to calculate 'And kmcashset = 0
kmcashholder = kmcash
km = km / 5

[CODE]...

And if I add counter = 0 and km = 0 at the end of that "If counter > 4 And km >= 1 And kmcashset = 0" Then it doesn't calculate anything correctly. I supply it with 9 for Distance and it returns 4 for excessdistance which is correct but returns 7 for excessdistancecharge when it should be 4! When I supply 23 for Distance it returns 18 for excessdistance and 11 for excess distance charge which is correct. (???)

Excessweightcharge calculates correctly.

I think it may be the way I'm implementing it, through the use of AND or maybe it's because it's in timer tick?

-Minimum charge of $5 which covers 10 kgs for the first 5 kms only
-Each kg over 10 kgs incurs a charge of $0.50
-Distances over 5 kms incur an additional charge of $1 per km up to 10 kms
-For deliveries over 10 kms, the extra distance should be rounded up to the nearest 5 kms and charged at $2 for each extra 5 km block.

EXAMPLE 1:
Packet weighing 9kms travelling 9 kms
Standard charge for first 5 kms ($5.00)
Weight less than 10 kgs so no extra weight charge
Extra distance charge 9 - 5 kms = 4kms x $1 = ($4)
Total delivery charge = $5 plus $4 = $9

[But my program returns 7 for excess distance charge]

EXAMPLE 2:
Packet weighing 33kgs travelling 23 kms
Standard charge for the first 5 kms ($5)
Excess weight 33 - 10 kgs = 23kgs x $0.50 ($11.50)
Extra distance (23 - 5kms = 18kms):
18kms ( 5 to 10 kms at $1/km) = ($5)
13kms (18-5)/5 = 3 (rounded up) x $2.00 = ($6)
$5 + $6 = $11
Total delivery charge = $5 plus $11.50 plus $11 = $27.50

[My program calculates everything correctly]

View 2 Replies

Calculate Seconds Between Two Events?

May 19, 2010

in calculating interval between two Events in Seconds..

View 4 Replies

Calculate Date From Year / Week-number / And Day-number

Jun 23, 2009

I have following code (in VBA, excell) for calculating a date.I have variable for yeay, weeknumber and daynumber from week, now i wanna calculate the exact date. [code] But when i place this code in vb.net don't get the correct month.It displays correctly the year, day and daynumber but is displays the month as '00'. What do i have to change?

View 2 Replies

VS 2010 Create A Program That Can Access Information Held In An Excel Database And Show It In A Simple Form

Feb 27, 2012

how to create a program that can access information held in an excel database and show it in a simple form.

View 2 Replies

Calculate Size On Disk?

Oct 25, 2011

I am trying to calculate the total size on disk of all files in a directory. However, it does not appear to be working.

Here is my code behind:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dInfo As New DirectoryInfo("C:WebsitesHKM3TempUpload")

[Code]......

View 7 Replies

Calculate The Size Of A Directory In .NET?

Jul 8, 2010

I need to calculate the directory size in VB .Net I know the following 2 methods[URL]..' The following example calculates the size of a directory and its subdirectories, if any, and displays the total size in bytes.Imports System Imports System.IO

[Code]...

Both these methods work fine. However they take lot of time to calculate the directory size if there are lot of sub-folders. e.g i have a directory with 150,000 sub-folders. The above methods took around 1 hr 30 mins to calculate the size of the directory. However, if I check the size from windows it takes less than a minute.

View 2 Replies

Calculate Display Size For Multiple Monitors?

Sep 23, 2011

I'm trying to calculate the size of multiple monitors together, like the display size. This is an example of what I am talking the Size of the Virtual Screen"). I tried the code, with no luck. The WinAPI didn't seem to do anything, but take space in my code edit

View 1 Replies

C# - How To Calculate Font Size Of TextBlock To Fill In Canvas

Feb 13, 2012

What I need is some formula to calculate font size of TextBlock for its owner - Let's say I have Canvas height 100.0 then which TextBlock font size should be to fill all space of the Canvas?

P.S. The main problem is that I scroll those TextBlocks horizontally...

View 2 Replies

Call A Class From The Code - 'Calculate Size Of Desktop Folder

Mar 19, 2010

How would I call a class from the following code?

'Calculate size of Desktop folder

Public Sub Ck_Box_Desktop_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CK_Box_Desktop.CheckedChanged

[CODE].......................

View 3 Replies

BC30041: Maximum Number Of Errors Has Been Exceeded

Oct 27, 2010

one of our programmers is having an issue with a asp.net app. i had him rebuild and recompile the app to the network share on the staging server and received the same. i even deleted the files in this folder(C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files). to make sure that the server was not the issue i installed it on another server and received the same error.i found a article on msdn that states that its a source code issue.

Compiler Error Message: BC30041: Maximum number of errors has been exceeded.
Source Error:
[No relevant source lines]
Source File: vbc : Line: 0

View 6 Replies

Calculate Number Of Minute?

Jul 12, 2011

I'm trying to calculate the total number of minute that pass 8.00am .. there are few record that the time are greater than 8.00 am which is : 08:15:00, 08:07:00, 08:05:14, 09:01:01 15 + 7 + 5 +61 =88 minute so I should get 88 minute then show it on label1.text

Dim dc As New DataClassesDataContext
Dim q = (From p In dc.times
Where p.name.Equals("Nick") And p.time > New TimeSpan(8, 0, 0) _

[code]....

View 3 Replies

Message Box Pops Up 100 Times, Depending On The Number Of Errors?

Jul 17, 2009

I have a list of 100 assets that are pulled from AS400 and shown on a gridview alongside a dropdown box with 6 possible status and a textbox.

If the user selects a status other than "Found" (whether it's "Not Found", "Scrapped", "Sold", "Transferred","Other"), the user cannot leave the textbox empty. They must insert a comment into the textbox. Once the user is done he clicks "Save" and if, let's say, the status is "Sold" and the textbox is empty for all assets then a Message Box pops up saying "Please fill the textbox".

The problem is, the message box pops up 100 times (or once for every asset that has the error).

1) What can I do so that the message box only appears once even when 100 assets have the error?

2) Also, when the message box appears and I click "OK" the information the user had filled up to that point gets erased.

SAVE CLICK EVENT

Protected Sub Save_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Grabar.Click
Dim comando As String = ""

[Code].....

View 4 Replies

Calculate Number Of Days Between Two Dates?

May 11, 2009

how can i calculate number of days between two dates.....for xample between 24/12/2009

View 9 Replies

Calculate Number Of Months Between Two Dates?

Mar 3, 2011

I have two date values.

Example:

Dim d1 As DateTime = New DateTime(2010, 6,6)
Dim d2 As DateTime = New DateTime(2011, 2,2)

View 3 Replies

Calculate Number Of Moths Between Two Days?

Nov 3, 2010

How to code to calculate number of moths between two days? For example, BeginingDt=09/01/2007, EndingDt=05/20/2009 should be list as below:

2007:4
2008:12
2009:5

(If date of month >=15 will count as whole month, if <15 will be ignored)

View 6 Replies

Calculate Number Of Years To Double It?

Apr 28, 2011

I am trying to figure out how to calculate the number of years it takes to double a user defined number. I have tried to take the number entered and multiply it by twelev and divide by two.

View 2 Replies

Calculate Partition And Put In Sql Select Row Number?

Jun 4, 2012

trying to calculate the partitions for 8 portions, and putting in select statement for row number,something like,

If Not (dstotal.Tables(0).Rows(0)("totalrecord") = 0) Then
dPartition = CInt(dstotal.Tables(0).Rows(0)("totalrecord")) / 8
End If

[code]....

View 2 Replies

Calculate The Factorial Of Given Number Using Recursion?

Mar 29, 2010

calculate the factorial of given number using recursion.input the number in textbox and show the

result in another textboxrajeev ranjan, on 29 March 2010 - 12:38 PM, said:calculate the factorial of

given number using recursion.input the number in textbox and show the result in another textbox.

View 3 Replies

Calculate Week Number In One Month?

Dec 8, 2006

How can we calculate week number in one month.I am bit confused about caliculating this week number in one month.for example if we take today date 8/12/2006.Now we are in which week ? 2nd or first week (in december month)Our zone is united kingdom..

View 11 Replies

How To Calculate Number Of Lines In A Text Box

Feb 27, 2009

I am hoping that someone can help me with a problem I've got at the moment using Compact Framework.Net 2 SP 2.At the moment I have a UI with a series of text boxes and each textbox displays the contents of a database field. These are shown one beneath another with a scroll bar on the right hand side of the form. Each textbox has a set width which might.I would like to adjust the height each text box based on the number of lines it is holding, the font size and the font in order to avoid using scroll bars on each textbox.[code]

View 3 Replies

Calculate The Number Of Months Between 2 Dates In Vb 2008?

Aug 5, 2009

I am attempting to calculate the number of months between 2 dates in vb 2008. Effectively subtracting a date in the past from the current date and then manipulating it to the number of months between the two.

I have done this in VB 6 previously, but can't seem to do it in vb2008.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved