Which class members should be declared as public?

a
Data attributes and constructor methods
b
Data attributes only
c
Methods and occasionally final attributes
d
Predominantly data attributes and some helper methods

Answers

Answer 1

Answer:

B. Methods and occasionally final attributes

Explanation:

In Computer programming, class members can be defined as the members of a class that typically represents or indicates the behavior and data contained in a class.

Basically, the members of a class are declared in a class, as well as all classes in its inheritance hierarchy except for destructors and constructors.

In a class, member variables are mainly known as its attributes while its member function are seldomly referred to as its methods or behaviors.

One of the main benefits and importance of using classes is that classes helps to protect and safely guard their member variables and methods by controlling access from other objects.

Therefore, the class members which should be declared as public are methods and occasionally final attributes because a public access modifier can be accessed from anywhere such as within the current or external assembly, as there are no restrictions on its access.


Related Questions

*Python Coding
2. Driver’s License ExamThe local driver’s license office has asked you to create an application that grades the written portion of thedriver’s license exam. The exam has 20 multiple-choice questions. Hereare the correct answers:1. B 6. A 11. B 16. C2. D 7. B 12. C 17. C3. A 8. A 13. D 18. B4. A 9. C 14. A 19. D5. C 10. D 15. D 20. AYour program should store these correct answers in a list. The program should read thestudent’s answers for each of the 20 questions from a text file and store the answers inanother list. (Create your own text file to test the application.) After the student’s answershave been read from the file, the program should display a message indicating whether thestudent passed or failed the exam. (A student must correctly answer 15 of the 20 questionsto pass the exam.) It should then display the total number of correctly answered questions,the total number of incorrectly answered questions, and a list showing the question numbers of the incorrectly answered questions.

Answers

correct = (["1.B", "6.A", "11.B", "16.C","2.D", "7.B", "12.C", "17.C", "3.A", "8.A", "13.D", "18.B","4.A" ,"9.C", "14.A", "19.D","5.C", "10.D", "15.D", "20.A"])

f = open("MyFile.txt", "r")

user_answers = ([])

count = 0

txt = ""

for x in f.read():

   if x == " " or x == "\n":

       x = ""

       count += 1

   if count == 2 :

       user_answers.append(txt)

       txt = ""

       count = 0

   txt += x

i = 0

cor = 0

wrong = ([])

while i < len(correct):

   if correct[i] == user_answers[i]:

       cor += 1

   else:

       wrong.append(user_answers[i])

   i += 1

questions = ([])

for i in wrong:

   txt = ""

   for w in i:

       if w == ".":

           questions.append(int(txt))

       txt+=w

print("There were {} correct answers".format(cor))

print("There were {} incorrect answers".format(len(questions)))

print("The incorrectly answered questions are {}".format(questions))

f.close()

The file I used for testing looks like:

1. C 6. A 11. B 16. C

2. D 7. B 12. C 17. C

3. A 8. D 13. D 18. D

4. A 9. C 14. A 19. A

5. C 10. D 15. D 20. C

