Write a static method that takes a String and returns an integer. Return the number of characters in the passed in, String parameter.

Answers

Answer 1

Answer:

Explanation:

The following code is written in the Java programming language. It is a function called howBig that takes in a String as a parameter and returns an int. The function grabs the string and then detects the size of the String (number of Characters it has) and then places that number into an Integer variable called wordSize. Then it returns the variable wordSize.

public static int howBig (String myWord) {

       int wordSize = myWord.length();

       return wordSize;

   }

Answer 2

Following are the Program to the given question:

Program Explanation:

Defining a class "Main".Inside a class, a method "Length" is defined that takes string variable "s" as the parameter.Inside the method,  a conditional statement is defined that checks length of the string value and prints its value.In the next step, the main method is declared that calls the length method, and print its return value.

Program:

public class Main //defining a class Main  

{

   public static int Length(String s)//defining a method getLength that takes String parameters

   {

       if(s==null)//defining if block that check s parameter value equal to null

       {

           return 0;//return 0

       }

       else //defining else block

       {

           return s.length();//using return keyword that return length of String

       }

   }

   public static void main(String[] args) //defining a main method

   {

       System.out.println(Length(null));//calling method and print its value

       System.out.println(Length("abcd"));//calling method and print its value

   }

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/19737952

Write A Static Method That Takes A String And Returns An Integer. Return The Number Of Characters In

Related Questions

In 100 words or less, discuss why ethics is especially important for computer professionals, as it pertains to addressing professional challenges, formulating decisions and policies used to guide actions and as a means to fill the gap between newly created technologies and general legal standards.

Answers

Explanation:

In every profession, codes of ethics are usually on ground which are designed to guide professionals in carrying out their responsibilities with honesty and integrity.

Ethical codes are very necessary and important for technical managers.

It motivates professionals to carry out their duties well and also provide an education for new employees on how to carry out their professional duties.

A code of ethics tells professionals their responsibilities at the workplace and certain punishments are set in the presence of violations.

This code forbids professionals from having any involvements in deceptive practices. Computer professionals have to make sure that they know their moral responsibilities and they also have to know those to whom they are responsible.

Those Professionals that are involved in the process of data handling and data processing are mostly responsible for their employers and also the public.

For this, there should be guidelines that these professionals must follow. The job of Data handling is a very sensitive one, computer professionals must first be responsible citizens.

The Code of ethics sets limits to the activities of computer professionals. For example, when we talk about data processing, we know how much privacy is needed here. Privacy is a very great concern because there are hackers who are on the lookout to steal your data.

The Code of ethics stops professionals from engaging in discussions about their job outside the workplace. It makes professionals more sincere and also more dedicated to their job. It also helps them take important decisions as well as policy formulations to guide actions. Code of Ethics created an awareness of the legal standards of the company to the professional who works in that company.

If a function is called more than once in a program, the values stored in the function's local variables do not _________ between function calls. g

Answers

Answer:

persist

Explanation:

Calling a function Within a program, can be regarded to as specifying of the name of the function when it is within a statement or it could be by the function itself, it possible for a particular function to call another function, in a case wherby a function returns a value, assignment or using the value to variable is not necessary. It should be noted that If a function is called more than once in a program, the values stored in the function's local variables do not persist between function calls

While your hands are on home row, both of your thumbs are on _____.

Answers

Answer:

While your hands are on home row, both of your thumbs are on Space-barI know this will definitely help✍️✍️✍️

For things like school, you should have a more serious:

Answers

Answer:

who and what do you mean

Explanation:

Hi, Everybody i have a question it is almost my B-day i want this lego set
(Nintendo Entertainment System™) BUT THEY ARE SOLD OUT
I NEED HALP

Answers

Answer:

You can look at different websites of look on an app for people selling it, or something :p

Explanation:

Files can be stored on hard drives, network drives, or external drives, but not in the cloud.
True
False

Folders provide a method for organizing files.
True
False

Answers

The first one is false and the second is true

Answer: (1) False, (2) True

Explanation:

Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces. Sample output for the given program: (must be in python)
90 -> 92 -> 94 -> 95
Note: There is a space after 95.
------------------------------------------------------------------------------------------------------------------------
hourly_temperature = [90, 92, 94, 95]
for temp in hourly_temperature:
for index,temp in enumerate(str(temp)):
if index != len(temp)-1:
print(temp,'->',end=' ')
else:
print(temp, end='')
print('') # print newline
------------------------------------------------------------------------------------------------------------------------
My expected out is:
90 -> 92 -> 94 -> 95
I keep getting:
90 -> 92 -> 94 -> 95 ->
NOTE: I can't edit the last line "print('') #print newline"

Answers

Answer:

Following are the code to this question:

hourly_temperature = [90, 92, 94, 95]#defining a list that holds values

c= 0#defining a variable c

for temp in hourly_temperature:#defining a for loop to count list values

