1answer.
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
zzz [600]
4 years ago
15

Write a function checkPalindrome that accepts a single argument, a string. The function should return true (Boolean) if the stri

ng is a palindrome, false if it is not. Make sure your function will give the correct answer for words with capital letters.
Computers and Technology
1 answer:
Vsevolod [243]4 years ago
5 0

Answer:

Following are the program in the Java Programming Language.

//define function

public static boolean checkPalindrome(String str){

//set integer variable to 0

int a = 0;

//set integer variable to store the length of the string

int n = str.length() - 1;  

//set the while loop to check the variable a is less than the variable n

while(a<n)

{

//check the string character is not in the variable n

if(str.charAt(a)!= str.charAt(n))

//then, return false

return false;  

//the variable a is incremented by 1

a++;

//the variable n is decremented by 1

n--;

}

//and return true

return true;

}

Explanation:

<u>Following are the description of the following function</u>.

  • Firstly, we define boolean type public function that is 'checkPalindrome' and pass string data type argument 'str' in its parameter.
  • Set two integer data type variables that are 'a' initialize to 0 and 'n' which store the length of the string variable 'str' decremented by 1.
  • Set the While loop that checks the variable 'a' is less than the variable 'n', then we set the If conditional statement to check that the string character is not in the variable n then, return false.
  • Otherwise, it returns true.
You might be interested in
Why does the position of drawCircle(x, y, r) in the answer choices matter?
Andrei [34K]

Answer:

B and C

Explanation:

xPos and yPos determine the center of the circle, and rad determines the radius of the circle drawn.

It cannot be A because it starts drawing a circle with the center of (4, 1). None of the circles ahve a center at (4, 1). It is B because while it does start at (4, 1), the repeat function adds one to the y and radius. While ti repeats 3 times it ends up drawing all 3 circles. C also works because it starts by drawing the biggest circle and then subtracting the values to make the other two. It cannot be D because in the repeat function it subtracts from the y value and radius too early, it doesn't draw the biggest circle.

6 0
2 years ago
In a java class, variables can be present both inside and outside of methods. question 9 options:
Tems11 [23]
The correct answer is: True

Explanation:

Consider the following program:
<span>class Main {
int a = 10;
public static void main(String[] args) {
add();
}

private static void add() {
int b = a+20;
System.out.println(b);
}<span>
}


The output of the above program is 30. As you can see the variable a is declared outside the method, whereas variable b is declared inside the method.</span></span>
3 0
4 years ago
Three reasons why users attach speakers to their computers.
ZanzabumX [31]

Answer:

Iv'e answered this question 2 times already lol. The purpose of speakers is to produce audio output that can be heard by the listener. Speakers are transducers that convert electromagnetic waves into sound waves. The speakers receive audio input from a device such as a computer or an audio receiver.

Explanation: I hope this helps!

8 0
3 years ago
Describe and list advantages and disadvantages of each of the following backup types:
crimeas [40]

Answer:

Full back up

It creates complete copy of the source of data. This feature made it to the best  back  up with good speed of recovery of the data and  simplicity.However, because it  is needed for backing up  of  a lot of data, it is time consuming process,Besides it also  disturbs the routine application of  the technologist infrastructure. In addition large capacity storage is needed  for the  storage of  the large volume of back up with each new creation.

Incremental back up: back up work at high speed thus saves time, Little storage capacity is needed. This type of back up can be run as  many time as wished.

However, the restoration of data takes time, due to the time spent for restoration of initial back up and the incremental.

Differential Back up has very fast back up operation, because it only requires two pieces of back up.This is however slower compare to the Incremental.

The selective back up enable selection of certain type of file or folders for back up.

it can only be used to back up folders only when important data  are needed only.Thus the  storage capacity is low.

CPD eliminates back up window and reduces the recovery point objective.However, it has issue of compatibility with the resources to back up.,it is also expensive because its solutions are disk based.

Cloud based is affordable and save cost,It is easier to access. it is efficient,it can be access remotely for convenience.

However, Internet sources and some bandwidth must be available for access., always depends on third party providers,There is also problems encountered when switching providers.

Explanation:

8 0
3 years ago
Which term refers to actions that you would typically perform on a computer to revive it even if it functions in an unexpected m
sweet-ann [11.9K]
You'd usually reboot a PC if it malfunctions.
6 0
3 years ago
Other questions:
  • Which action could be used to determine if a host is compromised and flooding traffic onto the network?
    6·1 answer
  • Which of the following statements is false? a. Each object of a class shares one copy of the class's instance variables. b. A cl
    11·1 answer
  • How does computer network work in a paragraph
    12·1 answer
  • You need to delegate AD RMS responsibilities to a junior administrator. You don't want to give the administrator more permission
    14·1 answer
  • What are two most common types of microcomputers? a. IBM-style PCs and Macs c. Clients and Servers b. Mainframes and Minicompute
    14·1 answer
  • Consider the following declaration.int[] alpha = new int[3];Which of the following input statements correctly input values into
    12·1 answer
  • Which expression is equivalent to 3x + 3x + 3x?<br><br> From Performance Matters
    11·2 answers
  • कम्प्युटर को पहिलो पुस्ता भनेको के हो?​
    8·2 answers
  • Which of the following describe the characteristics of a good logo? Choose all that apply. It is a complex design It is memorabl
    12·1 answer
  • Fill in the blank: the final step of the dhcp discovery process is known as ______. Multiple choice, shuffle.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!