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
You have been given an encrypted copy of the Final exam study guide here, but how do you decrypt and read it???
Agata [3.3K]

Answer:

You use a decoder

Explanation:

You can find one on an internet browser

7 0
3 years ago
What the official coding language of batch files?
solniwko [45]
Shell's language. that's why it is called shell script
5 0
3 years ago
Read 2 more answers
write a program to evaluate the following postfix expression. the value of each variable must be asked from the user during the
ikadub [295]

In this exercise we have to use the knowledge of computational language in C++ to write a code that program to evaluate the following postfix expression. the value of each variable must be asked from the user during the execution time.

<h3>Writting the code:</h3>

<em>#include <bits/stdc++.h></em>

<em>using namespace std;</em>

<em>// CREATED A </em><em>CLASS </em><em>STACK</em>

<em>class Stack</em>

<em>{</em>

<em>public:</em>

<em> int top;</em>

<em> unsigned sz;</em>

<em> int* ar;</em>

<em>};</em>

<em>// VARIOUS STACK </em><em>FUNCTIONS</em>

<em>Stack* makeStack( unsigned sz )</em>

<em>{</em>

<em> Stack* stack = new Stack();</em>

<em> // BASE </em><em>CONDITION</em>

<em> if (!stack) return NULL;</em>

<em> stack->top = -1;</em>

<em> stack->sz = sz;</em>

<em> stack->ar = new int[(stack->sz * sizeof(int))];</em>

<em> if (!stack->ar) return NULL;</em>

<em> // RETURNING THE STACK</em>

<em> return stack;</em>

<em>}</em>

<em>// CHECKING IF THE STACK IS </em><em>EMPTY</em>

<em>int isEmpty(Stack* stack)</em>

<em>{</em>

<em> return stack->top == -1 ;</em>

<em>}</em>

<em>// CHECKING THE TOP OF THE STACK</em>

<em>int whatAtTop(Stack* stack)</em>

<em>{</em>

<em> return stack->ar[stack->top];</em>

<em>}</em>

<em>// </em><em>POPPING </em><em>OUT OF A STACK</em>

<em>int pop(Stack* stack)</em>

<em>{</em>

<em> if (!isEmpty(stack))</em>

<em>  return stack->ar[stack->top--] ;</em>

<em> return '$';</em>

<em>}</em>

<em>// PUSHING IN THE STACK</em>

<em>void push(Stack* stack, int op)</em>

<em>{</em>

<em> stack->ar[++stack->top] = op;</em>

<em>}</em>

<em>// EVALUATING </em><em>POSTFIX </em><em>STARTS HERE</em>

<em>int postfixEvaluator(string res)</em>

<em>{</em>

<em> // CREATING STACK</em>

<em> Stack* stack = makeStack(res.length());</em>

<em> int i;</em>

<em> // BASE </em><em>CONDITION</em>

<em> if (!stack) return -1;</em>

<em> for (i = 0; res[i]; ++i)</em>

<em> {</em>

<em>  // CHECK FOR SPACES</em>

<em>  if (res[i] == ' ')continue;</em>

<em>  // CHECK FOR THE DIGIT</em>

<em>  else if (isdigit(res[i]))</em>

<em>  {</em>

<em>   int N = 0;</em>

<em>   // EXTRACT THE </em><em>NUMBER </em><em>OUT OF STACK</em>

<em>   while (isdigit(res[i]))</em>

<em>   {</em>

<em>    N = N * 10 + (int)(res[i] - '0');</em>

<em>    i++;</em>

<em>   }</em>

<em>   i--;</em>

<em>   // </em><em>PUSH </em><em>THE NUMBER IN STACK</em>

<em>   push(stack, N);</em>

<em>  }</em>

<em>  // POPPING AND </em><em>ARITHMETIC </em><em>OPERATIONS</em>

<em>  else</em>

<em>  {</em>

<em>   int pos1 = pop(stack);</em>

<em>   int pos2 = pop(stack);</em>

<em>   switch (res[i])</em>

<em>   {</em>

<em>   case '+': push(stack, pos2 + pos1); break;</em>

<em>   case '-': push(stack, pos2 - pos1); break;</em>

<em>   case '*': push(stack, pos2 * pos1); break;</em>

<em>   case '/': push(stack, pos2 / pos1); break;</em>

<em>   }</em>

<em>  }</em>

<em> }</em>

<em> return pop(stack);</em>

<em>}</em>

<em>// MAIN CODE</em>

<em>int main()</em>