The code only works if there is a new line after 20. C (press enter after that question if a new line isn't already included)

I hope this helps!

describe at least five ways in which information technology can help studying subjects other than computing​

Answers

Answer:

I'd that IT can help in a great many different fields like

Mathematics, in a manner of solving complex math equations

Statistics, in a manner of creating complex graphs with millions of points

Modeling, in a manner of creating models from scratch, either for cars, personal projects or characters for video games and entertainment

Advertising, in a manner of using IT to create not only the advertisements themselves but also, spreading that advertisement to millions in a single click

Music/Audio, in a manner of creating new sounds and music that wouldn't be able to work in any practical manner

Explanation:

give the one simple program using c++programming language​

Answers

Answer:

the ejedjrjr eenekrr

eueeue

Explanation:

u4rururirw

Online
Activities
Media Literacy
Information
Literacy
Technology
Literacy
Content
(appropriateness,
tone, recipient,
others)
tools (mobile,
computers,
others)
Sending an as platform (text;
electronic
email; messenger,
message
video
message;
voice message:
others)
Getting the latest traditional
(newspaper, tv,
radio, others)
digital (websites,
social media,
others)
news
Content
(appropriateness,
reliability, accuracy,
tone, audience,
others) giving
feedback (reactions,
comments, rate,
others)
knowing how to
use mass
media platforms
(tv, radio, others)
where to access
digital content
navigational skills
Entertainment
Business
Education
sources​

Answers

Answer:

i can't understand what u want to say

Which of these is an adjustment on a power rack-and-pinion steering gear?



A. Cylinder alignment
B. Sector mesh adjustment
C. cross shaft endplay
D. Pinion torque​

Answers

Answer:

a

Explanation:

Which fixed expense would be most difficult to change if money is needed for car payments? rent electricity cable Internet

Answers

Answer: rent

Explanation: just took the quiz on edge

Answer:

rent

Explanation:

took the quiz

list the steps to create a new folder in windows

Answers

Navigate to where you want to create the new folder, and click New Folder. Type the name of your folder, and press Enter. To save a document to the new folder, open the document, and click File > Save As, and then browse to the new folder, and click Save.

salvado has a flash disk of 1.5GB and wants to store more music files of 950KBs each . How many files will he be able to store on his flash disk?​

Answers

Answer:

Convert 1.5GB to KBs = 1500000kb

1500000kb/950kb ≈ 1579

Explanation:

A flash disk is a storage device. It has enough memory to store large files. In the given question, the flash disk has a memory of 1.5GB and can store 1578.94 music files of 950KBs each.

What is flash disk?

A flash disk is a data storage device that uses flash memory specifically : a small rectangular device which is designed to be plugged directly into a USB port on a computer. It is often used for transferring files from one computer to another computer system.

Flash disks have no mechanical platters or access arms. It is termed "disk" because of the data which are accessed as if they were on a hard drive. The disk storage structure is emulated.

In the given question, the flash disk contains 1.5GB memory and has to store music files of 950KBs each. For determining the number of music files which can be stored in the flash disks, we have to first convert the unit of flash disk from GB to KB:

1GB = 1,000,000 KB

1.5 GB = 1,500,000 KB

size of music file = 950 KB

Number of music files that can be stored = storage in the flash disk ÷ size of the music file

Number of music files = 1500000KB ÷ 950KB

Number of music files = 1578.94

Learn more about Flash disk here:

https://brainly.com/question/1130880

#SPJ2

explain mechanical computer ,electromechanical and electronic computer with example

Answers

Answer:

A mechanical computer uses moving parts to do it’s calculations. Think old style adding machines.Electronic computers use electronic oscillators to generate a clock. The oscillator might include a mechanical element such as a crystal, but the majority of the clock signal is processed in the electrical domain.

Explanation:

An example of a mechanical computer clock is a Swiss watch movement, which needs no electronics. Movement is based upon springs coupled to other mechanical pieces. Swiss watches are high precision mechanical computers that do counting. There are other types of more sophisticated mechanical computers. Research the works of Konrad Zuse and his Z1 mechanical computer.

so i am on a Chromebook with headphones , and I am wondering if you can make it that a tab only play sound on one side of the headphones and other tabs to the other side of the headphones

Answers

No you cannot do that with a single pair of headphones. If you had an dual aux split... you could plug in two pairs of headphones... even if you had two bluetooth pairs I don't think it'd be possible... What do you need to do that for? Maybe I can help find an alternative solution

Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores

Answers

Answer:

Explanation:

The following is written in Java. It is a method/function that takes the oldScore as an int input. It turns it into a String, separates all the digits, puts them into an array. Then adds the first digit to the end and removes it from the beginning, thus shifting the entire score one to the left. Then it turns the String variable back into an Integer called finalScore and prints it out.

public static void newScore(int oldScore) {

       ArrayList<Integer> newScore = new ArrayList<>();

       String stringOldScore = String.valueOf(oldScore);

       for (int x = 0; x < stringOldScore.length(); x++) {

           newScore.add(Integer.parseInt(String.valueOf(stringOldScore.charAt(x))));

       }

       newScore.add(newScore.get(0));

       newScore.remove(0);

       String newScoreString = "";

       for (int x:newScore) {

           newScoreString += String.valueOf(x);

       }

       int finalScore = Integer.parseInt(newScoreString);

       System.out.println(finalScore);

   }

This is science I just couldn’t find it

Answers

Answer:

69

Explanation:

It is 69 because it is the most for that degree.

WILL BRAINLIEST Use the drop-down menu to correctly complete these sentences about the five standard Python data types.


are numeric values in Python data types.
A
is a large and changeable list that can contain any number of Python objects.

are connected sets of characters separated by quotation marks " ".

are sets of data separated by a comma between two parenthesis ( ).

are sets of data separated by a comma between two brackets [ ].

Answers

numbers,dictionary,strings,tuples and lists. in order

Answer:

numbers,dictionary,strings,tuples and lists. in order

Explanation:

Given a binary search tree containing N integers, create an AVL tree containing the same values. You should not destroy the original BST in the process. What is the worst case time?

Answers

Answer:

answer : 0 (n log n )

Explanation:

Creating an AVL tree containing the same values and containing N integers and without destroying the original BST in the process, the worst case time will be : 0 ( n log n ) and this is because each insertion will take 0 (log n ) time

The worst case time for a binary search algorithm that contain N integers without destroying the original binary search tree (BST) is [tex]0(NlogN)[/tex]

What is a binary search?

Binary search can be defined as an efficient algorithm that is designed and developed for searching an element from a sorted list of data, especially by using the run-time complexity of [tex]0(logN)[/tex].

Note: N is the total number of elements contained in a list.

In this scenario, the worst case time for this binary search algorithm that contain N integers without destroying the original binary search tree (BST) is given by [tex]0(NlogN)[/tex]

Read more on binary search here: https://brainly.com/question/24268720

Write a program that reads one or more strings from the standard input and outputs the count of vowels, consonants, and digit characters found in the stream.

Answers

Answer:

endinput = "no"

mylist = []

vowel = ['a', 'e', 'i', 'o', 'u']

vowelcount = 0

consonantcount = 0

digitcount = 0

string = " "

number = [ str(i) for i in range(0, 10)]

while endinput == "no":

   inputs = input("Enter string value: ")

   mylist.append(inputs)

   endinput = input("Do you want to end input? ( enter no to continue:  ")

for item in mylist:

   txt = item

   print(txt)

   for i in txt:

       if i == string:

           continue

       elif i in vowel:

           vowelcount +=1

       elif i in number:

           digitcount += 1

       else:

           consonantcount += 1  

print("Vowels: ", vowelcount)

print("Digits: ", digitcount)

print("Consonant: ", consonantcount)

Explanation:

The python program receives one or more strings from the standard input and appends it to a list. The algorithm iterates through the list of string values and counts the number of vowels, consonants, and digits.

There are thousands of downloadable digital images online that you can use in your presentations. {TRUE or FALSE}
this is for speech

Answers

True hopes this helps!

It should be noted that thousands of downloadable digital images are online for ones presentations.

This statement is true because, digital image serves as picture that is stored on a computer.

It can be been digitized, that is converted into a sequence of numbers that computers can understand and its available online.

Learn more about digital images at;

https://brainly.com/question/24448358

what is a device driver​

Answers

Answer:

Explanation:

In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer. ...

Answer:

a device driver is a computer program that operates or controls a particular type of device that is attached to a computer.[1] A driver provides a software interface to hardware devices, enabling operating systems and other computer programs to access hardware functions without needing to know precise details about the hardware being used.

Explanation:

Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive).

