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]
2 years 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]2 years 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
​<br><br> Access from and output to the register is slow true false​
Nataly_w [17]

Answer:

false

Explanation:

it depends most of time so false

4 0
2 years ago
2. Because technology is always changing, there are new applications being developed constantly. (1 point)
Zepler [3.9K]
True because we need new tech
4 0
2 years ago
Read 2 more answers
Give the logical function for the following: If cell B7 equals 12, check contents of cell B10. If cell B10 is 10, then the value
ASHA 777 [7]

Answer:

=IF( B7 = 12, ( IF( B10 = 10,"YES", "")), 7) and PRESS ENTER

Explanation:

the above logical if function checks the following

-IF cell B7 is 12, if true, check the value of cell B10, IF cell B10 contains 10 the function should produce YES as output to whatever cell selected, IF B10 is not 10 output of the function should be an empty string, IF B7 is not equal to 12 the the output of the function should be 7.

5 0
2 years ago
A hidden backlog contains the projects that the IT department is not aware of because of low feasibility.
Finger [1]

Answer: True

Explanation:

Yes, the given statement is true that the due to the very low feasibility the IT (Information technology) department are not aware of the hidden backlog that basically contain projects.

The feasibility is the main factor in the IT department as it helps to study whole objective of the project and then also uncover all the strength and weakness of the project so that we can easily go through the details to make the project more efficient and reliable.

8 0
2 years ago
Write a loop that prints each country's population in country_pop. Sample output for the given program.
Illusion [34]

Answer:

Correct code for the above question which is written after the defined list to display the output.

for x,y in country_pop.items(): #for  loop to prints the list items.

   print(str(x)+" has "+str(y)+" people") #print function to print the value.

Output:

  • The above code is in python language which display the output as the above question demands.

Explanation:

  • The above question code is written in python language to display the result, but this code is not correct.
  • The above code needs a 'for' loop, which will render the list item one by one.
  • The above-list defined in the form of key-value pair, So there is a need for the ''item" function which is the part of the python dictionary to display the list items.
  • There also needs to define the two variables in the for loop, one is for key and the other is for value.
7 0
2 years ago
Other questions:
  • When excel follows the order of operations the formula 8 * 3 + 2 equals?
    11·1 answer
  • Write a method named quarterstodollars. the method should accept an int argument that is a number of quarters, and return the eq
    13·2 answers
  • Nick won a $1,000 lottery prize. He can't decide what he should spend the money on. For some time now, he has been planning to b
    5·1 answer
  • The ________ method is based on simple arithmetic. The process involves dividing the bits of a frame into equal segments, adding
    11·1 answer
  • In the process of retrieving a specific memory from a web of associations a person needs to activate one of the strands that lea
    15·1 answer
  • while investigating the settings on your SOHO router, you find two IP address reported on the devices's routing table, which is
    5·1 answer
  • Information in​ folders, messages,​ memos, proposals,​ emails, graphics, electronic slide​ presentations, and even videos create
    7·1 answer
  • For his class project, Matt has to create an image in a color scheme that has shade or tint variations of the same hue. Which co
    7·1 answer
  • A Security team is working with a client to evaluate the security of data and IT functions that are most critical to the operati
    13·1 answer
  • Consider the following code segment, which is intended to create and initialize the two-dimensional (2D) integer array num so th
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!