easy 2020 dramam 5+2 math, Summaries of Mathematics

this feild cannot be empty is thats ok?

Typology: Summaries

2024/2025

Uploaded on 02/04/2025

joshua-aaron-1
joshua-aaron-1 🇬🇧

2 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Visual Basic.NET Programming Practice - Output and Variables
1. Start Visual Studio and create a new Visual Basic Windows Forms App (.NET Framework)
called OutputAndVariables.
Place a button on the form and use the Properties window to change its name to btnGo.
Change your button’s Text property to Go.
Create an event handler for the button by double clicking it.
Write code to display the following message on the screen.
Run the form and test your program.
3. Place a second button on the form, rename it to btnGo2 and change its Text property to Go.
Create an event handler for the button by double clicking it.
Write code to display each of the words in the original message in separate message boxes.
Run the form and test your program.
4. Place a third button on the form, rename it to btnGo3 and change its Text property to Go.
Create an event handler for the button by double clicking it.
Copy and paste the code from your solution to number 3 above into this event handler (and
modify the code to output the same words separately in reverse order.
Run the form and test your program.
5. Place a fourth button on the form, rename it to btnVariableTests and change its Text
property to Using Variables.
Create an event handler for the button.
Write code to output the message “Working with Variables” in a message box.
Page 1 of 4
pf3
pf4

Partial preview of the text

Download easy 2020 dramam 5+2 math and more Summaries Mathematics in PDF only on Docsity!

Visual Basic.NET Programming Practice - Output and Variables

  1. Start Visual Studio and create a new Visual Basic Windows Forms App (.NET Framework) called OutputAndVariables. Place a button on the form and use the Properties window to change its name to btnGo. Change your button’s Text property to Go. Create an event handler for the button by double clicking it. Write code to display the following message on the screen. Run the form and test your program.
  2. Place a second button on the form, rename it to btnGo2 and change its Text property to Go. Create an event handler for the button by double clicking it. Write code to display each of the words in the original message in separate message boxes. Run the form and test your program.
  3. Place a third button on the form, rename it to btnGo3 and change its Text property to Go. Create an event handler for the button by double clicking it. Copy and paste the code from your solution to number 3 above into this event handler (and modify the code to output the same words separately in reverse order. Run the form and test your program.
  4. Place a fourth button on the form, rename it to btnVariableTests and change its Text property to Using Variables. Create an event handler for the button. Write code to output the message “Working with Variables” in a message box.

Add code to which declares 3 new variables with names and data types shown in the table below. Name Data Type stFirstName String stLastName String stGender String Add code to initialise each variable using your own first name, last name and gender. Add code to output the contents of each of variable, one after another, in separate message boxes. Run the form and test your program.

  1. Add a new button to the form, rename it to btnVariableTests2 and change its Text property to Reassignment. Copy and paste the code from your solution to number 5 above into this one and add extra code at the bottom of the procedure to change the contents of these existing variables to a different person’s details (the variables should be assigned different values after their original contents have been displayed in message boxes). Now add code to display the new contents of the variables as well (your program should now display 6 different message boxes in total). Run the form and test your program.
  2. Add a new button to the form, rename it to btnCar and change its Text property to Car. Write an event handler to declare new variables with names and data types shown in the table below. Initialise these variables with the values shown. Name Data Type Value stMake String Ford stModel String Escort iDoors Integer 5 stColour String Red bTaxCurrent Boolean True dblMilesOnClock Double 20530. dtDateRegistere d Date 1/31/ dblEngineSize Double 2. decPrice Decimal 4999. Add code to output the contents of these variables one after another. Test your program.
  1. You can incorporate the special constant vbNewLine when composing a string to force a line break when the string is output. For example, the following code fragment results in the output shown: stNewString = "Hello" & " " & stFirstName & " " & stLastName & vbNewLine & "I love you." MsgBox (stNewString) Add a new button to the form with an appropriate name and caption. Copy your solution to 9 above and modify it to display the car details on separate lines of the same message box and formatted as shown.