Answers

Answer:

C#

if(user_grade >=9 && user_grade <=12)

{

   Console.WriteLine("In Highschool");

}

Python

if user_grade >= 9 & user_grade <= 12:

  print("In Highschool")

Java

if(user_grade >=9 && user_grade <=12)

{

   System.println("In Highschool");

}

Explanation:

How did DDE devices have made our daily life easier?

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

DDE (direct data entry) devices are the devices that read data from a source and transfer it directly into the computer. Unlike, other input devices which require physical interaction which requires you to move physically or to do something for an output or feeding data into a computer.  

The DDE devices require no hard work while taking input into the computer as compared to other input devices. These DDE devices made our life very easy. Because these devices take input accurately and there are no chances of human error.

The example of DDE devices are magnetic stripe reader, chip reader, Pin pads, optical mark reader, and barcode reader, etc.

These devices have brought great advantages to human life. Because by using these data entry devices, information can be put into very quickly, more accurate than typing and information of the whole page transferred .very quickly and accurately into the system. These devices are also more secure and can hold lots of data, and the data is protected with the PIN (personal identification number). These are also used in ATM machines, handheld, and entry doors.

Answer:

wait is it a write in answer or a multiple choice?

Explanation:

Let f(w) = 2w^3 - 5. Let z = 2. What is f(z)?​

Answers

Answer:

Hence f(z)=11

*This is what i think*

