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
scZoUnD [109]
3 years ago
5

java A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "n

ever odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome. Ex: If the input is: bob the output is: bob is a palindrome
Computers and Technology
1 answer:
son4ous [18]3 years ago
7 0

Answer:

import java.util.Scanner;

public class num8 {

   public static boolean isPali(String word)

   {

       int i = 0, j = word.length() - 1;

       // compare characters

       while (i < j) {

           // check for match

           if (word.charAt(i) != word.charAt(j))

               return false;

           i++;

           j--;

       }

       return true;

   }

   // Main Method

   public static void main(String[] args)

   {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a word to test for palidrone");

       String str = in.nextLine();

       if (isPali(str))

           System.out.print(str+" is Palidrone");

       else

           System.out.print(str+ "is not palidrone");

   }

}

Explanation:

  • Create a method that returns a boolean called isPali().
  • Using a while statement check if if (word.charAt(i) != word.charAt(j)) given that i = starts at 0 and j starts at last character in the word. If there is match for each character, return true else return false
  • In the main method use the scanner class to prompt user for a word
  • call the method isPali() and pass the word entered as argument.

You might be interested in
How to get on website?
Nitella [24]

Answer:

You are probably blocked from that website or your schools program blocks that website from your device

Explanation:

4 0
3 years ago
Press the ENTER key to do what?
Blababa [14]
Change the line in word, it basically returns
7 0
3 years ago
You are planning to install Windows 10 on a computer in a dual-boot configuration. The computer already has Windows 8 installed.
aniked [119]

Answer:

Shrink the primary partition and create a simple volume for Windows 10.

Explanation:

The EFI’s partition space, after it is shrunk, will not be enough to install your Windows 10 since by default; it can only hold a maximum space of about 250MB to 500MB. Some windows versions call this partition EFI while others refer to it as system reserved. Windows uses EFI partition to hold on to essential components that make your PC boot like boot loaders, system utilities, and a few more.

The answer is B.

When you shrink your volume, whether it is local disk C or a primary partition with plenty of free space, it will create unallocated space. Right click on the unallocated space and create a New Simple Volume that will let you format your partition, assign a drive letter, and install your Windows 10 Operating System.

5 0
3 years ago
Read 2 more answers
To rearrange the data on your hard disk so your computer can run more efficiently, you use ____.
Ratling [72]
A disk optimization program, but they're probably looking for defragmenting program.
5 0
3 years ago
__________ is a website that offers a variety of Internet services from a single, convenient location.
VLD [36.1K]

Answer:

Portal is the correct answer.

Explanation:

A portal is a website that is a web portal which is not just like the website because the web portal provides different things from an individual access point. It also offers its customers or users a variety of services from an individual and convenient location. That's why the following answer is correct.

5 0
3 years ago
Other questions:
  • Finding information on the web was made easier by _____________, which provide on-screen menus, making navigation of the web as
    12·1 answer
  • Using the _____ model brings sellers and buyers together on the web and collects commissions on transactions between these parti
    5·1 answer
  • A page with no meaningful content that is full of ads and the webmaster makes money from if someone clicks on them is called____
    7·1 answer
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • Which question about whale sharks is nonscientific?
    11·2 answers
  • What is the value of the variable result after these lines of code are executed?
    11·1 answer
  • Which function category is not in Excel 2016?
    12·2 answers
  • How does xm satellite deter nonsubscribers from listening to its transmissions? Does this make the radio programing a private go
    10·1 answer
  • What is the following file format called? inv_nbr, inv_name, inv_cost 876521,battery,45.00
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!