   c+= 1#defining c variable to increment the value of c

   for index,temp1 in enumerate(str(temp)):#defining for loop for spacing the list value

       if index == len(str(temp))-1 and c!= len(hourly_temperature):#defining if block that checks the length of list

           print(temp1,'->',end=' ')#print value

       elif c == len(hourly_temperature) and index == len(str(temp)) - 1:#defining elif block that checks the length of list

           print(temp1, end=' ')#print value

       else:#defining else block

           print(temp1, end='')#print value

Output:

90 -> 92 -> 94 -> 95  

Explanation:

In the above-given code, a list "hourly_temperature" is declared, in which an integer variable c is declared, that holds an integer value that is equal to 0, and two for loop is declared, and in the first loop is used for count list value, and inside the for loop is uses enumerate method to assigns an index for each item and use the conditional statement to check each list value and provide space in each element value.

Write a test program that prompts the user to enter a two dimensional array and displays the location of the smallest element in the array.

Answers

Answer:

def element_loc():

   is_end = 'n'

   dimen2 = []

   while is_end == 'n':

       par1 = input("Enter rows and columns: ").split(",")

       part = [int(i) for i in par1]

       dimen2. append(part)

       is_end = input("Do you want to add more rows? y/n: ")

   mini = list()

   for i in dimen2:

       mini. append(min(i))

   result = min(mini)

   row_index = mini. index(result)

   col_index = dimen2[row_index]. index(result)

   print("Row: ", row_index, "Col_index: ", col_index)

element_loc()

Explanation:

The python program solution above prompts users for the two-dimensional array and then the rows of the array are compared with the minimum value stored in another list or array. The row index and the column index are gotten from the mini and dimen2 arrays respectively and are displayed as the position of the minimum value in the two-dimensional array.

As an interviewer, it is not necessary to be at eye level with interviewee

True
False

Answers

Answer:

True

Explanation:

Have a great day

Answer:

True

Hope this helps

ndcdeviceid?????????????????????​

Answers

YESS

Explanation:

YESSssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

Write an LC-3 assembly language program to read in a two-digit decimal number whose digits add up to less than 10 and display the sum of those digits in the next line.
Sample execution (user input underlined) : Please enter a two-digit decimal number > 27. The sum of the digits = 9

Answers

Answer:

Explanation:

.MODEL SMALL

.STACK 100H

.DATA

   STR1 DB 0AH,0DH, 'THE SUM OF TWO DIGITS PRENT IN THE GIVEN NUMBER'

   FNUM DB ?

   STR2 DB ' AND '

   SNUM DB ?

   STR3 DB ' IS '

   ANS DB ?

   STR4 DB ' $'

.CODE

MAIN PROC

   MOV AX, "at" DATA       PLEASE NOTE: your "at" need to be in symbol

   MOV DS,AX                    It is because this text editor who allow the sub-