Assume a file containing a series of integers is named numbers.txt and exists on the computer’s disk. Write a program that calculates the average of all the numbers stored in the file.

Answers

Answer:

Explanation:

The following code is written in Java. It assumes that the numbers.txt file is in the same folder as the Java file and the numbers are separated one on each line. It reads the file, adds all the numbers to an array, then adds the numbers into a single variable and finally divides by the total amount of numbers in order to get the average.

public static void main(String[] args) {

       ArrayList<Integer> numbers = new ArrayList();

       try {

           File myObj = new File("numbers.txt");

           Scanner myReader = new Scanner(myObj);

           while (myReader.hasNextLine()) {

               String data = myReader.nextLine();

               numbers.add(Integer.parseInt(data));

           }

           myReader.close();

       } catch (FileNotFoundException e) {

           System.out.println("An error occurred.");

           e.printStackTrace();

       }

       int average = 0;

       for (int x:numbers) {

           average += x;

       }

       average = average / numbers.size();

       System.out.println(average);

   }

How long will it take to transfer 1GB data on USB 2.0, on USB 3.0

Answers

Answer:

Have a great day, Here is the answer to your question:

It will take around 18 seconds

Explanation:

So in principle 1GB of data to be uploaded running at peak speed is suggested to take around 18 seconds but in fact, DCD test results show USB 2.0 takes 3 minutes 18 seconds to complete a 1GB switch. Whereas USB 3.0 can accommodate up to 5gbps of data transferred-more than 10 times faster than its predecessor.

No variables and only in one lines

Answers

In python 3.8, we can use a simple print statement.

print(('h0 '*3 +'Merry Christmas\n')*2)

Write an application that counts the total number of spaces contained in a quote entered by the user.

Answers

Answer:

Explanation:

The following code is written in Java. It asks the user for an input and saves it in a String variable. Then it loops through all the characters in the string and counts the spaces. Finally, it prints the total number of spaces in the String.

public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Line Now:");

       String userInput = in.nextLine();

       int spaceCount = 0;

       for (int x = 0; x < userInput.length(); x++) {

           if (userInput.charAt(x) == ' ') {

               spaceCount++;

           }

       }

       System.out.println(spaceCount);

   }

The coding system that has just two characters is called:

a
binary
b
dual.
c
basic.
d
double.

Answers

Answer:

A. Binary

Definition:

Pertaining to a number system that has just two unique digits 0 and 1. - binary code

Answer:

a binary

Explanation:

ascii. an agreed method for paring the alpanumeric characther set with binary repersenations used in computers. binary. Pertaining to a number system that has just two unique digits 0 and 1. binary code.

4.5 Lesson Practice edhesive

Answers

Answer:

Count Variable -- When it hits a limt.

using user input -- its true if the user input is the conditional variable needed to end it.

The two ways that one can end a loop are:

Using user input (Option B)- This is used when its true if the user input is the conditional variable  has to to terminate it;Count Variable (Option D) - When it hits a limit.

What is a loop?

In programming, the sequence of events (instruction) that continues to run repeatedly in the same chain is called a loop.

Thus, it is right to state that the two ways that one can end a loop are:

Using user input (Option B)- This is used when its true if the user input is the conditional variable  has to to terminate it;Count Variable (Option D) - When it hits a limit.

Learn more about loops at:
https://brainly.com/question/24052822
#SPJ9

Jamal wants to write a program that will find the 10 most common words in Romeo and Juliet. Which of the following constructs will be most helpful?

A. counter module

B. while loop

C. for loop

D. mean module

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is A: counter module.

Counter module in python or Python counter is a container that holds the count of each of the elements present in the container. It is a sub-class available in the dictionary class. Jamal can use this module in Python to write a program that will find the 10 most common words in Romeo and Juliet.

Other options are not correct because:

While loop: while loop only iterates its body until a specific condition is met. For loop is used to iterate to a pre-specified condition and iterate until the condition is reached. While the mean module of Python is used to calculate mean and average.

Write a function named findmax()that finds and displays the maximum values in a two dimensional array of integers. The array should be declared as a 10 row by 15 column array of integers in main()and populated with random numbers between 0 and 100.

Answers

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Random r = new Random();

    int[][] numbers = new int[10][15];

   

    for (int i=0; i<10; i++){

        for (int j=0; j<15; j++){

            numbers[i][j] = new Random().nextInt(101);

        }

    }

   

    for (int i=0; i<10; i++){

        for (int j=0; j<15; j++){

            System.out.print(numbers[i][j] + " ");

        }

        System.out.println();

    }

   

    findmax(numbers);

}

