Consider the following class definition.public class Tester
{
privtae int num1;
private int num2;
/missing constructor /
}
The following statement appears in a method in a class other than Tester. It is intended t o create a new Tester object t with its attributes set to 10 and 20.
Tester t = new Tester(10,20);

Which can be used to replace / missing constructor / so that the object t is correctly created?

Answers

Answer 1
Answer:

Answer:

Explanation:

The following constructor needs to be added to the code so that the object called t can be created correctly...

public Tester(int arg1, int arg2) {

    num1 = arg1;

    num2 = arg2;

}

This basic constructor will allow the object to be created correctly and will take the two arguments passed to the object and apply them to the private int variables in the class. The question does not state what exactly the Tester constructor is supposed to accomplish so this is the basic format of what it needs to do for the object to be created correctly.


Related Questions

A babysitter charges $2.50 an hour until 9:00 PM when the rate drops to$1.75 an hour (the children are in bed). Write a program that accepts astarting time and ending time in hours and minutes and calculates the totalbabysitting bill. You may assume that the starting and ending times are ina single 24-hour period. Partial hours should be appropriately prorated.
What is touch-typing?typing with a keyboard shortcut typing with macros typing with only one hand typing without looking at the keyboard
You are troubleshooting network connectivity issues on a workstation. Which command would you use to request new IP configuration information from a DHCP server?
1. What power does creating your own variables give you that you wouldn't otherwise have?
Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class. Your program must prompt the user to enter the following information: a. Ticket type (first class, business class, or economy class)b. Desired seatSo far the code I have is ... now can I go about finishing to retreive the user input ? (This is for C++)#include #include using namespace std;int main(){ int r, c; char seat_resvr; char tic_type; char availability[13][6], reserved[2]; int row_num, col_num; char seats; cout << "A program that lets you choose your seating arrangement on an airplane"; cout << endl; char A[13][6]; for (int r = 0; r < 13; r++) { for (int c = 0; c < 6; c++) A[r][c] = '*'; } /*int row, seat; cin >> row >> seat; A[row - 1][seat - 1] = 'X';*/ cout << " A B C D E F" << endl; for (int r = 0; r < 13; r++) { cout << "Row" << setw(3) << r + 1 << " "; for (int c = 0; c < 6; c++) cout << A[r][c] << ' '; cout << endl; } cout << endl << "* -- available seat" << endl << "X -- occupied seat" << endl << endl << "Rows 1 and 2 are for first class passengers." << endl << "Rows 3 through 7 are for business class passengers." << endl << "Rows 8 through 13 are for economy class passengers." << endl; cout << "To reserve a seat enter Y/y (Yes), N/n(No):" << endl; cin >> seat_resvr; reserved[2] = 'X'; return 0;}

An example of negative self-talk is:

Answers

Answer:

when you call yourself fat or ugly......but that was my answer but pls dont ever be negative abt yalls selfs i love yall the way u are and if u eva wanna talk ill do it in the comments

Explanation:

Answer:

for example, when there is a bad driver on the road near you does something dumb and the little voice in your head always says you idiot watch where you are going. It also can be when you put yourself down like saying that you are dumb or that you will never get a job

- If we place records from different tables in adjacent____________, it would increase efficiency of a database.Physical location
Table
Form
empty location

Answers

Answer: Physical location

Explanation:

If we place records from, different tables in adjacent physical location, it would increases efficiency of a databases as, database consolidates records from previously store in separate files into a common file. Databases are fast and efficient when they are dealing with large data. When all the information is stored in multiple physical location it is also known as distributed database, as physical location helps to provide the physical and logical path and also protect from default locations in the database.

python Write a function that computes a future investment value at a given interest rate for a specified number of years. The future investment is determined using the formula in Programming Exercise 2.19 in Chapter 2 Programming Exercise from the Book.

Answers

Answer:

def future_investment_value(investment, monthly_interest_rate, years):

  print("Years\tFuture Value")

  print("- - - - - - - - - - -")

  for i in range(1, years+1):

      future_value = investment * ((1 + monthly_interest_rate) ** (12 * i))

      print(i, "\t\t", format(future_value, ".2f"))

investment = float(input("Enter the invesment amount: "))

interest = float(input("Enter the annual interest rate: "))

year = int(input("Enter the year: "))

future_investment_value(investment, interest/1200, year)

Explanation:

Inside the function:

- In the for loop that iterates through the years, calculate the future value using the formula and print the results

Then:

- Ask the user for the investment, annual interest rate, and year

- Call the function with the given inputs

Consider a demand-paging system in which processes are performing sequential data accesses with the following time-measured utilizations: CPU utilization 20%
Paging disk 98%
Other I/O devices 10%

For each of the following, indicate yes or no to say whether or not it will (or is likely to) improve CPU utilization:

a. Install a faster CPU
b. Install a bigger paging disk
c. Increase the degree of multiprogramming
d. Decrease the degree of multiprogramming
e. Install more main memory
f. Install a faster hard disk
g. Increase the page size

Answers

Answer:

a. Install a faster CPU - No

b. Install a bigger paging disk - No

c. Increase the degree of multiprogramming - No

d. Decrease the degree of multiprogramming - Yes

e. Install more main memory - Yes

f. Install a faster hard disk - Yes

g. Increase the page size - Yes

Explanation:

a. Install a faster CPU No.

Installing a faster CPU will not improve CPU utilization too much because the CPU utilization is low (20%) and the utilization of the paging disk is very high (98%), we can see that the system has lack of free memory.

b. Install a bigger paging disk No.

Installing a bigger paging disk doesn't improve the CPU utilization because the system has lack of free memory.

c. Increase the degree of multiprogramming No.

If the level of multiprogramming is increased more processes would have to be swapped in and out of the memory with a higher chance of page fault much frequently and the CPU utilization would reduce.

d. Decrease the degree of multiprogramming Yes.

If the level of multiprogramming is reduced less processes would have to be swapped in and out of memory, reducing the chance of page fault and the CPU utilization would improve.

e. Install more main memory

This is likely to improve CPU utilization as more pages can remain resident and not require paging to or from the disks.

f. Install a faster hard disk

With a faster hard disk, the CPU will get more data more quickly and this will lead to faster response and more throughput to the disks. With a faster hard disk, the disk is not a bottleneck to utilization.

g. Increase the page size

Increase the page size will likely degrade the performance, because the internal fragmentation will be worse, the utilization of main memory will be low, more processes will not be able to fit into main memory, and the system will have to spend more time in swapping. So this is as likely to decrease utilization as it is to increase it.

Does Kennesaw State University have any computing ethical policy for computer usage? If so - what is it?

Answers

Answer:

The answer to the questions: Does Kennesaw State University have any computing ethical policy for computer usage? If so - what is it? Would be as follows:

1. Yes, Kennesaw State University, a university in Georgia, does have a computing ethical policy that regulates the proper use of the facilities and computing services within the facilities of the university and the use of computing equipment that belongs to the university. This policy is known as the KSU Computer Usage Policy.

2. As said before this policy establishes that the use of computing services are not the right of a person, but rather a privilege afforded to the students, faculty and other people who are present in the university and who may need to use its computing services. The use of the computing services would be whitin this policy as long as it stays inside the delimitations established by federal, state and University policies.

Explanation:

In open addressing with linear probing we must consider how to encodeA. Occupies positions

B. Available positions

C. All other answers

D.empty positions

Answers

Answer: B)Available positions

Explanation:Open addressing is the addressing method for the components that are present in the hash table. collision are controlled and managed by this process. The total count of keys is less or equal to the size of table.

Linear probing is the mechanism that helps in controlling of the collision happening by the process of key collection maintenance by encoding of the available positions of the element in the hash table.So,the correct option is option(B).

Other Questions