                                            mission of this answer if i use the symbol format

   MOV AH,2                       that is why put it in bold and parenthesis

   MOV DL,3FH

   INT 21H

   MOV AH,1

   INT 21H

   MOV BL,AL

   MOV FNUM,AL

   INT 21H

   MOV SNUM,AL

   ADD BL,AL

   SUB BL,30H

   MOV ANS,BL

   MOV AH,9

   LEA DX,STR1  

   INT 21H

   MOV AH,4CH

   INT 21H

   MAIN ENDP

END MAIN

turns on her laptop and gets the error message "OS NOT FOUND." She checks the hard disk for damage or loose cable, but that is not the case. What could be a possible cause?

Answers

It needs an Operating System like a cable or something that will help it operate look for more and double check

what is a film interpretation

Answers

Answer:

Interpretation of film language refers to an analysis using such factors as frames and shots, both denoted (literal meaning, what the audience see) and connoted (deeper meaning, what the audience may think).

Explanation:

*Hope this helps*

Answer:

What is a Film Interpretation?

Film interpretation is the process in which a film is analyzed in terms of scene, cinematography, sound (audio), graphics (video) and editing. One way of analyzing films is by shot-by-shot analysis, though it is only used for small clips or scenes.

C++ Write a program that initially asks a user to enter two positive integer numbers a and b. If either a or are zero or negative, the program terminates right away. Then, generate an array of 20 integer numbers, each randomly generated between a and b. If b happens to be greater than a, then the array must contain elements randomly generated between b and a. Display the whole array on the screen. After creating and displaying the array, the program shows:
[A]verage [S]um [F]ind Please choose an option: Then, if the user selects:
- A (lowercase or uppercase): the program computes and displays the average of all elements of the array
-A (lowercase or uppercase): the program computes and displays the average of all elements of the array
-F (lowercase or uppercase): the program asks the user to insert an integer number to be found in the array
If present, the program displays "Found in position number followed by the position of the first occurrence.
If not present, the program displays "Number not found in the array"

Answers

Answer:

#include <iostream>

#include <algorithm>

using namespace std;

int main(){

   int a, b, c[20], search, maxi, mini, totalSum = 0;

   char option;

   int * p;

   cout<< "Enter value for a: ";

   cin>> a;

   cout<< "Enter value for b: ";

   cin>> b;

  if (a == 0 || b == 0){

      cout<< "Both values must be greater than zero.";

  } else if(a>b){

        maxi = a;

       mini = b;

   }

else{

        maxi = b;

        mini = a;

   }

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

        c[i] = (rand() % maxi) + mini;

        totalSum += c[i];

    }

   cout << "Please choose an option: 1 , 2, 3 ";

   cin>> option;

   option = tolower(option);

   switch(option){

       case 1:

           cout << "The Average of the array items is: "<< totalSum/20;

           break;

        case 2:

           cout<< "The sum of the array items is: "<< totalSum;

           break;

       case 3:

            cout<< "Enter number to be searched: ";

            cin>> search;

             p = find (c, c+20, search);

             if (p != c+20)

{

                cout << "Element found in c array: " << *p << '\n';

             }else{

                 cout << "Element not found in c array\n";

             }

             break;

   }

}

Explanation:

The C++ source code prompts the user for the a,b, option and search values and executes either of the options from the switch statement.

Answer:

#include <iostream>

#include <algorithm>

using namespace std;

int main(){

int a, b, c[20], search, maxi, mini, totalSum = 0;

char option;

int * p;

cout<< "Enter value for a: ";

cin>> a;

cout<< "Enter value for b: ";

cin>> b;

if (a == 0 || b == 0){

cout<< "Both values must be greater than zero.";

} else if(a>b){

maxi = a;

mini = b;

}

else{

maxi = b;

mini = a;

}

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

c[i] = (rand() % maxi) + mini;

totalSum += c[i];

}

cout << "Please choose an option: 1 , 2, 3 ";