public static void findmax(int[][] numbers){

    int max = numbers[0][0];

   

    for (int i=0; i<10; i++){

        for (int j=0; j<15; j++){

            if(numbers[i][j] > max)

                max = numbers[i][j];

        }

    }

    System.out.println("The max is " + max);

}

}

Explanation:

*The code is in Java.

Create a function called findmax() that takes one parameter, numbers array

Inside the function:

Initialize the max as first number in the array

Create a nested for loop that iterates through the array. Inside the second for loop, check if a number is greater than the max. If it is set it as the new max

When the loop is done, print the max

Inside the main:

Initialize a 2D array called numbers

Create a nested for loop that sets the random numbers to the numbers array. Note that to generate random integers, nextInt() function in the Random class is used

Create another nested for loop that displays the content of the numbers array

Call the findmax() function passing the numbers array as a parameter

typing which capitals and exclamation points in an email is an example of

Answers

it's an example of a poorly written email, it looks like somebody is angry and yelling at you, these types of emails can be described as a poor etiquette.

answer 1 question and get 10 points in return

Answers

Answer:

3

Explanation:

sorry if I'm wrong...it's been a while since I took a coding class.

3 I think... hope this helps!
Other Questions
Answer this post-test about direct and reported speech to see how well you have improved since thepre-test.Directions: Read the questions then choose the letter of the best answer.1. When reporting someone'syou can use direct or reported speech.A. crimes B. files C. lifeD. statement2. Which uses a reworded statement of someone?A. direct speechC. direct lineB. reported speechD. welcome speech3. in reporting someone's exact statement, useA. periodC. quotation marksB. commaD. question marks4. Which is not true about reported speech?A. It may or may use "that."B. Its reporting verb could be in the past tense or present tense.C. Reported speech uses reworded statement.D. Pronouns used in someone's statement do not change.5. My grandfather always said that I should enjoy life. The given is an exampleof1 WILL MARK YOU!!! HELP!Where does sugar enter the blood? Using complete sentences, describe the purpose and function of the writ of habeas corpus. Tomb trees are standing side-by-side in the sunlight one is 50 feet tall and the other is 20 feet tall if the taller tree cast an 18 foot shadow what is the length in feet of the shadow of the shorter tree QUICK ANSWER PLEASEIn triangle NLM, point S is the centroid, QS = (3x 5) cm, and NS = (4x) cm.Triangle N L M has centroid S. Lines are drawn from each point to the midpoint of the opposite side to form line segments N Q, L R, and M P. The length of line segment N S is 4 x and the length of line segment S Q is 3 x minus 5.What is NS?5 cm10 cm20 cm30 cm Find the x-intercept and y-interceptfrom the following linear equation:D x + 4y = -56x-intercept ([?],[]).y-intercept (I):[]) which item would be a high involvment purchase?A an appleB a penc. a computerd a movie ticket Per year, most American children are in school less than they watch TV.Please select the best answer from the choices providedOTOF(E2020 Psychology ) PLZZZZ HELP ME!!!!! factor 15x + 81 Which two elements have similar properties and 8 electrons in theiroutermost shells? Brainliest % stars Thanks Correct answers Fast 1) How is energy transferred from one organism to another? Find the difference.21.12 12.2 How many membrane layers cover the nucleus?O A. 3O B. 1O c. 2O D.O Based on details from "The Telephone: A Truer Tale," how did Antonio Meucci and Alexander Graham Bell differ? O Meucci developed a working telephone, while Bell did not. O Meucci struggled financially, while Bell did not. O Meucci dreamed of a world full of working telephones, while Bell did not. Meucci got credit for the invention of the telephone, while Bell did not.PLEASE HALP The length of a rectangle is 2 cm longer than its width. If the perimeter of the rectangle is 56 cm, find its length and width. When people lose rights that facilitate their ability to be employed or to be participate in family activities to further their overall well-being, this dynamic is referred to asa. Human rightsb. Healthy disparityc. Social inequalityd. Social deprivation. Hi all who can be my english teacher. Please help me . I need a english teacher What were the signal capitalist institutions that underpinned overseas endeavors? How in turn did imperial expansion promote the further growth of capitalism? See below I have take a picture of the screen