answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
givi [52]
1 year ago
11

The user interface contains two types of user input controls: TextInput, which accepts all characters and Numeric Input, which a

ccepts only digits.
1. Implement the class TextInput that contains:
O Public method def add(c : Char) - concatenates the given character to the current value
O Public method def getValue(): String - returns the current value
Implement the class NumericInput that:
O Inherits from TextInput
O Overrides the add method so that each non-numeric character is ignored
For example, the following code should output "10":
$input = new NumericInput();
$input->add('1');
$input->add('a');
$input->add('0');
echo $input->getValue();
The code skeleton is provided below:
<?php
class TextInput
{
}
class Numericinput
{
{
//$input = new NumericInput();
//$input->add('1');
//$input->add('a');
//$input->add('0');
//echo $input->getValue();
Computers and Technology
1 answer:
Shtirlitz [24]1 year ago
4 0

Answer:

Explanation:

public class Main

{

private static String val; //current val

public static class TextInput

{

public TextInput()

{

val= new String();

}

public void add(char c)

{

if(val.length()==0)

{

val=Character.toString(c);

}

else

{

val=val+c;

}

}

public String getvalue()

{

return val;

}

}

public static class NumericInput extends TextInput

{

Override

public void add(char c)

{

if(Character.isDigit(c))

{

//if character is numeric

if(val.length()==0)

{

val=Character.toString(c);

}

else

{

val=val+c;

}

}

}

}

public static void main(String[] args)

{

TextInput input = new NumericInput();

input.add('1');

input.add('a');

input.add('0');

System.out.println(input.getvalue());

}

}

You might be interested in
1. Accessing calendars, contact information, emails, files and folders, instant messages, presentation, and task lists over the
Veseljchak [2.6K]
1. Cloud Computing
2. Web Conferencing
3. Ribbon
4. PowerPoint
5. Sadie should share the document in One Drive and give her sister permission to edit the document
6. The design and arrangement of items for efficiency and safety
6 0
1 year ago
Drag each tile to the correct box.
Likurg_2 [28]
Learning
planning
designing
developing
testing delivering
4 0
1 year ago
Please help!! Caleb is working on a simple logic-based program to simulate a game of tic-tac-toe. Which programming language wou
irga5000 [103]

Basic language should do it

4 0
2 years ago
Generating a signature with RSA alone on a long message would be too slow (presumably using cipher block chaining). Suppose we c
boyakko [2]

Answer:

Following are the algorithm to this question:

Explanation:

In the RSA algorithm can be defined as follows:  

In this algorithm, we select two separate prime numbers that are the "P and Q", To protection purposes, both p and q combines are supposed to become dynamically chosen but must be similar in scale but 'unique in length' so render it easier to influence. Its value can be found by the main analysis effectively.  

Computing N = PQ.  

In this, N can be used for key pair, that is public and private together as the unit and the Length was its key length, normally is spoken bits. Measure,

\lambda (N) = \ lcm( \lambda  (P), \lambda (Q)) = \ lcm(P- 1, Q - 1)  where \lambda is the total function of Carmichaels. It is a privately held value. Selecting the integer E to be relatively prime from 1and gcd(E,  \lambda (N) ) = 1; that is E \ \ and  \ \ \lambda (N).  D was its complex number equivalent to E (modulo \lambda (N) ); that is d was its design multiplicative equivalent of E-1.  

It's more evident as a fix for d provided of DE ≡ 1 (modulo \lambda (N) ).E with an automatic warning latitude or little mass of bigging contribute most frequently to 216 + 1 = 65,537 more qualified encrypted data.

In some situations it's was shown that far lower E values (such as 3) are less stable.  

E is eligible as a supporter of the public key.  

D is retained as the personal supporter of its key.  

Its digital signature was its module N and the assistance for the community (or authentication). Its secret key includes that modulus N and coded (or decoding) sponsor D, that must be kept private. P, Q, and \lambda (N) will also be confined as they can be used in measuring D. The Euler totient operates \varphi (N) = (P-1)(Q - 1) however, could even, as mentioned throughout the initial RSA paper, have been used to compute the private exponent D rather than λ(N).

It applies because \varphi (N), which can always be split into  \lambda (N), and thus any D satisfying DE ≡ 1, it can also satisfy (mod  \lambda (N)). It works because \varphi (N), will always be divided by \varphi (N),. That d issue, in this case, measurement provides a result which is larger than necessary (i.e. D >   \lambda (N) ) for time - to - time). Many RSA frameworks assume notation are generated either by methodology, however, some concepts like fips, 186-4, may demand that D<   \lambda (N). if they use a private follower D, rather than by streamlined decoding method mostly based on a china rest theorem. Every sensitive "over-sized" exponential which does not cooperate may always be reduced to a shorter corresponding exponential by modulo  \lambda (N).

As there are common threads (P− 1) and (Q – 1) which are present throughout the N-1 = PQ-1 = (P -1)(Q - 1)+ (P-1) + (Q- 1)), it's also possible, if there are any, for all the common factors (P -1) \ \ \ and \ \ (Q - 1)to become very small, if necessary.  

Indication: Its original writers of RSA articles conduct their main age range by choosing E as a modular D-reverse (module \varphi (N)) multiplying. Because a low value (e.g. 65,537) is beneficial for E to improve the testing purpose, existing RSA implementation, such as PKCS#1, rather use E and compute D.

8 0
1 year ago
How do many corporations most likely manage the health and safety of their employees and the workplace?
s344n2d4d5 [400]

Answer:

The answer to this question is given below in the explanation section. However the correct option is only by following OSHA's rules and regulation.

Explanation:

Corporations most likely manage the health and safety of their emoployees and workplace only by following the OSHA's rules and regulations.

Because this is standard law that requires employers to provide their employees with working conditions that are free of known dangers. The OSH Act created the Occupational Safety and Health Administration (OSHA), which sets and enforces protective workplace safety and health standards for employees.

However, other options are not correct because these options do not cover the employees' protective workplace safety and health.

4 0
1 year ago
Other questions:
  • Computer hardware without software is useless while computer software without hardware is meaningless. Discuss. Plz provide exam
    15·1 answer
  • One of the most toxic components of a computer is the
    11·1 answer
  • What company built its first computer from a wooden box
    12·2 answers
  • Robert needs to apply formatting from one set of text to multiple other sets of text throughout the document. Which option shoul
    7·1 answer
  • Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method. public cla
    14·1 answer
  • Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
    6·1 answer
  • While adding voices to an animation, what kind of room should you choose?
    11·1 answer
  • Sam’s password is known to be formed of 3 decimal digits (0-9) in a given order. Karren and Larry are attempting to determine Sa
    9·2 answers
  • An online retailer is looking to implement an enterprise platform. Which component of the enterprise platform will help the comp
    8·1 answer
  • An aviation tracking system maintains flight records for equipment and personnel. The system is a critical command and control s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!