cin>> option;

option = tolower(option);

switch(option){

case 1:

cout << "The Average of the array items is: "<< totalSum/20;

break;

case 2:

cout<< "The sum of the array items is: "<< totalSum;

break;

case 3:

cout<< "Enter number to be searched: ";

cin>> search;

p = find (c, c+20, search);

if (p != c+20)

{

cout << "Element found in c array: " << *p << '\n';

}else{

cout << "Element not found in c array\n";

}

break;

}

}

Explanation:

The C++ source code prompts the user for the a,b, option and search values and executes either of the options from the switch statement. Is correct

Explanation:

Great work person above me! :)

What is the next line?
>>> tupleOne = [2, 5, 10, 23, 5, 1]
>>> tupleOne.index(5,3)
A)2
B)4
C)1
D)3

Answers

Answer:

4

Explanation:got it right on edg.

Answer: 4

Explanation: got it right on edgen

Which will you see on the next line 9, 2, 3.5, 7]

Answers

Answer:

plenipotentiaries. It was by far the most splendid and

important assembly ever convoked to discuss and

determine the affairs of Europe. The Emperor of

Russia, the King of Prussia, the Kings of Bavaria,

Denmark, and Wurttemberg, all were present in

person at the court of the Emperor Francis I in the

Austrian capital. When Lymie put down his fork and

began to count them off, one by one, on the fingers

of his left hand, the waitress, whose name was Irma,

thought he was through eating and tried to take his

plate away. He stopped her. Prince Metternich (his

right thumb) presided over the Congress, and

Prince Talleyrand (the index finger) represented

France? please let me know if this is the answer you were looking for!!

Answer:

I guess 6.......maybe or 1 kinda.....

I am dumb for this question

FELLING GENEROUS GIVING AWAY POINTS:)


Who plays Lol btw (league of legends)
ADD me ign : Davidoxkiller (euw server)

Answers

Answer:

thanksssssssss

A switch is a device that connects multiple computers into a network in which multiple communications links can be in operation simultaneously. True False

Answers

Answer:

True

Explanation:

A network switch is also called switching hub or a bridging hub. It is a device that connects multiple computers into a network in which multiple communications links can be in operation simultaneously. It makes use of Mac addresses in the forwarding of the data link layer (layer 2) of the OSI model. Types include managed switches, unmanaged switches, smart switches but to mention a few.

NEED HALP ASAP!!!
giving out brainiest
What does output allow a computer to do?
O Display information
O Receive information
B
Do complex math problems
Do math problems quickly

Answers

Answer:number one

number one

Explanation:

Answer:

a

Explanation:

Select all examples of proper keyboarding technique.

Look at the keys while keyboarding.
Keep your hands higher than your elbows.
Sit up straight.
Relax your fingers.
Aim to make no mistakes.

Answers

Answer:

all except keeping your hands higher than your elbows

Answer:

Sit up straight.

Relax your fingers.

Aim to make no mistakes.

Explanation:

Where the heck is the leader board?

Answers

Good question I’m wondering as well

I HAVE NO IDEA WHERE THE LEADERBOARD IS #### #### #### #### #### ####.

Asymmetric encryption uses only 1 key.

A)
False

B)
True

Answers

A.) false

Symmetric encryption uses a single key that needs to be shared among the people who need to receive the message while asymmetric encryption uses a pair of public key and a private key to encrypt and decrypt messages when communicating.
A) false is the answer

Drag the tiles to the correct boxes to complete the palrs.
Match the types of letters with their descriptions.
letter of interest
cover letter
thank you letter
letter of recommendation
discusses how you meet job requirements
>
reiterates why you're the best candidate for the job
>
tells more about your character and who you are
expresses your interest in working for a company

Answers

Answer:

Letter of interest> tells you more about your character and who you are expresses your interest in working for a company

Letter of recommendation> reiterates why you're the best candidate for the job

