Write a program that uses JOptionPane to display a window that asks for a number and then when you click ok, it displays the square of that number.
Q: Write a program that asks the user to enter a 1st color choice from a set of options: red, yellow or…
A: In this program we have to enter a 1st color choice from a set of options: red, yellow or blue,…
Q: s shown in the Figure. (Hint: A point is in the rectangle if its horizontal distance to (0, 0) is…
A: Analysis of the problem: There is a rectangle with vertices a,b,c,d(let). The position of the…
Q: Write a program that displays ten balls with random colors and placed at random locations, at shown…
A: Program Plan: • Create a python file with name 9_26PE.PY. In the file, • Import all definitions from…
Q: Use Python to write a program that asks the user to enter a pocket number and displays whether the…
A: We can use relational operators or range function to check the number whether in range or not So,…
Q: p with JavaFX barchart: I have a program that allows a user to deposit and withdraw money while…
A: Step 1: Open NetBeans IDE. Click File and select New Project. Click JavaFX and select JavaFX…
Q: Write a program that displays twocircles with radius 10 at location (40, 40) and (120, 150) with a…
A: Program: import javafx.application.*;import javafx.scene.*;import javafx.scene.layout.*;import…
Q: Write a program that prompts the user to enter a point (x, y) and checks whether the point is within…
A: Step 1:- Program Approach:- 1.import turtle 2.Take the value of x and y from the user 3.Use the…
Q: using paintComponent(Graphics g) Write a program in java that, for four points A, B, C and P, •…
A: Explanation: Inside the findDistance method, find the distance by using the following formula:…
Q: ou will write a menu-driven program that draws the coordinate system and some geometric shapes on…
A: void line(){ printf("\n Line formula is y = ax+b "); printf("\n Please enter the coefficients…
Q: Write a program that prompts the user to enter the radius of the rings and draws an Olympic symbol…
A: Define module turtle. Define object for turtle as p. Define thickness of then pen p as 6. Define…
Q: Write a program that prompts the user to input the height and the radius of the base of a cylinder,…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a program to design a graphical user Interface for Your coffee shop or restaurant or any…
A: Actually, java is a object oriented programming language.
Q: Write a program that displays an inchworm on the left-hand side of the screen, facing right. Then…
A: According to the information given:- We have to display inchworm on the left side of the screen…
Q: Write a program that lets the user play the slot machine…
A: Program in C: /* Code for a Slot Machine Controller*/#include <stdio.h>#include…
Q: Write a program that prompts the user to enter the radius and draws four circles in the center of…
A: PROGRAM CODE: import turtle radius = eval(input("Enter the radius of circle: ")) turtle.penup()…
Q: Write a program that creates two rectangular shapes and then animates them. The two shapes should…
A: Write a program that creates two rectangular shapes and then animates them. The two shapes should…
Q: IN PYTHON ONLY: Write a program that uses radio buttons to select background colors for text, as…
A: #Python Radiobutton using Application
Q: One interesting application of computers is drawing graphs and bar charts (sometimes called…
A: Given Data:- One interesting application of computers is drawing graphs and bar charts (sometimes…
Q: For the following values, explain whether we can efficiently get the value from a default (standard)…
A: An inverted index is an index data structure storing a mapping from content, such as words or…
Q: Write a program that prompts the user to enter apoint (x, y) and checks whether the point is within…
A: Program Approach: Importing necessary packages to get standard input and output. Defining a class…
Q: Write an application with three slider panel at the center of the frame. Eac- blue parts of a color.…
A: <!DOCTYPE html> <html> <head> <title>Frame tag</title>…
Q: You are a Chemistry major who has to create a program for first time chemistry lab users. The…
A: Check the code below.
Q: Write a program that generates a random number in the range of 1 through 1000, and asks the user to…
A: Inside the check_guess function with parameter random_number and user_guess :If user guess is less…
Q: Write a program that compares the area of two rectangles. You can do this several ways, one way is…
A: The program is written in Python. Please find the program in step 2.
Q: In the Java programming language, write a program that opens a 400x200 window with two 200x200…
A: The JAVA code is given below with output screenshot
Q: Write a program that works as following: Display Label with text “0” on (0,0) in JFrame Class. If…
A: JAVA Program import java.awt.EventQueue;import javax.swing.JFrame;import javax.swing.JLabel;import…
Q: Write a program that asks the user to enter five colors. Once the user has entered the colors, your…
A: 1) Since you have not specified programming language, I have written program in python. 2) Below is…
Q: Write an application to pre-sell a limited number of cinema tickets. Each buyer can buy as many as 4…
A: Create a java program to pre-sell the cinema ticket.The name of the program is TicketSeller.The…
Q: The Yukon Widget Company manufactures widgets that weigh 9.2 pounds each. Write a program that…
A: Lets see the solution.
Q: Write a program that plays "guess the number" game as follows: Your program chooses the number to be…
A: Answer
Write a program that uses JOptionPane to display a window that asks for a number and then when you click ok, it displays the square of that number.
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- The Yukon Widget Company manufactures widgets that weigh 9.2 pounds each. Write a program that calculates how many widgets are stacked on a pallet, based on the total weight of the pallet. The program should ask the user how much the pallet weighs by itself and with the widgets stacked on it. It should then calculate and display the number of widgets stacked on the pallet.Write an application with three sliders horizontally placed at the bottom of a frame, and a display panel at the center of the frame. Each slider represents a value from 0 to 255 for the red, green, blue parts of a color. This number is shown beside the slide. When the user changes the values in the sliders, the background of the display panel is changed to the corresponding color. The output of your program should have the following layout: Slider for Colors Red Green Blue 122 57 147In the Java programming language, write a program that opens a 400x200 window with two 200x200 buttons. One button says "Close" - which closes the program, and on the other the number "16". Each time you press this button, the number is halved until 1. When 1 is reached the button does not change anymore.
- Write a program that displays a random coordinate in a rectangle. The rectangle is centered at (0, 0) with width 100 and height 200.Write a program named BigLetter that displays a large letter composed Of smaller letters. For example, if you choose H, then the output should look similar to the image shown in Figure 1-20.Write a program that displays a random coordinate in a rectangle.The rectangle is centred at (0, 0) with width 50 and height 150.
- One interesting application of computers is drawing graphs and bar charts (sometimes called histograms). Write a script that reads five numbers between 1 and 30. For each number read, output HTML5 text that displays a line containing the same number of adjacent asterisks. For ex- ample, if your program reads the number 7, it should output HTML5 text that displays *******.Write a program that displays twocircles with radius 10 at location (40, 40) and (120, 150) with a line connectingthe two circles, as shown in Figure . The distance between the circlesis displayed along the line. The user can drag a circle. When that happens, thecircle and its line are moved, and the distance between the circles is updated.java Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4) is outside the rectangle, as shown in the Figure. (Hint: A point is in the rectangle if its horizontal distance to (0, 0) is less than or equal to 10 / 2 and its vertical distance to (0, 0) is less than or equal to 5 / 2.) Here are sample runs of the program: Sample 1: Enter a point with two coordinates: 2 2 Point (2.0, 2.0) is in the rectangle Sample 2: Enter a point with two coordinates: 6 4 Point (6.0, 4.0) is not in the rectangle Analysis: (Describe the problem including input and output in your own words.) Design: (Describe the major steps for solving the problem.) Coding: (Go over your code step by step) Testing: (Describe how you test this program). In other words run your code with sample outputs.
- Write a program that compares the area of two rectangles. You can do this several ways, one way is to add the length and width of each rectangle to get it's area and then compare the two areas together. The program should ask for the length and width of two rectangles and then tell the user which rectangle has the greater area, or if the areas are the same. The area of a rectangle is the rectangle's length times its width. Name the source code file yourName_HW4.py. Test and run the program. Capture the output console and save it as an image file namedWrite a program that generates a random number in the range of 1 through 1000, and asks the user to guess what the number is. If the user guess is higher than the random number, the program should display Too high, try again. If the users 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 generate a new random number so the game can start over. If the user doesn't want to continue the game the user should type an appropriate stop symbol to terminate the program (such stop conditions were discussed in the class). For each game iteration, count the number of guesses made by the user and display them. The program should contain the following functions: check_guess(): this function checks if the user's guess is lower, higher or equal to the random number. random_gen(): function that generates one random number for one game iteration main(): the function where the program…You will write a menu-driven program that draws the coordinate systemand some geometric shapes on the console screen.The program will ask the user to choose one of the following shapes:1. Line2. Parabola3. CircleIf the user chooses to draw a line, the program asks for the coefficients a and b that define theline on the coordinate system: y = ax + bSimilarly, for the parabola, the program asks for the coefficients a, b, c to define the parabola:y = ax2 + bx + cFinally, for the circle, the program asks for the radius (r) and center (a,b) to define it:(x - a)2 + (y - b)2 = r2After getting required parameters, the program draws the coordinate system on the consolescreen using – and | characters, and draws the geometric shape using * character.Both x and y values in the coordinate system should range at least in [-10,10]. You may draw abigger coordinate system as it will look clearer. However, make sure that your coordinatesystem fits in the console screen.Use C language.
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)