Starting Out With Visual Basic (8th Edition)
8th Edition
ISBN: 9780135204658
Author: Tony Gaddis, Kip R. Irvine
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 2.12, Problem 2.60CP
Program Plan Intro
Message box:
- The messages are displayed to the application user at runtime using the technique called message box.
- A message box is also called as dialog box, which is a window used to display the message.
- To display a message box, the user can use the method named “MessageBox.Show” in Visual Basic.
- A message box contains a button named “OK” to close the message box when the user clicks that button.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Writepseudocodethatperformsthefollowing:Askausertoenteranumber.Ifthe number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. if the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct color option.
Display the message All for one and one for all!with the System.out.print() method and
advance the cursor to the next line.
System.out.print ("All for one and one for all!");
%3D
Submit
X Incorrect. Try again.
Java Program - GUI Number Guessing
Look at the code, notice that the actionPerformed method is not complete. It just contains code that will print to the console when buttons are pressed. Make the following modifications to the code.
When the Higher button is pressed invoke this.guesser.higher(), and then put the new guess into the this.guessField
When the Lower button is pressed invoke this.guesser.lower() and then put the new guess into the this.guessField
When the Reset button is pressed, invoke this.guesser.reset() and then put the new guess into the ghis.guessField
When the Correct button is pressed, exit the app using System.exit(0).
Wrap the invocation of lower() and higher() in try catch blocks that catch NumberGuesserIllegalStateExceptions. Show a JOptionPane that alerts the user that you are onto their schemes.
Change the guessing algorithm from random-guess to binary search. You can do this by changing the object created for the guesser to a plain old NumberGuesser. It…
Chapter 2 Solutions
Starting Out With Visual Basic (8th Edition)
Ch. 2.1 - Prob. 2.1CPCh. 2.1 - Prob. 2.2CPCh. 2.1 - What is the purpose of an objects sizing handles?Ch. 2.1 - What must each form and control in an applications...Ch. 2.1 - Prob. 2.5CPCh. 2.1 - Prob. 2.6CPCh. 2.1 - Prob. 2.7CPCh. 2.1 - What does a forms Text property determine?Ch. 2.1 - Prob. 2.9CPCh. 2.1 - Prob. 2.10CP
Ch. 2.1 - Prob. 2.11CPCh. 2.1 - Prob. 2.12CPCh. 2.3 - What must be added to an application so that it...Ch. 2.3 - Prob. 2.14CPCh. 2.3 - Prob. 2.15CPCh. 2.3 - Prob. 2.16CPCh. 2.3 - Prob. 2.17CPCh. 2.3 - Prob. 2.18CPCh. 2.3 - Prob. 2.19CPCh. 2.3 - Prob. 2.20CPCh. 2.3 - Prob. 2.21CPCh. 2.4 - Prob. 2.22CPCh. 2.4 - Prob. 2.23CPCh. 2.4 - Prob. 2.24CPCh. 2.4 - Prob. 2.25CPCh. 2.4 - Prob. 2.26CPCh. 2.4 - Prob. 2.27CPCh. 2.4 - Prob. 2.28CPCh. 2.4 - Prob. 2.29CPCh. 2.4 - What is a literal?Ch. 2.4 - Prob. 2.31CPCh. 2.4 - Prob. 2.32CPCh. 2.4 - Prob. 2.33CPCh. 2.7 - What is a PictureBox control used for?Ch. 2.7 - Prob. 2.35CPCh. 2.7 - Prob. 2.36CPCh. 2.7 - Prob. 2.37CPCh. 2.7 - Prob. 2.38CPCh. 2.7 - Prob. 2.39CPCh. 2.8 - Prob. 2.40CPCh. 2.8 - Prob. 2.41CPCh. 2.8 - Suppose an application has a Picture Box control...Ch. 2.8 - Prob. 2.43CPCh. 2.9 - Prob. 2.44CPCh. 2.9 - The keyword Me is shorthand for referring to what?Ch. 2.10 - Prob. 2.46CPCh. 2.10 - What character does a comment begin with in Visual...Ch. 2.10 - Prob. 2.48CPCh. 2.10 - Why do programmers insert blank lines and...Ch. 2.11 - Prob. 2.50CPCh. 2.11 - Prob. 2.51CPCh. 2.11 - Prob. 2.52CPCh. 2.11 - Prob. 2.53CPCh. 2.11 - What type of error usually causes the program to...Ch. 2.11 - Prob. 2.55CPCh. 2.11 - Prob. 2.56CPCh. 2.11 - How do you find runtime and logic errors in a...Ch. 2.12 - Prob. 2.58CPCh. 2.12 - Prob. 2.59CPCh. 2.12 - Prob. 2.60CPCh. 2.12 - Prob. 2.61CPCh. 2.13 - Prob. 2.62CPCh. 2.13 - Prob. 2.63CPCh. 2.13 - Prob. 2.64CPCh. 2 - Prob. 1MCCh. 2 - Prob. 2MCCh. 2 - _____ is the name of the blank form that Visual...Ch. 2 - Prob. 4MCCh. 2 - A(n) _____ is a procedure that executes when a...Ch. 2 - Prob. 6MCCh. 2 - In programming we use the term string to mean...Ch. 2 - Prob. 8MCCh. 2 - Prob. 9MCCh. 2 - Prob. 10MCCh. 2 - Prob. 11MCCh. 2 - Prob. 12MCCh. 2 - Prob. 13MCCh. 2 - Prob. 14MCCh. 2 - Prob. 15MCCh. 2 - Prob. 16MCCh. 2 - The equal sign ( = ) is known as the ___________...Ch. 2 - The standard notation for referring to a controls...Ch. 2 - _____ is a feature of Visual Studio that provides...Ch. 2 - Prob. 20MCCh. 2 - Prob. 21MCCh. 2 - Prob. 22MCCh. 2 - Prob. 23MCCh. 2 - Prob. 24MCCh. 2 - Prob. 25MCCh. 2 - Programmers commonly use blank lines and...Ch. 2 - To close an applications form in code, you use the...Ch. 2 - T F: Changing an objects Text property also...Ch. 2 - Prob. 2TFCh. 2 - T F: The forms title is displayed in the bar along...Ch. 2 - Prob. 4TFCh. 2 - Prob. 5TFCh. 2 - Prob. 6TFCh. 2 - Prob. 7TFCh. 2 - Prob. 8TFCh. 2 - Prob. 9TFCh. 2 - Prob. 10TFCh. 2 - Prob. 11TFCh. 2 - Prob. 12TFCh. 2 - Prob. 13TFCh. 2 - Prob. 14TFCh. 2 - Prob. 15TFCh. 2 - T F: Comments are ignored by the Visual Basic...Ch. 2 - Prob. 17TFCh. 2 - Prob. 18TFCh. 2 - What does a bounding box indicate about an object...Ch. 2 - Prob. 2SACh. 2 - What determines an objects appearance and other...Ch. 2 - Prob. 4SACh. 2 - Prob. 5SACh. 2 - What steps must you perform to change a forms Size...Ch. 2 - Prob. 7SACh. 2 - Prob. 8SACh. 2 - Prob. 9SACh. 2 - Prob. 10SACh. 2 - Prob. 11SACh. 2 - Prob. 12SACh. 2 - Prob. 13SACh. 2 - Prob. 14SACh. 2 - Prob. 15SACh. 2 - Prob. 16SACh. 2 - Prob. 17SACh. 2 - Prob. 1AWCh. 2 - Prob. 2AWCh. 2 - Prob. 3AWCh. 2 - Prob. 4AWCh. 2 - Suppose an applications GUI has a PictureBox...Ch. 2 - Prob. 1WDTCh. 2 - Prob. 2WDTCh. 2 - Prob. 3WDTCh. 2 - Open the Error1 project from the student sample...Ch. 2 - Open the Error2 project from the student sample...Ch. 2 - Look at the following list of Latin words and...Ch. 2 - Create an application that displays a simple math...Ch. 2 - Prob. 3PCCh. 2 - Prob. 4PCCh. 2 - State Abbreviations The following table shows...Ch. 2 - Prob. 6PCCh. 2 - Prob. 7PCCh. 2 - Joke and Punch line A joke typically has two...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Question 5 (0.2 points) ✓ Saved Which of the following statements is false? The nodes arranged in a layout container are a combination of controls and possibly other layout containers. All of the above statements are true. When the user interacts with a control, it generates an event. Programs can use event handling to specify what should happen when each user interaction occurs. An event handler is a method that responds to a user interaction. An FXML GUI's event handlers are defined in a controller class. Question 6 (0.2 points) Layout containers help you arrange GUI components. A VBox arranges its nodes left to right Saved Aarrow_forwardHelp I am making a elevator simulation. Can you please help me improve my code. Any help is appreciated. There are 4 types of elevators in the system:StandardElevator: This is the most common type of elevator and has a request percentage of 70%. Standard elevators have a maximum capacity of 10 passengers.ExpressElevator: This type of elevator has a request percentage of 20%. Express elevators have a maximum capacity of 8 passengers and are faster than standard elevators.FreightElevator: This type of elevator has a request percentage of 5%. Freight elevators have a maximum capacity of 5 passengers and are designed to transport heavy items.GlassElevator: This type of elevator has a request percentage of 5%. Glass elevators have a maximum capacity of 6 passengers and are designed to transport fragile item import java.util.Random; public abstract class Passenger { public static int passengerCounter = 0; private String passengerID; protected int startFloor; protected int…arrow_forwardWrite a MessageBox.Show method that displays “You win!” as the message, “Game Over” in the title bar, an OK button, and an Information icon.arrow_forward
- Please look at attached photos. It needs to pass all of the simulations. Thanks in advance Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the data for reading. Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the alphabet with our pattern. For example, if our shift number was 3, then A would be replaced with D, if we performed a right shift. As an example: Text = "THE CAT IS VISIBLE AT MIDNIGHT" Ciphertext…arrow_forwardStep 1: Open the Emulator software. Load snake.asm Click on Examples -> More examples -> snake.asm Modify the code so that players can use the following keys to control the directions A -> left D -> right W -> up S - > down Write the updated codes in the same order mentioned above separated by '-' (ALL SMALL LETTERS) - Don't write 'h' eg. 23-5c-7b-8aarrow_forward*with psuedo code First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "WeightedAvgDataAnalyzer" (without the quotation marks), that does the following: This program is similar to the previous assignment - "WeightedAvgDropSmallest" - with a major difference that the inputs for the program will be read from a file and the output for this assignment should be written to a new file. The concept of application is as follows: The program will read numbers from a file - data.txt - that you will create, where the weight is a double (greater than 0.0 and less than or equal to 1.0) and the other numbers are the number, n, of lowest values to drop and then the numbers to be averaged after dropping the lowest n values. Example data.txt file would display: 0.5 3 10 70 90 80 20 The program then calculates the weighted average of all those numbers except the lowest n numbers, where…arrow_forward
- JAVA SWING PROGRAMMING Create a LOG-IN Account that will accept the USER NAME and PASSWORD; Add a JBUTTON to confirm the LOG-IN Display the message "LOG-IN SUCCESSFUL" if the user made a successful attempt otherwise; Display the message "LOG-IN FAILED!" Using a loop to make sure to allow the user to make another attempt for every unsuccessful LOG-IN. .limit the number of attempts to three timesarrow_forwardCan someone help me solve this program? The only result shown is the empty window. Below is the codes I have: import tkinter as tk import tkinter.messagebox def myWindow: def --unit--(self): self.main_window = tkinter.Tk() #This is a button for show info #When the user clicks the show info button # The name and address should be displayed self.my_button = tkinter.Button(self.main_window, text = 'Click', command = self.do_something) #quit-button. When the user clicks on it, # the info should be deleted or closed self.quit_button = tkinter.Button('Response', text = 'Quit', command = self.main_window.destroy) #pack the button self.my_button.pack() self.quit_button.pack() #manin loop tkinter.mainloop() #enter the do something callback function for the button widget def do_something(): #display info dialog box tkinter.message box.showinfo('Response', Name and Address comes here') window =tk.Tk() window.title(My Adrress) window.mainloop() if --name-- == '--main--':…arrow_forwardFix the Java code, make sure: Leave comments as explaination how the code work. The program has no console input, so it doesn't use Scanner. Don't use any class-level (static) variables. Every variable should be declared inside of a method. Code: public class Main { publicstaticvoid main(String[] args){ //check if length of the command line arguments is 0 //then display the message how to use program if(args.length==0){ System.out.println("usage : java Main 5 4 2 8"); System.out.println("To average the numbers 5,4, 2 and 8"); } else{ System.out.println("Here is you areray of numbers:"); //call displayarray function displayarray(args); //display the average value System.out.println("and their average is :"+ getaverage(args)); } } /*The function1, getaverage takes a string array as input array * and then calculate the average of array values and * return the array average */ privatestaticdouble getaverage(String[] args){ double total=0; for (int i =0; i < args.length; i++) {…arrow_forward
- Please help me solve it today I posted it yesterday and got rejected I don't know why:( Please help me solve this with Java Game class instructions:• Game class has three attributes: points (which represent the number of points awarded when winning the game), status (false if the game has not been played and true if the game has been played), and description (which is a text description of the game). Note that description attribute is a read-only variable. • In the constructor, initialize points to zero, status to false, and description to the given parameter.• isPlayed method returns true if the game has been played, and false otherwise.• getPoints is a getter method for points attribute.• play method is an abstract method.• Override toString method to return the game description.• Override equals method so that two games are the same if their descriptions are the same. :instructions class ) HangMan• HangMan is a game in which a player tries to guess a word based on a given hint.…arrow_forwardPlease provide Handwritten answer. 16. String and StringBuffer will have same set of methods. Select one: True Falsearrow_forwardAssignment using Methods For this exercise, you need to complete all the questions in a single project. You will invoke the methods from your main. Questions 1-6 is due at the end of your next class. Write a method with the following specifications:name: DisplayMenuarguments: nonereturn value: nonetasks: display the following menu choice on the screenCalculation Menu3) Calculate Sum 4) Calculate Sum of Squares5) Calculate Sum of Cubes0) To ExitEnter the number that corresponds to your choice: You may beautify the output to your own likings. You don’t have to implement the functionalities of the various menu choices at this stageCall this method from your main. Modify your main so that the above method is call repeatedly. The program will terminate when the user enters 0. Any other choice should produce an error message. Because you will not be doing any arithmetic you may accept the user response either as an int, or a char or a string. Write a method with the following…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education