Cover letter> discusses how you meet job requirements

Hope this helped!

Answer:

Discusses how you meet job requirements = Cover Letter

Expresses your interest in working for a company = Letter of Interest

Tells more about your character and who you are = Letter of Recommendation

Reiterates why you're the best candidate for the job = Thank You Letter

Can someone help me with this ?

Answers

Answer:

I assume you want to set the opacity (0-100) depending on the mouse's coordinate on the screen. The variables indicating the mouse's coordinates are mouseX and mouseY.

To achieve this, you will need to divide the mouseX/mouseY (whichever you choose) by 4 to what's called "normalize" it. If your mouse was at 320 for example... Dividing it by four would give you 80, and this works because the bounds that the opacity can be set to is 0-100.

normalized = mouseX / 4

Circle(mouseX, mouseY, 50, fill='navy', opacity=normalized)

...or if you want to do it in one line...

Circle(mouseX, mouseY, 50, fill='navy', opacity=mouseX / 4)

Which type of error occurred in the following lines of code?


>>> print(9 / 0)

Traceback (most recent call last):

File " ", line 1, in

9/0

ZeroDivisionError: division by zero
Answer choices:
reserved word error

logical error

exception

syntax error

Answers

Answer: Logical Error

The division by 0 is a logical error.

what feature should be used before a document is printed

Answers

Print preview is a feature that displays on the screen what a hard copy would look like when printed. By using print preview, you can find any errors that may exist or fix the layout before printing, which can save ink or toner and paper by not having to print more than once.

How would you change your prompt to have it display the current time (hour and minute) and the full path of the current directory?

Answers

Answer:I tried using following command:

Code:

export PS1="$(date +%k:%M:%S) $ "

but it gave me a fixed time in prompt whereas my objective is to get the current time everytime.

Code:

$ export PS1="$(date +%k:%M:%S) $ "

17:42:42 $

17:42:42 $ date

Tue Oct  2 17:42:54 PDT 2012

17:42:42 $

Explanation:

Which feature is being used when connecting a device to the network using an electrical outlet?

Answers

Answer:

In other words, a WiFi bridge can convert Ethernet to WiFi. WiFi bridges can be high-performance and can support more WiFi network types than the T7-Pro can.

xbox one is not turning on and power brick is orange why is that?​

Answers

Answer:

the power supply is working fine but has been set to energy-saving power mode.

Explanation:

A steady orange light on the power brick means that the power supply is working fine but has been set to energy-saving power mode. This happens as a safety precaution when a power surge is detected. In order to fix this, you must first unplug the power brick from both the Xbox one and the wall socket. Next, you have to leave the power brick disconnected for about 30 seconds to a minute so that the energy completely fades. Finally, plug back in the cable and restart your console. It should now have a steady white light and be back to functioning perfectly.

