Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this question, students should work with the drawing text on the canvas. The code will ask for a number and the code should be

In this question, students should work with the drawing text on the canvas. The code will ask for a number and the code should be able to detect the type of the entered number; either it is an integer or float or even if it is not a number. Also, they need to know about input command and get string from users with input command. In order to do so, the library below should be imported at the beginning of the code: import javax.swing.JOptionPane;

The code should be written in a way that when it is run, if user presses button n on the keyboard, an input box like below appears on the screen.

image text in transcribed

In the box above if user for example enters 3, the code should write the number of the type of that on the canvas like below:

image text in transcribed

The position of the strings on the canvas is optional and it should be selected in a way that it is readable.

Hint: In order to detect float numbers, look for character . In the entered string

Please use processing to answer the question.

Input X ? Enter a number: OK Cancel A3.02 Number: 3 Type: int

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

2. Why has the conflict escalated?

Answered: 1 week ago