Question

Murphy Pizza Palace needs an application to calculate the number of slices of a pizzaof any...

Murphy Pizza Palace needs an application to calculate the number of slices of a pizzaof 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 the following facts:

Each slice should have an area of 14.125 square 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 following formula:????=??2Where ?=3.14159and ?is the radius of the pizza. Note that ?=2?

Input validation:If the user fails to enter numeric values, display an appropriate message in a StatusStrip and do not attempt to perform calculations.

using Visual Basic IDE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Windows Forms Application in VB is created using Visual Studio with name "MurphyPizzaApp".This application contains a form with name "Form1.vb".Below are the files associated with form1.

1.Form1.vb[Design]

2.Form1.vb

Public Class Form1
'Calculate number of slice button click
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
'declaring variable to store diameter of pizza
Dim pizzaDiameter As Double
'checking pizza diameter entered by user in the textbox
If Double.TryParse(txtPizzaDiameter.Text, pizzaDiameter) Then
'clear ToolStripStatusLabel text
ToolStripStatusLabel1.Text = ""
'finding radius from pizza diameter d=2r
Dim radius As Double = pizzaDiameter / 2
'then finding area of pizza using formula Area=PI*r*r
Dim area As Double = Math.PI * radius * radius
'calculating the number of slices, divide the area of the pizza by 14.125.
lblResult.Text = "Number of slices : " & (area / 14.125).ToString("0.00")
Else
'when user fails to enter numeric values
ToolStripStatusLabel1.Text = "enter valid value for pizza diameter"
End If
End Sub
End Class

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

Output : Run application using F5 and will get the screen as shown below

Screen 1 :

Screen 2:Screen for non numeric pizza diameter

Screen 3:Screen showing number of slices

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Murphy Pizza Palace needs an application to calculate the number of slices of a pizzaof any...
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
  • A restaurant called Tony’s Pizza Palace needs a program to help calculate rhe number of slices...

    A restaurant called Tony’s Pizza Palace needs a program to help calculate rhe number of slices a pizza of any aize can be divided into, and hoe many pizzas should be ordered for a party. The program will assume each person at the party will eat 3 slices of pizza each. The program should prompt the user for the diameter of the pizzas they wish to order. it will also ask the user for the number of people who will...

  • (The file should have your program and the console input/output of your program) 3.18: Pizza Pi...

    (The file should have your program and the console input/output of your program) 3.18: Pizza Pi Joe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The program should perform the following steps: Ask the user for the diameter of the pizza in inches. Calculate the number of slices that may be taken from a pizza of that size. Display a message telling the number of slices. To calculate...

  • D Question 5 20 pts Sam's Pizza Palace has the following relationship between the number of...

    D Question 5 20 pts Sam's Pizza Palace has the following relationship between the number of cooks he hires and the number of slices he can make. The market for pizza is perfectly competitive, with a market price of $2.00 per slice. Slices per day Variable Cost Total Cost Marginal Cost Workers 0 Fixed Cost $10 $10 $10 $10 $10 $10 $20 $40 $60 $80 75 $100 Please enter your answers in the box as numbers. (ie. 70 not 'seventy'or...

  • Suppose the following table reflects the total satisfaction (utility) derived from eating slices of pizza. Calculate...

    Suppose the following table reflects the total satisfaction (utility) derived from eating slices of pizza. Calculate the marginal utility of each slice of pizza and answer two questions about marginal utility. a. What is the marginal utility of each slice of pizza? Instructions: Complete each of the cells below. Enter your responses as a whole number. If you are entering any negative numbers be sure to include a negative sign (-) in front of those numbers. Total Utility Marginal Utility...

  • create an application in VISUAL BASIC that calculates a cars gas mileage. The formula for calculating...

    create an application in VISUAL BASIC that calculates a cars gas mileage. The formula for calculating the miles that a car can travel per gallon of gas is MPG = Miles/Gallon In the formula MPG is miles-per-gallon, miles is the number of miles that can be driven on a full tank of gas, and gallons is the number of gallons that the tank holds. The applications form should have TextBox controls that let the user enter the number of gallons...

  • Create an application in Visual Studios 2015 that displays the result of dividing the larger of...

    Create an application in Visual Studios 2015 that displays the result of dividing the larger of two numbers entered by the user by the smaller one. You can not label entries of one must the larger on the user interface. You must use your known logic to determine which number is larger of the two entered by the user to perform your calculations. ¢ If the smaller number is 0, the application should display the message "Cannot divide by 0"...

  • This exercise guides you through the process of converting an Area and Perimeter application from a...

    This exercise guides you through the process of converting an Area and Perimeter application from a procedural application to an object-oriented application. Create and use an object 1. Open the project named ch04_ex2_Area and Perimeter that’s stored in the ex_starts folder. Then, review the code for the Main class. 2. Create a class named Rectangle and store it in the murach.rectangle package. 3. In the Rectangle class, add instance variables for length and width. The, code the get and set...

  • Can you solve this proble by using C# application? C# is one of programming languages supported...

    Can you solve this proble by using C# application? C# is one of programming languages supported by Visual Studio 2015. It combines the features of Java and C ++ and is suitbale for rapid application development. A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4% and the county sales tax rate is 2%. Create an...

  • Create an application with the following requirements: 1 form graphic on the form itself, along with...

    Create an application with the following requirements: 1 form graphic on the form itself, along with various others depending on the graphics used You pick the form color or additional graphics The program should generate a random number(1 and 100). A label that asks the player to think of a number between 1 and 100. The player should be able to enter their guess into a textbox. The program should validate the users entry to make sure its: A number,...

  • C++ Programming Question for an intro course Complete a program that determines how many brownies will...

    C++ Programming Question for an intro course Complete a program that determines how many brownies will fit in a baking pan of a specified size. The program should do the following correctly:  Prompt the user to enter the length and width (in inches) of a baking pan.  Compute the surface area of the bottom of the pan.  Compute how many small brownies the pan will hold if each one is cut with a 1”x1” square bottom. ...

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