Java language Create a class called My Input Info that implements Comparable for type MyInput Info. The MyInput Info class should be able to store information on whether keyboard input was a numerical value or a symbol. Furthermore the class should store which key was pressed. The compareTo method should sort first by input type with numerical inputs appearing before symbol inputs and second by input value using either the numerical values or the ASCII values of the keys. Additionally override the toString method to print "Numeric" followed by the number or "Key" followed by the character on the key. For example "Numeric 1" or "Numeric 3.14" or "Symbol a":

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Java language

Create a class called My Input Info that implements Comparable for type MyInput Info.

The MyInput Info class should be able to store information on whether keyboard input was a numerical value or a symbol. Furthermore the class should store which key was pressed. The compareTo method should sort first by input type with numerical inputs appearing before symbol inputs and second by input value using either the numerical values or the ASCII values of the keys.

Additionally override the toString method to print "Numeric" followed by the number or "Key" followed by the character on the key. For example "Numeric 1" or "Numeric 3.14" or "Symbol a":

Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Reference Types in Function
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning