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
taurus
28 days ago
14

Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public

static integer named d. Which of the following are legal statements in a class named ClassB that has instantiated an object as ClassA obA =new ClassA();?
a. obA.b 12;
b. obA.c 5;
c. obA.d 23;
d. ClassA.b=23;
e. ClassA.c= 33;
f. ClassA.d= 99;
Computers and Technology
1 answer:
amid [951]28 days ago
6 0

Response:

b. obA.c 5;

d. ClassA.b=23;

f. ClassA.d = 99;

Reasoning:

Java is an object-oriented programming language. It is a high-level language created by Sun Microsystems. Java enables the development of applications for individual computers. The static variable behaves like a global variable in Java and is shareable among all objects. In contrast, a non-static variable is tied to the particular instance where it is created.

You might be interested in
Flowgorithm, Design a program that prompts the user to enter a number within the range of 1 through 10. The program should displ
Rzqust [1037]
The provided explanation, including the step-by-step code, is as follows: We can approach this issue employing the if elif else model. def main(): # prompts the user to input an integer between 1 to 10 num = int(input('Enter a number in the range of 1 to 10:\n')) # utilizing if elif to display the roman numeral from 1 to 10 if num == 1: print('Roman Numeral for 1 is I') elif num == 2: print('Roman Numeral for 2 is II') elif num == 3: print('Roman Numeral for 3 is III') elif num == 4: print('Roman Numeral for 4 is IV') elif num == 5: print('Roman Numeral for 5 is V') elif num == 6: print('Roman Numeral for 6 is VI') elif num == 7: print('Roman Numeral for 7 is VII') elif num == 8: print('Roman Numeral for 8 is VIII') elif num == 9: print('Roman Numeral for 9 is IX') elif num == 10: print('Roman Numeral for 10 is X') # else to show error message for numbers outside the specified range else: print('Error! Wrong Input') # invoking the main function main() Output: Enter a number in the range of 1 to 10: 6 Roman Numeral for 6 is VI Enter a number in the range of 1 to 10: 15 Error! Wrong Input.
6 0
1 month ago
Write a loop to populate the list user_guesses with a number of guesses. The variable num_guesses is the number of guesses the u
oksian1 [950]

Response:

num_guesses = int(input())

user_guesses = []

for i in range(num_guesses):

    x = int(input())

    user_guesses.append(x)

   

print(user_guesses)

Clarification:

This solution is given in Python

The initial line requests the user to input a number of guesses

num_guesses = int(input())

This line establishes an empty list

user_guesses = []

Inside this loop, each guess is taken from the user

for i in range(num_guesses):

In this line, each guess input by the user is processed

    x = int(input())

This adds the input to the list

    user_guesses.append(x)

Finally, this prints the collected user guesses    

print(user_guesses)

6 0
1 month ago
Write a class named Taxicab that has three **private** data members: one that holds the current x-coordinate, one that holds the
amid [951]

Response:

Refer to the explanation

Details:

class Taxicab():

def __init__(self, x, y):

self.x_coordinate = x

self.y_coordinate = y

self.odometer = 0

def get_x_coord(self):

return self.x_coordinate

def get_y_coord(self):

return self.y_coordinate

def get_odometer(self):

return self.odometer

def move_x(self, distance):

self.x_coordinate += distance

# increase the odometer with the absolute distance

self.odometer += abs(distance)

def move_y(self, distance):

self.y_coordinate += distance

# increase odometer with the absolute distance

self.odometer += abs(distance)

cab = Taxicab(5,-8)

cab.move_x(3)

cab.move_y(-4)

cab.move_x(-1)

print(cab.odometer) # will output 8 3+4+1 = 8

7 0
2 months ago
Disk scheduling algorithms in operating systems consider only seek distances, because Select one: a. modern disks do not disclos
amid [951]

Response:

a. Current disks do not reveal the actual locations of logical blocks.

Clarification:

Modern disks incorporate scheduling algorithms within the disk drive itself. This presents challenges for operating systems trying to optimize rotational latency. All scheduling methods end up having to perform similarly due to potential constraints faced by the operating system. Disks are typically accessed in physical blocks. Modern technology applies more electronic control to the disk.

4 0
1 month ago
Which kind of file would be hurt most by lossy compression algorithm
oksian1 [950]

Response: a file containing audio

Clarification:

8 0
1 month ago
Read 2 more answers
Other questions:
  • Server farms such as Google and Yahoo! provide enough compute capacity for the highest request rate of the day. Imagine that mos
    12·1 answer
  • The part of the computer that contains the brain, or central processing unit, is also known as the A.monitor B.modem C.keyboard
    10·1 answer
  • How concerned are you about the security of rtos in cars smart homes and wearable technology?
    15·1 answer
  • A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule als
    12·1 answer
  • Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just one statement. Hint: Call find
    5·1 answer
  • An array subscript can be an expression, but only as long as the expression evaluates to what type?
    7·1 answer
  • 7.7 LAB: Using a while loop countdown Write a program that takes in an integer in the range 10 to 100 as input. Your program sho
    11·1 answer
  • The following code is intended to test if x is NOT less than 17. Fill in the correct symbol:
    14·2 answers
  • Danielle, a help desk technician, receives a call from a client. In a panic, he explains that he was using the Internet to resea
    9·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!