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
brilliants [131]
3 years ago
12

Write a void method called palindromeCheck that takes NO argument. The method should have functionality to check whether or not

the word is a palindrome and print to the screen all of the palindromes, one per line. Also, the last line of the output should have the message: "There are x palindromes out of y words provided by user" (where x is the number of palindrome words detected, and y is the total number of words entered by user). Hint: for this lab exercise you will need the following methods on String objects: length() gives the length of a string (that is, the number of characters it contains) and charAt(i) - gives the character at position i.
Computers and Technology
1 answer:
finlep [7]3 years ago
8 0

Answer:

Explanation:

import java.util.Scanner;

public class PalindromeCheck

{

public static void palindromeCheck()

{

String someWord=" ";

int count=0;

int total=0;

System.out.println("Ënter some words entered by whitespace");

Scanner keyboard =new Scanner(System.in);

String[] words=keyboard.nextLine().split(" ");

for(int i=0;i<words.length;i++)

{

boolean flag=true;

int l=words[i].length();

for(int j=0;j<=l/2;j++)

{

if(words[i].charAt(j)!=words[i].charAt(l-j-1))

{

flag=false;

break;

}

}

if(flag)

count++;

}

System.out.println("There are "+count+" palindromes out of "+words.length+" words");

keyboard.close();

}

public static void main(String[] args)

{

palindromeCheck();

}

}

Output

Ënter some words entered by whitespace

This is a malayalam.

There are 3 palindromes out of 4 words

You might be interested in
What would a world where we have 2^128 (340 undecillion) Internet connected devices look like? How could that much Internet usag
cluponka [151]

A world  have 2^128 (340 undecillion) of IPv addresses that helps to connect to the internet. IPv6 addresses can make it easier for working organizational teams connecting to the Internet, IP addresses that are created by IPv6 are 128 bits.

<h3>What is internet?</h3>

Internet is the system  uses the Internet protocol suite (TCP/IP)  and interconnected computer networks that communicate between two or more individuals.

Today, almost 20 IP addresses are taken by7 each home for each electronic device. The internet usage is so wide, that even a simple task  is not possible without it. Even a simple task can be done using internet.

Learn more about internet.

brainly.com/question/13308791

#SPJ1

5 0
2 years ago
A normal HDMI signal has a colour depth of 8 bits per each of RGB colour. The maximum number
Marysya12 [62]

Answer: B

Explanation:

if each color can be represented as 8 bits and you have 3 colors total that would mean you would need 24 bits to represent the entirety of the RGB spectrum. And each bit can either be on or off so you have two choices for each one. So the total amount of colors you can have for 8bit RGB would be 2^{24} which is 16,777,216.

6 0
3 years ago
Use computer magazines and/or the internet to investigate one of these DBMSs: DB2, SQL Server, MySQL, Oracle, or Sybase. Prepare
tigry1 [53]

Answer:

The definition for the problem is listed in the section below on the explanations.

Explanation:

<u>For SQL Server</u>

  • Data Recovery: Data recovery is done well on SQL Server. It is achieved by the restoration method. Behind this, a sysadmin must reconstruct a collection of SQL backups throughout a restore series that is technically right as well as relevant.
  • Data Security: There are several approvals as well as limits for accessing main data objects or databases. These data are accessed only by the approved clients.
  • Concurrency Control: This is essentially synchronization of the evidence or information accessed by multiple users as well as from separate locations.

Concurrency or Competitiveness control becomes accomplished with SQL Server Portable, using locking to further improve security. The locking regulates how multiple individuals can simultaneously navigate & alter shared storage, without interfering with one another.

8 0
3 years ago
PLEASE HELP ASAP!!!!!!!!!!!
Bingel [31]

Answer:

True

Explanation:

3 0
3 years ago
Read 2 more answers
In terms of computer networking. what is PING?
Andrew [12]
Ping means how much of a delay there is in your connection. The lower the ping, the smaller the delay. This plays an important role in online gaming. If your ping is 350, then your delay is 350ths of a second.

3 0
3 years ago
Other questions:
  • .What is a wildcard character? How would you use it to find a record?
    15·1 answer
  • Joshua wants to be a lawyer. He found the following table on the Bureau of Labor Statistics’ website to find out about the emplo
    13·2 answers
  • Describe how the Internet Protocol (IP) allows devices to easily connect and communicate on the Internet.
    12·2 answers
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • ​what is the difference between a normal mouse and trackball? What do you think. ​​​​
    7·1 answer
  • Computer is a major source of informarion why​
    8·1 answer
  • bailey reads wikis at the beginning of his research project to get his bearings on the topic. he switches to peer-reviewed journ
    10·1 answer
  • Reflection image and design
    12·1 answer
  • URGENT! Drag the tiles to the correct boxes to complete the pairs.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!