<em>{</em>

<em> string tes;</em>

<em> getline(cin, tes);</em>

<em> string tmp = "";</em>

<em> string res = "";</em>

<em> for (int i = 0; i < tes.length(); i++) {</em>

<em>  if (tes[i] <= 'z' and tes[i] >= 'a') {</em>

<em>   tmp += tes[i];</em>

<em>  } else if (tes[i] == ' ' and (tes[i - 1] <= 'z' and tes[i - 1] >= 'a')) {</em>

<em>   cout << "Enter the value of " << tmp << ": ";</em>

<em>   int x; cin >> x;</em>

<em>   res += (to_string(x));</em>

<em>   res += ' ';</em>

<em>   tmp = "";</em>

<em>  } else {</em>

<em>   res += tes[i];</em>

<em>  }</em>

<em> }</em>

<em> cout << "\nThe postfix expression is : " << res;</em>

<em> cout << "\nThe result is : " << postfixEvaluator(res);</em>

<em> return 0;</em>

<em>}</em>

See more about C++ at brainly.com/question/19705654

#SPJ1

8 0
1 year ago
describe the six clauses in the syntax of an sql retrieval query. show what type of constructs can be specified in each of the s
maw [93]

Answer:

Answered below

Explanation:

An SQL retrieval query is made up of up to six clauses that must be coded in a specific sequence and they consist of;

1) SELECT - This clause allows you list the columns you want.

2) FROM - This clause indicates the tables you are retrieving information from.

3) WHERE - The where clause indicates a condition.

4) GROUP BY - Let's you group your data into specific and more meaningful information.

5) HAVING - Puts a condition in your group.

6) ORDER BY - Orders your result rows in ascending or descending order.

5 0
3 years ago
Assignment: In this project, you’ll create a security infrastructure design document for a fictional organization. The security
a_sh-v [17]

The authentication can be done by using user id and password, social sign-in or by using the biometrics.  

<h3>How to explain the information?</h3>

Authentication works as follows:  

  • Prompting the user to enter the credentials.  
  • Send credentials to the authentication server.  
  • Match the credentials.  
  • Authorize the user and grants the acces

<u>External Website security:  </u>

  • Use of firewall.  
  • Implement the access control.  
  • Use of MVC (Model View Controller)
  • Use of encryption.  
  • Use of SSL certificate.
  • Use of security plugins.  
  • Use of network monitoring team.  

<u>Internal Website security:  </u>

  • Use of authentication to identify the user identity.  
  • Use of authorization to provide different user with the specific privileges and access.  
  • Encrypt or hide sensitive web pages.  
  • By implementing IT policies.  
  • Educate the user about the website.  

<u>Remote Access Solution</u>:  

Remote access provides better security, cost efficiency, ease of management, and increased availability.  

Remote access can be deployed by using the RAS gateway.  

<u>Firewall and Basic rules recommendations</u>:  

  • Firewall is important for managing the traffic and providing external website security.  
  • Rules to prevent SQL injection and XSS.  
  • Allow only the specific type of traffic.  
  • Use access rules for IP security.  
  • Implement certain IT policies.  

<u>Wireless Security:  </u>

Wifi is being used in every organization and it prevents the network from malicious access.  

Wireless security can be provided by usin encryption, decryption, and authorization.  

<u>VLAN configuration:  </u>

VLAN are important for traffic filtering and providing the logical division of the network.  

VLAN can be configured for web interface and can provide web filtering.  

VLAN can be configured between router and firewall that passes the network.  

<u>Laptop Security Configuration:  </u>

Use of password, VPN and the registering the laptop will provide laptop security. .  

<u>Application policy recommendations</u>:  

Application policy includes integration, use of cookies access control, and implanting other organization and IT rules.  

<u>Security and privacy policy recommendations:  </u>

It includes listin of security methods to be implemented for traffic filtering, user authentication and other specific policy for the website.  

<u>Intrusion detection or prevention for systems containing customer data:  </u>

IPS is implemented behind firewall and it matches the incoming traffic against the security policies.

Learn more about security infrastructure on:

brainly.com/question/5939963

#SPJ1

7 0
1 year ago
Other questions:
  • Which of the following tools enables users to connect to a remote computer, including servers with no interaction required from
    10·1 answer
  • What can be done to improve the security of business uses of the Internet? Give several examples of ecurity measures and technol
    9·1 answer
  • What will the following loop display? 0 1 2 3 4 5 0 1 2 3 4 0 1 2 3 4 The loop will display numbers starting at 0, for infinity.
    8·1 answer
  • What is logical memory?
    15·1 answer
  • Which of the following sentences uses correct punctuation? A. I am a good communicator, and I am a strong team member. B. I comm
    12·2 answers
  • You are trying to troubleshoot a desktop power supply issue using a voltmeter. Which of the following options are the MOST commo
    6·1 answer
  • Q13. On which option do you click to
    12·1 answer
  • If the audio has no sound:
    8·1 answer
  • What is the best data type for traveling day?
    12·1 answer
  • a central issue in the microsoft antitrust lawsuit involved microsoft's integration of its internet browser into its windows ope
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!