1answer.
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]
3 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]3 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
A packet analyzer is a program that can enable a hacker to do all of the following EXCEPT ________. Select one: A. assume your i
bonufazy [111]

Answer:

Option (B) is the correct answer of this question.

Explanation:

Packet analyzer is a software application or set of infrastructure capable of unencrypted and recording communication that travels through a virtual system of a computer system.A packet analyzer used to detect network activity is recognized as a broadband monitoring system.

A packet analyzer is a code application that is used for monitoring, intercepting, and recording http requests with the help of a virtual interface.

Other options are incorrect because they are not related to the given scenario.

8 0
4 years ago
What is the last step in conducting a URL search
Feliz [49]
The request goes through a router or the modem to the user's ISP. 

6 0
3 years ago
Read 2 more answers
Holly needs to create an online survey to find out what people want and is
Dahasolnce [82]

Answer:

The correct answer is (A).The server application will allow the customers to select their  answers on the survey.

Explanation:

Since Holly needs to design an online survey which is a web based application, in finding out what people need or want, In this process, the role or function of the server is to enable customers to select their own choice of answers on the survey that will be created online.

4 0
4 years ago
Which ones are right
Tpy6a [65]
The first one is the best one
5 0
4 years ago
You are asked to assume the role of an employee of the DigiFirm Investigation Company. As part of its community outreach effort,
kirill [66]

Answer:

1.  To trace an email we need to examine the header part of the email. By examine the header of an email we could extract the sender, subject and other important credentials related to that email.  

2. The command to trace the email id is “whois” command.

 First open the email client and find the IP address of the received email that need to be traced.  The command “whois” IP address gives the registration information of that IP address.

 3.  Reverse address/email search is the procedure used by the experts to find the origin or the ownership of the email.  Rather than tools websites are more use full in the reverse address search.

http://reverse.addresssearch.com, www.iplocation.net, etc. are good to find the ownership of an email.

4. We need to set up mail server to send, receive and to explore various activities associated with an email.  The other related purpose servers like SMTP server, HTTP server , etc are also required to assist large organizations.  The mail server can be a stand-alone computer or a collection of computer and servers.

 5.  The executable files should be examined thoroughly in the server, it can be dangerous malwares.  The examination is mainly done by scanning for malicious words and sender address.  Since many mail providers does not allow executable files to send, so the attackers are using other files also as a carrier of the malwares, so now every emails should be subject to deep examination using some malware scanner.  

6.   By the time of examination the some of the legitimate mails may also come under the suspect list so further check is needed there.  At the same time the attacks can be from legitimate sources also this could be go un-noticed; this should be also a challenge to face in the stage of e-mail examination.

8 0
3 years ago
Other questions:
  • Think about your favorite technology item - phone, game, smartTV, etc. - Write about how your favorite technology item has impac
    7·1 answer
  • To illustrate a point in a Word document with a simple chart, what commands should you select?
    8·2 answers
  • A network with 10 bits remaining for the host portion will have how many usable host addresses?
    11·1 answer
  • Why does Linux make use of tasklets (i.e., software interrupts) instead of executing all interrupt-related activity in the (hard
    11·1 answer
  • How to add running head and page number in word?
    5·1 answer
  • When you use the tilde operator (~ in a url for the attribute of a server control, it represents the _____ directory of the webs
    5·1 answer
  • PLEASE HELP 98 POINTS!!!!!!!!!!!!!!!!!!
    12·2 answers
  • 60 points!
    14·2 answers
  • Question 1 of 10
    13·1 answer
  • WILL GIVE BRAINLIEST!! NO LINKS!!!
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!