Knowee
Questions
Features
Study Tools

A windows form application is needed where the user enters through a textbox the number offruits she has and then tells the user how many dozen fruits she has and how many extra fruitsare left over on separate textboxes after a button is clicked.i). Sketch the design of the interface.

Question

A windows form application is needed where the user enters through a textbox the number offruits she has and then tells the user how many dozen fruits she has and how many extra fruitsare left over on separate textboxes after a button is clicked.i). Sketch the design of the interface.

🧐 Not the exact question you are looking for?Go ask a question

Solution

As a text-based AI, I'm unable to sketch designs. However, I can describe how the interface might look:

  1. A label at the top of the form that says "Enter the number of fruits you have".

  2. Below the label, a textbox where the user can input the number of fruits.

  3. A button below the textbox that says "Calculate".

  4. Two labels below the button. The first one says "You have _ dozens of fruits", and the second one says "You have _ extra fruits". The underscores are placeholders where the calculated values will be displayed.

  5. Two textboxes corresponding to each label where the calculated values will be displayed.

Here's a step-by-step guide on how to create this in a Windows Form Application:

  1. Open Visual Studio and create a new Windows Form Application.

  2. Drag and drop a Label from the Toolbox onto the Form. Change its Text property to "Enter the number of fruits you have".

  3. Drag and drop a TextBox from the Toolbox onto the Form, placing it below the Label.

  4. Drag and drop a Button from the Toolbox onto the Form, placing it below the TextBox. Change its Text property to "Calculate".

  5. Drag and drop two more Labels from the Toolbox onto the Form, placing them below the Button. Change their Text properties to "You have _ dozens of fruits" and "You have _ extra fruits".

  6. Drag and drop two TextBoxes from the Toolbox onto the Form, placing them next to the corresponding Labels.

  7. Double-click the Button to create a click event handler. In the event handler, write code to take the number from the first TextBox, calculate the number of dozens and extra fruits, and display the results in the other two TextBoxes.

This problem has been solved

Similar Questions

Create application displays the total number of words and characters entered in a text box. To do so, this application usesa TextBox control, a Button control, a Label control and three CheckBox controls. The following lists the use of each ofthese CheckBox controls:• The first one for enabling the counting of the number of characters entered in the textbox.• The second one for enabling the words count.• The last one set to an indeterminate state

a) Explain the purpose of the following objects as used in VB.NET.i. Button (2 marks)ii. Text Box (2 marks)iii. Label (2 marks)iv. Radio Button (2 marks)b) Write a code that can display the following message box: (8 marks)c) Discuss THREE types of errors one is likely to encounter in event driven programming.(6 marks)d) Draw a GUI and write a program to show case how items can be added, deleted, and countedin a list box control. (8 marks)e) Describe TWO main ways that you can a VB.NET project. (4 marks)f) Design a basic VB.NET program that displays; your official names, registration number, yourlecturer’s name, and lecturer’s email address. (6 marks)SECTION A (QUESTION ONE IS COMPULSORY AND CHOSE ANY OTHER TWOQUESTIONS)QUESTION 1 (COMPULSORY 20MARKS)a) With examples distinguish between the following terms as used in Event driven programming;i. Entity (2 marks)ii. File (2 marks)iii. Record (2 marks)iv. Table (2 marks)b) A program is required to determine the gross pay for each of the several employees of acertain company. The company pays “straight-time” for the first 40 hours worked by eachemployee and pays “one-and a half time” for all hours worked in excess of 40 hours. You aregiven a list of employees in the company, the number of hours each employee worked and thehourly rate of each employee. You are to design a program in which you should input thisinformation for each employee, and then compute and display the employee’s gross pay. use textboxes for both inputs and outputs.Required:i. Design the graphical user interface for this program (4 marks)ii. Write a program code to compute the gross pay. Your program should validate the inputsin such a way that the names of the employees must be input, the number of hoursworked and pay rate must be numeric, greater than zero but less than or equal to 60 andgreater than zero respectively. Display an appropriate message in case of violation.(8 marks)QUESTION 2 (20MARKS)a) With the use of appropriate syntax explain THREE ways in which the IF statement can beimplemented in Event Driven Programming. (6 marks)b) Describe FOUR main components in a Visual Basic Programming Environment. (8 marks)c) Draw a flowchart for a program that calculates the average of three grades and prints theaverage. The word GOOD should be printed only if the average is more than 80. (6 marks)QUESTION 3 (20MARKS)a) Using basic codes describe the following repetition structures in event driven programming.i. For Next (2 marks)ii. Do loop until (2 marks)iii. Do while loop (2 marks)b) Write a program that can be used to calculate the surface area of the next world cup ball.(8 marks)c) Design a code that can ensure that the user can Cut, Copy, and Paste items from one text boxto another text box by right clicking the mouse button. (6 marks)QUESTION 4 (20MARKS)a) Outline TWO examples of event driven programming languages. (2 marks)b) Explain how you can create a menu called Edit that has Cut, Copy, and Paste sub menus.(6 marks)c) Design a program that reads in a number through a text box. If the number is greater than five,it displays the cube of the number; else it displays the square of the number. (6 marks)d) Demonstrate the steps involved in setting up a connection to a database or other types of datasource using VB.NET. (6 marks)

Create a C# app to do just that! Use a loop to display all positive integers up to 100 in a listbox whenyou enter a “Count by” number (e.g., 2, 3, 5, 10, etc.) in a textbox and click the Calculate button orpress the Enter key. Think carefully about how to initialize and increment your counter variable in yourloop. Remember, you can set a breakpoint (red dot) in your code to help debug it, if needed.Additionally, display the sum of all of the listbox values in a label. For example, if your app counts by10’s, the sum should be 550 (Figure 1). Declare and initialize a sum variable to zero, since it will serveas an accumulator variable. Add this logic to the code for the loop already in the Calculate button eventhandler. Clear the listbox before entering the loop

Create a mini calculator application, which has following functionalitiesAdditionSubtractionDivisionMultiplicationYour app should haveTwo input boxes which should take two numbers from the user.Four Buttons with following text contentAddSubtractDivideMultiplyWhen user enter 2 and 4 and clicks on multiply button, an alert should come with 8 as ansWhen user enter 8 and 4 and clicks on Divide button,an alert should come with 2 as ans

) Draw a GUI and write a program to show case how items can be added, deleted, and countedin a list box control.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.