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
katrin [286]
2 years ago
3

Add a String instance variable, messageUponExiting, to the Window class. This variable will be used to display a message when th

e user closes the window (for example, "Are you sure you want to quit?"). Furthermore, this variable should be accessible to all subclasses of the Window class, as each sort of window may require a different message upon exiting. Please provide the declaration of the instance variable only—nothing else.
Computers and Technology
1 answer:
skad [1K]2 years ago
4 0

Answer:

Following are the Declaration of instance variable which is mention above .

protected String messageUponExiting; // variable declaration

Explanation:

Here we declared a variable "messageUponExiting "  as string type.The String datatype parameter will hold the string value .We can use Protected access modifier because as mention in the question the variable must be accessible  in all of the subclass of windows.

Syntax of declaring any instance variable .

Access-modifier datatype variable-name;

You might be interested in
What is ODBC? How is it related to SQL/CLI? 10.2. What is JDBC? Is it an example of embedded SQL or of using function calls? 10.
tamaranim1 [39]

Answer:hhhhhhhhh

Explanation:

5 0
2 years ago
An Internet user has a need to send private data to another user. Which of the following provides the most security when transmi
vazorg [7]

Answer:

C. Sending the data using public-key encryption

Explanation:

Encryption is the only choice that provides security.

4 0
2 years ago
Read 2 more answers
(Displaying a Sentence with Its Words Reversed) Write an application that inputs a line of text, tokenizes the line with String
Serjik [45]

Answer:

I am writing a JAVA and Python program. Let me know if you want the program in some other programming language.

import java.util.Scanner; // class for taking input from user

public class Reverse{ //class to reverse a sentence

public static void main(String[] args) { //start of main() function body

Scanner input = new Scanner(System.in); //create a Scanner class object

   System.out.print("Enter a sentence: "); //prompts user to enter a sentence

   String sentence = input.nextLine(); // scans and reads input sentence

   String[] tokens = sentence.split(" "); // split the sentence into tokens using split() method and a space as delimiter

   for (int i = tokens.length - 1; i >= 0; i--) { //loop that iterates through the tokens of the sentence in reverse order

       System.out.println(tokens[i]); } } } // print the sentence tokens in reverse order

Explanation:

In JAVA program the user is asked to input a sentence. The sentence is then broken into tokens using split() method. split method returns an array of strings after splitting or breaking the sentence based on the delimiter. Here the delimiter used is space characters. So split() method splits the sentence into tokens based on the space as delimiter to separate the words in the sentence. Next the for loop is used to iterate through the tokens as following:

Suppose the input sentence is "How are you"

After split() method it becomes:

How

are

you

Next the loop has a variable i which initialized to the tokens.length-1. This loop will continue to execute till the value of i remains greater than or equals to 0.

for (int i = tokens.length - 1; i >= 0; i--)

The length of first token i.e you is 3 so the loop executes and prints the word you.

Then at next iteration the value of i is decremented by 1 and now it points at the token are and prints the word are

Next iteration the value of i is again decremented by i and it prints the word How.

This can be achieved in Python as:

def reverse(sentence):

   rev_tokens = ' '.join(reversed(sentence.split(' ')))

   return rev_tokens

   

line = input("enter a sentence: ")

print((reverse(line)))

The method reverse takes a sentence as parameter. Then rev_tokens = ' '.join(reversed(sentence.split(' ')))  statement first splits the sentence into array of words/tokens using space as a delimiter. Next reversed() method returns the reversed sentence.  Next the join() method join the reversed words of the sentence using a space separator ' '.join(). If you want to represent the reversed tokens each in a separate line then change the above statement as follows:

rev_tokens = '\n'.join(reversed(sentence.split(' ')))  

Here the join method joins the reversed words separating them with a new line.

Simply input a line of text and call this reverse() method by passing the input line to it.

4 0
2 years ago
Referential integrity constraints are concerned with checking INSERT and UPDATE operations that affect the parent child relation
Jet001 [13]

Answer:

a) true

Explanation:

In Computer programming, integrity constraints can be defined as a set of standard rules that ensures quality information and database are maintained.

Basically, there are four (4) types of integrity constraints and these are;

1. Key constraints.

2. Domain constraints.

3. Entity integrity constraints.

4. Referential integrity constraints.

Referential integrity is a property of data which states that each foreign key value must match a primary key value in another relation or the foreign key value must be null.

For instance, when a foreign key in Table A points to the primary key of Table B, according to the referential integrity constraints, all the value of the foreign key in Table A must be null or match the primary key in Table B.

Hence, the referential Integrity constraints ensures that the relationship between the data in a table is consistent and valid.

Hence, referential integrity constraints are concerned with checking INSERT and UPDATE operations that affect the parent child relationships.

<em>This ultimately implies that, referential Integrity are rules used in database management systems (DBMS) to ensure relationships between tables when records are changed is VALID (INSERT and UPDATE).</em>

<em>In a nutshell, it always ensures a primary key must have a matching foreign key or it becomes null. </em>

6 0
2 years ago
Alice is adding a chart in a spreadsheet. Which option will allow you her to give the chart a suitable title and subtitle?
Anon25 [30]

Chart elements is the answer.


8 0
2 years ago
Read 2 more answers
Other questions:
  • How many frequencies does a full-duplex qam-64 modem use?
    8·2 answers
  • In a graphical user interface, which is a small symbol on the screen whose location and shape changes as a user moves a pointing
    10·1 answer
  • Writing in Java, write a program that prompts the user to input an integer and then outputs both the individual digits of the nu
    15·1 answer
  • A website updated daily could be considered _____. a. authoritative b. objective c. accurate d. timely
    8·1 answer
  • Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha
    7·1 answer
  • Write the state of the elements of each of the following arrays after each pass of the outermost loop of the selection sort algo
    11·1 answer
  • Design and document an IP addressing scheme to meet ElectroMyCycle’s needs. Specify which IP address blocks will be assigned to
    11·1 answer
  • Look at the following array definition:
    11·1 answer
  • Select the correct answer.
    6·1 answer
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!