What happens to the screen output when the following program widget runs?
Q: Add a label in the top left corner of the BounceBallControl.java program that shows the speed of the…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: How many times would you need to call the timeTick method on a newly created ClockDisplay object to…
A: You would have to call the timeTick() method 60 times to get it to 1:00. On the contrary, you can…
Q: Write a statement that creates a Frame widget. Its parent should be self.main_ window.
A: Given : Write a statement that creates a Frame widget. Its parent should be self.main_ window.
Q: When you create a widget object from a widget class, what should be the firstargument?
A: Solution: • The first argument of widget class is always parent container. • The parent container is…
Q: In Bootstrap what are the two ways you can display the code?
A: Introduction: Hypertext Markup Language is the abbreviation for HTML. Using HTML to generate a web…
Q: The gadget that generates hardcopy graphics is referred to as a "plotter" informally. why?
A: Plotter: A plotter is a printer that uses one or more automated pens to create line drawings on…
Q: How much quicker is computer A than computer Bat running the identical application in 10 seconds?
A: Computer A and Computer B runs in 10 seconds at the identical or same application. Because there is…
Q: What argument would you pass to a widget’s pack method to specify that it should be positioned as…
A: The pack method to position the widget at the left position The pack method will actually specifies…
Q: in this task you should create the figure below by using java language and when the box inside the…
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: Only using pygame and nested for loops how do you make a module that converts all pixels in an image…
A: from PIL import Image # Import an image from directory: input_image = Image.open("image.png")…
Q: What kind of object can be used to get text input in a graphics window?a) Text b) Entry c) Input d)…
A: Entry Object: The Entry object is used to accept the input value in the graphics window from the…
Q: How can the display window be made square?
A: As a kid i always wonder why didn't they create a windows other than being a rectangle. Like can it…
Q: Using the image module to write an image processing program that will do the following?
A: Algorithm: Split a given image into 2 parts using cv2 lib replace the red pixels with 0 on top…
Q: Write a Java Code for a simple GUI calculator application. The program should be able to handle…
A: A GUI - Graphical user interface of an application built using Java is made up of layers of…
Q: 2. Split the plotting window into four windows and place the plots you obtained in question-1 on…
A: According to the information given: We have to split the plotting windows into four windows and…
Q: Write a program to create the applet as shown below. The applet uses a paint method that draws steps…
A: code: import java.applet.Applet;import java.awt.*; public class NewApplet extends Applet {…
Q: Write a code in processing to Implement the below Snipper Target Icon(It covers…
A: <!DOCTYPE html><html class="en-us no-js " lang="en" prefix="og:…
Q: When it comes to the autolayout system, what is the most challenging part?
A: Auto Layout is a system of restriction-based layouts, It enables developers to build an adaptable…
Q: Write a program to draw a beautiful artboard
A: Actually, program is an executable software that runs on a computer.
Q: How do you create a window?
A: In Python, the Tkinter library needs to import into a program to create a window. Python code: #…
Q: Can a Java Layout Manager help you with your application? There are several methods to set up the…
A: What to do in this circumstance: We must assess the benefits of using a Java Layout Manager inside…
Q: Why does widget not show up in the sidebar?
A: Why widget not show in sidebar.
Q: How do you make a shape change color when the mouse is moved over it?
A: Answer: The color of the shape changes when the mouse is over it by using :hover selector in CSS.…
Q: Challenge: In the Sector Display program (Section 15.4.1), what would happen if the starting…
A: In the Sector Display program, the starting sector number should be passed to the selected drive to…
Q: What are the benefits of using a Java Layout Manager within an application? Note that there are…
A: We need to find the benefits of using a Java Layout Manager within the application and provide an…
Q: Draw this paint using java code...
A: House design with java Applets (Java Applet Program) Java applet is a java programming language that…
Q: using only pygame and nested for loops how do you make a module that gives an image a warm tone…
A: using only pygame and nested for loops how do you make a module that gives an image a warm tone…
Q: The following problems can be solved by writing commands in the command window.
A: Given:
Q: In python (in visual code) program a ball that bounces off all the edges of a window and changes…
A: This tutorial introduces you to VS Code as a Python environment, primarily how to edit, run, and…
Q: Create your own java games. Send screenshot of code and output.
A: Create your own java games. Send screenshot of code and output.
Q: I am trying to write a java program that will show me the GridLayout, FlowLayout, textfields,…
A: The answer is given below:-
Q: python code modify the cannonball animation so that the input dialog window stays on screen at all…
A: Projectile motion in Visual Python, The cannon fires when the mouse is clicked in the window.
Q: Write a JavaFX application that counts the number of times the mouse button has been clicked on the…
A: JavaFX is a software platform for making and conveying work area applications, as well as rich web…
Q: Suppose you would like an application that displays a green square inside a black circle. Write a…
A: Step 1: Declare a class that extends Applet. Step 2: Override the paint() method. Step 3: Invoke the…
Q: To change the length of an object (line or arc only), the command can be used- length move scale…
A: Scale is the command used in AutoCAD to enlarge or reduce the selected objects hence we should…
Q: write an introduction about a new product. assuming that the product is a scientific calculator with…
A: We need to introduce a new product, a scientific calculator.
whats the answer is it an error or zero? and why please!
Step by step
Solved in 2 steps
- int a = 20% 4; System.out.println ("a = " + a): display Oa = 4.5 Oa-4 Oa= 0 Oa=2Design the worst calculator ever: an application that accepts two numbers from the user and, when a button is pushed, performs a single operation and displays the results. You may choose: Multiplication, Division, Subtraction, square root, or raising the first number to the exponent of the second number. Don't use addition as we already did that in class. The result must be displayed to the user only when an appropriately labeled button is pushed.Add Fractions problem: create in a sandbox environment. Directions: In this program you will ask the user for 4 integers that represtent two fractions. First ask for the numerator of the first and then the denominator. Then ask for the numerator and denominator of the second. Your program should add the two fractions and print out the result. For example: a sample program run might look like this, Numerator One: 1 Denominator One: 2 Numerator Two: 2 Denominator Two: 5 The sum is 9/10 //remember if you have two fractions, the following formula should be used: a/b + c/d = (a*d +b*c) / b* d public class MyProgram { public static void main(String[] args) { //Ask the user for 4 numbers. (don't forget to import your Scanner class) //create your final numerator //create your final denominator //print out your result like the example above
- // This program assigns values to two variables // and performs mathematical operations with them public class DebugFour1 { publicstaticmain(Stringargs[]) { int x =5 int y =8; System.out.println("adding " + x + y); int z =19; System.out.println("subtracting " + z - y); System.out.println("dividing " + z / x); System.out.println("multiplying " + x / z); } }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…Starting with the following code, add a loop that will prompt the user for the number of math questions the user would like to be presented with: import randomfirstnum = random.randrange(1,11) # return an int from 1 to 10secondnum = random.randrange(1, 11)compsum = firstnum + secondnum # adds the 2 random numbers together# print (compsum) # print for troubleshootingprint("What is the sum of", firstnum, " +", secondnum, "?") # presents problem to useradded = int(input("Your answer is: ")) # gets user inputif added == compsum: # compares user input to real answer print("You are correct!!!")else: print ("Sorry, you are incorrect")
- Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average. An example of the program is shown below: Enter a score >> 6 Enter another score or 99 to quit >> 7 Enter another score or 99 to quit >> 9 Enter another score or 99 to quit >> 7 Enter another score or 99 to quit >> 99 4 valid scores were entered Highest was 9 Lowest was 6 Average was 7.25 PLEASE WRITE A JAVA CODE import java.util.*; public class QuizScoreStatistics { public static void main (String args[]) { // Write your code here } }A Java Practical Assignments.pdf - Adobe Acrobat Pro DC (32-bit) File Edit View E-Sign Window Help Home Tools Java Practical Assig. x Sign In 1 /1 139% Java Practical Assignments 1. Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value. Prompt the user for an input value and try the Math.sqrt() method on it. The application either displays the square root or catches the thrown Exception and displays an appropriate message. 2. Create a program that allows a user to input customer records (ID number, first name, last name, and balance owed) and save each record to a file. 3. Write an application for Limpopo's Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery check, or brake inspection. Allow the user to enter a string that corresponds to one of the options, and display the option and its price as R250, R220, R150, or R50, accordingly. Display an error message if the…This needs to be made in Javascript. Leap Year Detector: Design a program that asks the user to enter a year, then displays a message indicating whether the year is a leap year. (If the year is evenly divisible by 100 and is also evenly divisible by 400, then it is a leap year. For example, 2000 is a leap year, but 2100 is not. If the year is not evenly divisible by 100 but is divisible by 4, then it is a leap year. For example, 1996 is a leap year, 1997 is not. )
- Scissor, rock, paper Write a program called GameSRP.java that plays the popular scissor-rock-paper game where a scissor can cut paper, a rock kan nock a scissor and a paper can wrap a rock. The program asks the user for one of the options (1 for scissor, 2 for rock or 3 for paper) and then randomly picks one of them for the computer. It then presents if you or the computer won, or if it was a draw. If the user enters 0 the program will end and display the total score (number of wins for you and the computer and the draws). Here is a sample run: Scissor (1), rock (2), paper (3) or 0 to quit: 1 You lost, computer had rock! Scissor (1), rock (2), paper (3) or 0 to quit: 2 It's a draw! Scissor (1), rock (2), paper (3) or 0 to quit: 3 You won, computer had rock! Scissor (1), rock (2), paper (3) or 0 to quit: 1 You lost, computer had rock! Scissor (1), rock (2), paper (3) or 0 to quit: 2 It's a draw! Scissor (1), rock (2), paper (3) or 0 to quit: 3 You won, computer had rock! Scissor (1),…Write a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over.Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.Java code you will create a simple console-based game (user vs. computer) using selection and repetition structures and random numbers. The game is named SPIN. Here is the UI for the game: Welcome to SPIN - a game of chance!You are given $500 to start the game.Every time you spin the wheel you have a chance of:S - Splitting your money in half.P - Plunging to zero. (You lose.)I - Increasing your money to double.N - Never needing money again! (You win!)You may quit at any time and go home with your current winnings.Current winnings = $500 - SPIN? (Y/N) ySPINNING . . .S - winnings will be split in halfCurrent winnings = $250 - SPIN again? (Y/N) ySPINNING . . .I - winnings will be increased by doubling you current winningsCurrent winnings = $500 - SPIN again? (Y/N) ySPINNING . . .I - winnings will be increased by doubling you current winningsCurrent winnings = $1000 - SPIN again? (Y/N) ySPINNING . . .I - winnings will be increased by doubling you current winningsCurrent winnings = $2000 -…