Explain how a stored procedure is processed by the DBMS query processor (including the type of return value after the query is processed

Answers

Answer:

The stored procedures in DBMS can be executed with;

EXEC procedure_name

It can also be executed with single or multiple arguments with

EXEC procedure_name (use the at tag here)Address= data1, (use the at tag here)Address= data2;

It returns a status value of the queried table.

Explanation:

A stored procedure is a subroutine used in SQL servers to perform a task on a table in a database or the database itself. The syntax for creating a stored procedure is;

CREATE PROCEDURE procedure_name

And then, other statements can be written to be executed when the procedure is called.

Other Questions
Describe the scope of the variables in this code.class pet: def __init__(self,strSpecies,strName): self.species = strSpecies self.petName = strName def __str__(self): return self.species + " named " + self.petName def changeName(self, newName): self.petName = newNameclass petCarrier: size = 'medium' color = 'red'The scope of petName ______.The scope of color is ______.Accessible to the entire programlimited to the petCarrier classlimited to the pet class(both of the blanks need one of those answers) Help please i dont get thiss There are 10 fruits in a basket and 5 of them are apples. Write the ratio in simplest form. Fill in the blanks below with a vocabulary word in Spanish that makes senseaccording to the story.1. Las _________ (people) gritan mucho porque los piratas ________ (enter) en Puerto del Prncipe.2. l captura a muchas personas porque l necesita el mapa. Por eso, l ______ (wants) informacin del mapa.3. Los piratas usan _______(tactics) agresivas y ______ (torture) las vctimas cuando no hablan.4. Henry captura a Carlos pero no Felipe porque l ______ (runs) rpidamente. Carlos no es rpido porque l es _________ (fat).5. Carlos habla a Henry porque Henry ______ (points) con la pistola a la mano de Carlos. Henry dice que Carlos no necesita los ______ (fingers) para hablar. which scenario involves individual who seek medical adviceA) joel has abnormal drainage from his earsB) drew feels exhausted after a long work weekC) jacob has a stomachache after eating thanksgiving dinnerD) nice developed a headache while staring at the computer for hours I'm getting braces in like 45 minutes help!!! PLEASE HELP IN SPANISH!!!Ahora contesta unas preguntas sobre el juego que acabas de realizar. Piensa y compara el texto que result con las palabras que escribiste y el texto original. 1. Se parecen mucho los dos textos o son muy diferentes? 2. Cmo result el tuyo?, gracioso?, disparatado?, sin ningn sentido? Explica por qu. Use the relationship between the angles in the figure to answer the question.Which equation can be used to find the value of x? x+4928=180 x4928=180 x + 49 + 28 = 180 x + 28 = 180Three lines making six angles with the top left angle at twenty eight degrees, the top right angled at forty nine degrees and the bottom middle angle at x degrees An object launched straight puwar from the ground level wiht an initional velocity of 32 feet per second.The formula H=32T-16T^2 gives it heigtht,h,in feet after t second. At what time does the object hit the ground? Select the correct text in the passage. In this excerpt from the Emancipation Proclamation, which phrase or sentence supports the claim that President Lincoln did not want the slaves to take up arms against their former masters? I do order and declare that all persons held as slaves within said designated States and parts of States are, and henceforward shall be free and that the Executive Government of the United States, including the military and naval authorities thereof, will recognize and maintain the freedom of said persons. And I hereby enjoin upon the people so declared to be free to abstain from all violence, unless in necessary self-defense; and I recommend to them that, in all case when allowed, they labor faithfully for reasonable wages. And I further declare and make known that such persons of suitable condition will be received into the armed service of the United States to garrison forts, positions, stations, and other places, and to man vessels of all sorts in said service. And upon this act, sincerely believed to be an act of justice, warranted by the Constitution upon military necessity, I invoke the considerate judgment of mankind and the gracious favor of Almighty God. Sound waves are waves that require particles to vibrate, Sound wavescannota.travel around cornersb.move through solidsc.be heard underwaterd.transmit through empty spacehodieram You are called to investigate a lake in your home town, where the residents fear that a broken pipe from the local sewage treatment plant has turned the formerly pristine lake eutrophic. You test the water and find very low levels of oxygen. What stage of euthrophication is this lake in? Solve for side BA(show your work) jerry started doing sit ups everyday. the first day he did 19 sit-ups. everyday after he did 4 more sit-ups than he had than the previous day. Today jerry did 81 sit-ups. write an equation that could be solved to find the number of days jerry has been doing sit-ups, not counting the first day. let n represent number of days. Help Please this is hard . Casey took 25 tests in 135 days. At this rate, in how many days will she take another 10 tests? You may use the ratio table below to help. -21+(-59) what is the answer Point O is on line segment NP . Given NP=18 and , NO=10, determine the length OP . What effects does cell differentiation have? Please help I will give Brainliest. a carton of orange juice contains 540ml a special offer carton contains an extra 35% how many millilitres are in the special offer carton?