Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 7E
Create an enumeration named Month that holds values for the months of the year, starting with JANUARY equal to 1. (Recall that an enumeration must be placed within a class but outside of any method.) Write a GUI
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
This is in Python. Write a GUI program in which you ask the user to enter the number of miles driven in hour 1, the number of miles driven in hour 2, and the number of miles driven in hour 3. When you click the total button the output in the same GUI should say: the number of miles driven in the three hours is 190 miles (if hour 1 entry is 70, hour 2 entry is 72 and hour 3 entry is 48).
There should be three labels, three entry boxes, and two buttons(total and quit)
In Java FX or Java
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 3 Solutions
Microsoft Visual C#
Ch. 3 - Which of the following is a GUI object that...Ch. 3 - Prob. 2RQCh. 3 - In the IDE, the area where you visually construct...Ch. 3 - Prob. 4RQCh. 3 - The Form class has ____________ properties. a....Ch. 3 - Prob. 6RQCh. 3 - Which of the following is a legal Form Name...Ch. 3 - Which of the following is a legal Form Text...Ch. 3 - Which of the following does not appear in the IDEs...Ch. 3 - After you have dragged a Button onto a Form in the...
Ch. 3 - The button1_Click() method that is generated by...Ch. 3 - A(n) _____________ is generated when a user...Ch. 3 - Prob. 13RQCh. 3 - Prob. 14RQCh. 3 - _____________ are controls through which a user...Ch. 3 - Prob. 16RQCh. 3 - Prob. 17RQCh. 3 - Prob. 18RQCh. 3 - If you inadvertently create a Click() method for a...Ch. 3 - Prob. 20RQCh. 3 - Write a GUI program named InchesToCentimetersGUl...Ch. 3 - Write a GUI program named ProjectedRaisesGUI that...Ch. 3 - Prob. 3ECh. 3 - Write a GUI program named Eggs InteractiveGUl that...Ch. 3 - Write a GUI program named MakeChangeGUl that...Ch. 3 - Write a GUI program named TestsInteractiveGUI that...Ch. 3 - Create an enumeration named Month that holds...Ch. 3 - Pig Latin is a nonsense language. To create a word...Ch. 3 - Each of the following projects in the Chapter.03...Ch. 3 - In Chapter 2, you created a program for the...Ch. 3 - In Chapter 2, you created a program for Marshalls...
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
- A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10-19 10% 20-49 20% 50-99 30% 100 or more 40% Write a GUI program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. A successful test run of the program for different inputs is as shown below:arrow_forwardMake a GUI using tkinter: The wonderful company, SpaceZ, is a fictional company that makes its money by providing orbital services (aka, blasting rockets into space). They have an aggressive marketing department trying to get all possible launches filled. There are 7 customers that the marketing department tracks. The marketing department has 3 active sales staff on commission. The Commission report is the total of each salesperson’s commission as well as total commission at the bottom. SpaceZ offers a range of services including manned spaceflight at various cost levels as shown below. Orbital Services: Service Code: ORB1 Short Description: Satellite: LEO Fee: 65,000,000 Sales Commission: 0.1% 1st Stage Recovery: Land Service Code: ORB2 Short Description: Satellite: GSO Fee: 67,000,000 Sales Commission: 0.12% 1st Stage Recovery: Land Service Code: ORB3 Short Description: Satellite: SSO Fee: 72,650,000 Sales Commission: 0.12% 1st Stage Recovery: Sea Service Code: ISS5…arrow_forwardVB create this program on visual basics or any other programming GUI langauge Create one object – Person, and code it. Create the menus shown in the demo program. The interface is a bit different from what you have done to this point. Play with the program to see how it works. The hungarian notation for a date control is dte. Commands The key commands of this program are: Add a Person Remove a Person Display next person Display previous person Display first person Display last person. Create the programming to make these components work. Refer to the power point notes for examples of how the code needs to be set up. Protecting Data against Accidental change Change the display to allow the user to enter data into text boxes, but protect the data from being accidentally changed by setting the ReadOnly property of the text boxes appropriately. This should be a sub. Call it as you need it. The Date has no ReadOnly property, use the Enabled property instead for this control. Use the enabled…arrow_forward
- In previous chapters, you have created a number of programs for Sammy's Seashore Rentals. Now, create an interactive GUI program that allows the user to enter a rental time in hours into a text field; if the value entered is not numeric, set the rental price to 0. Also allow the user to choose one equipment type to rent from a group of seven choices. The rental fee is $40 per hour for a personal watercraft or pontoon boat; $20 per hour for a rowboat, canoe, or kayak; and $7 per hour for a beach chair or umbrella. Let the user add an equipment lesson for an extra $5. Display a message that indicates all the details for the rental, including the total price. Save the program as JSammysSeashore.java.arrow_forwardWrite a GUI-based program that allows the user to convert temperature values between degrees Fahrenheit and degrees Celsius. The interface should have labeled entry fields for these two values. These components should be arranged in a grid where the labels occupy the first row and the corresponding fields occupy the second row. At start-up, the Fahrenheit field should contain 32.0, and the Celsius field should contain 0.0. The third row in the window contains two command buttons, labeled >>>> and <<<<. When the user presses the first button, the program should use the data in the Celsius field to compute the Fahrenheit value, which should then be output to the Fahrenheit field. The second button should perform the inverse function. Be sure to use the field names provided in the comments in your starter code. An example of the program is shown below:arrow_forwardWrite a GUI-based program that allows the user to convert temperature values between degrees Fahrenheit and degrees Celsius. The interface should have labeled entry fields for these two values. These components should be arranged in a grid where the labels occupy the first row and the corresponding fields occupy the second row. At start-up, the Fahrenheit field should contain 32.0, and the Celsius field should contain 0.0. The third row in the window contains two command buttons, labeled >>>> and <<<<. When the user presses the first button, the program should use the data in the Celsius field to compute the Fahrenheit value, which should then be output to the Fahrenheit field. The second button should perform the inverse function.arrow_forward
- Write a simple GUI calculator that will have buttons for each operation + - * /. The user will enter two numbers, hit the operator button and a a solution will will appear in the GUI box.arrow_forwardCreate a GUI that pops up ONLY if the truck is selected. This new window should contain JLabels with JTextFields that allow the user to enter in all the truck's relevant information - e.g. Make, Model, Year, Number of Doors, Fuel Tank Capacity, Driving Range, Towing Capacity, Payload Capacity, and Extra Load. Use the same inputs from Main.java in the Appendix. The new window should also include two calculate MPG buttons – one for MPG without the extra load and one for MPG with the extra load. When pressed, the buttons use the truck constructor to compute the MPG and output the miles per gallon for each scenario. In this case, the MPG without the extra load is 25.0 and the MPG with the extra load is 24.25. Note: assume that the extra load is 100arrow_forwardIn javaarrow_forward
- Create a GUI that pops up ONLY if the car is selected. This new window should contain JLabels with JTextFields that allow the user to enter in all the car's relevant information - e.g. Make, Model, Year, Number of Doors, Fuel Tank Capacity, Driving Range, and Extra Load. Use the same inputs from Main.java in the Appendix. The new window should also include two calculate MPG buttons – one for MPG without the extra load and one for MPG with the extra load. When pressed, the buttons use the car constructor to compute the MPG and output the miles per gallon for each scenario. In this case, the MPG without the extra load is 26.0 and the MPG with the extra load is 25.48. Note: assume that the extra load is 100arrow_forwardWrite a GUI program named Eggs InteractiveGUl that allows a user to input the number of eggs produced in a month by each of five chickens. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.arrow_forwardPig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then add the first letter and ay at the end of the word. For example, dog becomes ogday, and cat becomes atcay. Write a GUI program named PigLatinGUI that allows the user to enter a word and displays the pig Latin version.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY