Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 9, Problem 20MC
Program Description Answer
To display a form on the screen, the ShowDialog method is used.
Hence, the correct answer is option “B”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
True or False: When numerous parameters are supplied to a method, the order in which they are passed is irrelevant.
Methods with an empty parameter list and do not return a value: [Questions 1-8 required]
You invoke a method by its name followed by a pair of brackets and the usual semi-colon
Write a method called DisplayPersonalInfo(). This method will display your name, school, program and your favorite course. Call the DisplayPersonalInfo() method from your program Main() method
Write a method called CalculateTuition(). This method will prompt the user for the number of courses that she is currently taking and then calculate and display the tuition cost. (cost = number of course * 569.99). Call the CalculateTuition() method two times from the same Main() method as in question 1.
Write a method call CalculateAreaOfCircle(). This method will prompt the user for the radius of a circle and then calculate and display the area.[A = πr2].Call the CalculateAreaOfCircle() method twice from the same Main() method as in question 1. Use Math.Pi for the value of π
Write a method call…
// Question 4:
// Declare an integer variable named "variables with an initial value of 10.
// Write a method named "SetToOne" that takes one out parameter.
// The method should set the out parameter to 1.
// Call the method SetToOne passing variables in the btnQ4 click method.
// Display the variable variables in the lblQ4.
private void btn04_Click(object sender, EventArgs e)
{
Chapter 9 Solutions
Starting out with Visual C# (4th Edition)
Ch. 9.1 - How is a class like a blueprint?Ch. 9.1 - Briefly describe the process of writing a class...Ch. 9.1 - What is a constructor?Ch. 9.1 - Prob. 9.4CPCh. 9.1 - When you pass an object that is an instance of a...Ch. 9.2 - What is a property?Ch. 9.2 - Prob. 9.7CPCh. 9.2 - Prob. 9.8CPCh. 9.2 - Prob. 9.9CPCh. 9.2 - Prob. 9.10CP
Ch. 9.3 - What is a parameterized constructor?Ch. 9.3 - Prob. 9.12CPCh. 9.3 - Prob. 9.13CPCh. 9.3 - What happens if you write a class with no...Ch. 9.3 - Describe the purpose of the default constructor.Ch. 9.4 - Prob. 9.16CPCh. 9.4 - How can you initialize an array of a class type...Ch. 9.4 - Prob. 9.18CPCh. 9.5 - Prob. 9.19CPCh. 9.5 - When designing an object-oriented application, who...Ch. 9.5 - How do you identify the potential classes in a...Ch. 9.5 - What are a classs responsibilities?Ch. 9.5 - What two questions should you ask to determine a...Ch. 9.5 - Will all a class's actions always be directly...Ch. 9.6 - Prob. 9.25CPCh. 9.6 - Prob. 9.26CPCh. 9.6 - Prob. 9.27CPCh. 9.6 - Prob. 9.28CPCh. 9.6 - Prob. 9.29CPCh. 9 - Each object that is created from a class is called...Ch. 9 - Prob. 2MCCh. 9 - The first line of a class declaration is known as...Ch. 9 - The classs________ are the statements that define...Ch. 9 - A(n) _____ is a method that is automatically...Ch. 9 - A(n) is a special type of class member that allows...Ch. 9 - A special set of methods, known as_________, work...Ch. 9 - Prob. 8MCCh. 9 - The parameter of the set accessor is automatically...Ch. 9 - A can be read, but it cannot be modified. a....Ch. 9 - When the value of an item is dependent on other...Ch. 9 - A constructor that accepts arguments is known as...Ch. 9 - Prob. 13MCCh. 9 - Prob. 14MCCh. 9 - A methods ______ consists of the methods name and...Ch. 9 - A is a constructor that accepts no arguments. a....Ch. 9 - If you write a class with no constructor...Ch. 9 - Prob. 18MCCh. 9 - A classs responsibilities are_______. a. the...Ch. 9 - Prob. 20MCCh. 9 - Objects that are instances of a class are always...Ch. 9 - Prob. 2TFCh. 9 - A class is an object.Ch. 9 - It is a common practice to make all a classs...Ch. 9 - The same rules for naming variables apply to...Ch. 9 - If you need to make a property read only, you...Ch. 9 - If you try to pass a property to a ref or an out...Ch. 9 - Class fields are almost always declared public in...Ch. 9 - The get accessor can be thought of as a method...Ch. 9 - Constructors can accept arguments in the same way...Ch. 9 - It is legal to write a class without any...Ch. 9 - Objects that are instances of a class can be...Ch. 9 - Prob. 13TFCh. 9 - One way to find the classes needed for an...Ch. 9 - Prob. 15TFCh. 9 - By default, a controls Modifiers property is set...Ch. 9 - Prob. 1SACh. 9 - What are the advantages of storing classes in...Ch. 9 - How is a constructor used?Ch. 9 - What is the difference between a class and an...Ch. 9 - What convention do most programmers follow when...Ch. 9 - What is the value parameter? How is it created?Ch. 9 - What is executed any time a class property is...Ch. 9 - What is executed any rime a value is assigned to a...Ch. 9 - How can you protect class fields from accidental...Ch. 9 - Prob. 10SACh. 9 - Is it possible to pass initialization values to...Ch. 9 - How does the compiler distinguish a method from...Ch. 9 - What do you call the constructor that is provided...Ch. 9 - Prob. 14SACh. 9 - Prob. 15SACh. 9 - Prob. 16SACh. 9 - Prob. 17SACh. 9 - Write a statement that creates an instance of the...Ch. 9 - Write the accessors for a property named...Ch. 9 - Prob. 3AWCh. 9 - Look at the following description of a problem...Ch. 9 - Pet Class Create a class named Pet (similar to the...Ch. 9 - Car Class Create a class named Car that has the...Ch. 9 - Personal Information Class Create a class that...Ch. 9 - Employee Class Write a class named Employee that...Ch. 9 - RetailItem Class Write a class named RetailItem...Ch. 9 - Dorm and Meal Plan Calculator A university has the...Ch. 9 - E-Mail Address Book Create an application with a...
Knowledge Booster
Similar questions
- For this lab, you will be doing the following in C#: 1) Create a Home form with buttons that when clicked, will open the Account, Email, and eventually the Contact forms. The Account form should be opened in "View" mode. 2) Add code to the Login form so the Account form opens when the user clicks "Create New Account". The Account form should be opened in "Modify" mode. 3) Add code to the Login form that validates the user input before allowing the user the access the Home form. For now, just verify the user enters "user1" and "12345" for the username and password respectively.arrow_forwardPlease provide answer in C#: Slot Machine Simulation A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create an application that simulates a slot machine. Figure 8-23 (on page 539 of your book) shows an example of how the form should look. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols. You will find a set of fruit symbols attached to this dropbox for your use - from the Student Sample Programs provided by the book author.) If none of the randomly displayed images match, the program should inform the user that he or she has won…arrow_forwardTrue or False: The value of a local variable is retained between method calls.arrow_forward
- // Question 4: // Declare an integer variable named "variables with an initial value of 10. // Write a method named "SetToOne" that takes one out parameter. // The method should set the out parameter to 1. // Call the method SetToOne passing variables in the btngs click method. // Display the variable variables in the lblQ4. private void btn04_Click(object sender, EventArgs e) {arrow_forward// Question 4: // 20 Points // Declare an integer variable named "variableQ4" with an initial value of 10. // Write a method named "SetToOne" that takes one out parameter. // The method should set the out parameter to 1. // Call the method SetToOne passing variableQ4 in the btnQ4 click method. // Display the variable variableQ4 in the lblQ4. 1 reference private void btnQ4_Click(object sender, EventArgs e) { }arrow_forwardSuppose myCar is the name of a class variable that references an object, and go is the name of a method. (The go method does not take any arguments.) Write a pseudocode statement that uses the myCar variable to call the method.arrow_forward
- Question (1): Define the ReplaceAll method, its idea to search for partial text (word or phrase) specific and switch to another part. When you call the method, we must pass three texts. The first represents a plain text, the second represents the partial that we want to search for, and the third represents the partial that we want to replace with the second partial place. If the user click enter without writing a string, the program shows a message “There is no text!". See examples to get the idea. [5 Marks] Ехample 1: Enter your text: I am learning C++. I am writing C++ code. I like C++. Enter the word you want to replace: C++ Enter the word you want to replace with: Java Before: I am learning C++. I am writing C++ code. I like C++. After: I am learning Java. I am writing Java code. I like Java. Ехample 2: Enter your text: There is no text!arrow_forwardin c# please Write method QualityPoints that inputs a student’s average and returns 4 if the student’s average is 90–100, 3 if the average is 80–89, 2 if the average is 70–79, 1 if the average is 60–69 and 0 if the average is lower than 60. Incorporate the method into an app that reads a value from the user and displays the result.arrow_forwardC++ Program: A menu is a list of options for a user to select. The selection is the single character chosen for a menu item. An example menu is below: 1. Buy2. Sell3. ConvertX. Exit Assignment: Write a method called "promptForInput" that will help you write user menus. You should be able to use this in future programs if wanted. The purpose for this method is to be the "end all of methods" that you could reuse in other situations. The code should pass an C-String of valid characters to select to the promptForInput method as the 1st parameter. See "C-Strings Stored in Arrays" on page 556 8th ed. or 566 9th ed. In the example above, the C-String would be "123X". The code should pass a C-String that is the menu to display as the 2nd parameter. It may help your display to have embedded \n characters.I.E. char menu[] = "1. Buy\n2. Sell\n3. Convert\nX. Exit";Example pseudo code:define c-string char array of valid input charactersdefine menuloop until X inputchar input =…arrow_forward
- In Java, a global variable is declared inside a method and is accessible only in that method. -True -Falsearrow_forwardMake use of C# in Visual Studio. The below form will represent the main form from which the user will navigate to the other forms. Meaning each button should be linked to the appropriate form. E.g. If button Manage Addresses is clicked the form managed addresses should be displayed. The Exit button should successfully terminate the program. Create a void method for each button and name them as follow: LinkToAddresses (), LinkToCustomers (), LinkToDrivers (), LinkToStatus (), and LinkToFreight (). The methods should be called under the appropriate button. For the exit button create a void method named AppExit () this should terminate the program.arrow_forwardMake use of C# in Visual Studio. The below form will represent the main form from which the user will navigate to the other forms. Meaning each button should be linked to the appropriate form. E.g. If button Manage Addresses is clicked the form managed addresses should be displayed. The Exit button should successfully terminate the program. Create a void method for each button and name them as follow: LinkToAddresses (), LinkToCustomers (), LinkToDrivers (), LinkToStatus (), and LinkToFreight (). The methods should be called under the appropriate button. For the exit button create a void method named AppExit () this should terminate the program.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT