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 4E
Write a GUI
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Create an application that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you can use Button controls, or clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules:• If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)• If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.)• If one player chooses…
This is the question:
Write an application that displays every perfect number from 1 through 1,000. A perfect number is one that equals the sum of all the numbers that divide evenly into it. For example, 6 is perfect because 1, 2, and 3 divide evenly into it, and their sum is 6; however, 12 is not a perfect number because 1, 2, 3, 4, and 6 divide evenly into it, and their sum is greater than 12.
This is the code given:
public class Perfect {
public static void main (String args[]) {
// Write your code here
}
public static boolean perfect(int n) {
// Write your code here
}
}
Calculating the Factorial of a Number In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all the nonnegative integers from 1 through n. For example, 7! = 1 × 2 × 3 × 4 × 5 × 6 × 7 = 5,040 and 4! = 1 × 2 × 3 × 4 = 24 Create an application that lets the user enter a nonnegative integer and then uses a loop to calculate the factorial of that number. Display the factorial in a label or a message box.
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
- Create a program that allows the user to take exam. The exam should have 10 questions (You can ask any questions). The questions are in multiple choice form and the choices are numbers. The program will display the questions one by one, and then the user can enter the correct number that corresponds to his answer. Every time the user answers question the program will check if it is correct, if the answer is correct the program will print "Correct!" otherwise it will display "Incorrect!" and the correct answer. Once the user is done with all the questions, the program will display the score and the equivalent percentage that the user got. For example: Who is the first president of the Philippines? 1. Emilio Aguinaldo 2. Joseph Estrada 3. Manuel Quezon Enter [1-4): 1 4. GMA Correct!arrow_forwardIn physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:KE = 1/2 mv2In the formula KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Create an application that allows the user to enter an object’s mass and velocity and then displays the object’s kinetic energy. The application should have a method named KineticEnergy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The method should return the amount of kinetic energy that the object has.arrow_forwardWrite a tkinter application that asks the user to create their own pizza. First, they should enter their name. Then, allow them to pick one of three crusts (thin, regular, deep dish), one of three sauces (Regular, BBQ, Alfredo), and any number of 3 toppings (Pepperoni, Olives, Mushroom). They should also pick if they want a small, medium, or large pizza. When the submit button is clicked, calculate the total cost ($10 base price, $0.50 for each topping, and $1.50 for each increase in size larger than small). Once the total is calculated, display a messagebox that thanks the user (by name) for their order and prints out the total cost.arrow_forward
- The Westfield Carpet Company has asked you to write an application that calculates theprice of carpeting for rectangular rooms. To calculate the price, you multiply the area of thefloor (width times length) by the price per square foot of carpet. For example, the area offloor that is 12 feet long and 10 feet wide is 120 square feet. To cover that floor with carpetthat costs $8 per square foot would cost $960. (12 3 10 3 8 5 960.)First, you should create a class named RoomDimension that has two fields: one for the lengthof the room and one for the width. The RoomDimension class should have a method thatreturns the area of the room. (The area of the room is the room’s length multiplied by theroom’s width.)Next you should create a RoomCarpet class that has a RoomDimension object as a field. Itshould also have a field for the cost of the carpet per square foot. The RoomCarpet classshould have a method that returns the total cost of the carpet.Figure 8-21 is a UML diagram that shows…arrow_forwardWrite a GUI program named TestsInteractiveGUI that allows a user to enter scores for five tests he has taken. Display the average of the test scores to two decimal places.arrow_forwardFor each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number of days for a resort stay. Then display the price per night and the total price. Nightly rates are $200 for one or two nights; $180 for three or four nights; $160 for five, six, or seven nights; and $145 for eight nights or more.arrow_forward
- Pig 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_forwardFor each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program named TestScoreList that accepts eight int values representing student test scores. Display each of the values along with a message that indicates how far it is from the average.arrow_forwardThe Freemont Automobile Factory has discovered that the longer a worker has been on the job, the more parts the worker can produce. Write an application that computes and displays a worker’s anticipated output each month for 24 months assuming the worker starts by producing 4,000 parts and increases production by 6 percent each month. Also display the month in which production exceeds 7,000 parts (when the worker deserves a raise!) as follows: The month in which production exceeds 7000.0 is month X. This is what i have but isnt right public class IncreasedProduction { publicstaticvoidmain (String[] args) { // final int month = 24; double parts =4000.0; double production =0.06; double raise =7000.0; int counter; System.out.println("The month in which production exceeds 7000.0 is month " + month); counter = 1; while(counter >= parts) { System.out.print(counter + " "); counter = counter + 1; } System.out.println(); } }arrow_forward
- Java Programming A bakery company provides a bonus of a new bakery product package for customers who buy at least 10 breads in the company anniversary award which will be celebrated in the next three months. To get the bonus, the customer is given the opportunity three times to guess a number determined by the application from numbers 1 to 20. For each guess number given by the customer, the application will respond as follows:• If the guessed number is smaller than the lucky number, you will see the words "Bigger Number"• If the guessed number is greater than the lucky number, you will see the words "Smaller Number"• If the guessed number is the same as a lucky number, it will match the words "Congratulations ... you found a LUCKY number"As part of the company's IT team, you serve to create a lucky number guessing game console.A. Determine the inputs and outputs of the design programb. Draw a Flowchart of the programc. Write Coding to make the applicationd. Give Screen shoot the…arrow_forwardScientists measure an object’s mass in kilograms and its weight in Newtons. If you know the amount of mass of an object, you can calculate its weight, in Newtons, with the following formula: Weight = Mass × 9.8Create an application that lets the user enter an object’s mass and then calculates its weight. If the object weighs more than 1000 Newtons, display a message indicating that it is too heavy. If the object weighs less than 10 Newtons, display a message indicating that it is too light.arrow_forwardCreate a lottery game application and name the program as LotteryGame.java. Generate three random numbers, each between 0 and 9. Allow the user to guess three numbers. Compare each of the user's guesses to the three random numbers and display a message that includes the user's guess, the randomly determined three digits, and the amount of money the user has won.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 - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY