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
vlada-n [284]
4 years ago
13

Write a modular program that allows the user to enter a word or phrase and determines whether the word or phrase is a palindrome

. A palindrome is a word or phrase that reads the same backwards as forwards. Examples include: civic, kayak, mom, noon, racecar, Never odd or even., and Was it a Rat I saw
Computers and Technology
1 answer:
Ostrovityanka [42]4 years ago
6 0

Answer:

import java.util.Scanner;

public class num10 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a word");

       String word = in.nextLine();

       String reversed = "";

       //Get the length of the string entered

       int length = word.length();

       //Loop through the string and reverse th string

       for ( int i = length - 1; i >= 0; i-- )

           reversed = reversed + word.charAt(i);

       //Compare the two strings "word" and "reversed"

       if (word.equals(reversed))

           System.out.println(word+" is a palindrome");

       else

           System.out.println(word+" is not a palindrome");

   }

}

Explanation:

Since we know that a palindrome word is a word that reads the same forward and backward, The Idea here is:

  • To obtain a word from a user.  
  • Use a for loop to reverse the word and store in another variable
  • Use if....else to compare the two strings and determine if they are equal, if they are equal then the word is palindrome.
You might be interested in
Refer to the exhibit. If a hacker on the outside network sends an IP packet with source address 172.30.1.50, destination address
Luden [163]

Answer:

The packet is dropped

Explanation:

To see why we need to understand the ACL or Access-control list that is a list of permissions that specify which users can access or modify certain things in a system. Because the source IP  doesn't have any parameter and is just a plain IP and packet the Cisco firewall will drop the packet based on the ACL rules, in other words, the Cisco firewall doesn't have any parameter that allows it to verify the permission-level of the sender, therefore, the packet will drop.  

7 0
3 years ago
consider l= 5 ,r= 11. you must determine the sum of the values of the function in the range L to R . you have to calculate sum =
4vir4ik [10]

def summation (num1, num2):

i = 0

for x in range (num1 : num2 + 1):

i += x

return i

print ( summation(l, r))

3 0
3 years ago
For which of the four game elements will you give a detailed description about the challenges that the player will face, such as
vaieri [72.5K]

The four game elements that will give you  a detailed description about the challenges that the player will face is option D: objective.

<h3>What goals does game development have?</h3>

To bring about creativity and originality in task completion and issue solving. to prepare pupils for group collaboration.

Note that giving the player a clear objective gives them something to aim for. Make sure the player can relate to this motivation.

Therefore, The most crucial component of a game can be its objectives, which determine how the game is won or lost, what the player is instructed to perform in-game, and what the player must do to gain optional <em>Achievements</em>.

Learn more about objective from

brainly.com/question/18516671
#SPJ1

3 0
1 year ago
Microsoft ____________________ is a complex, full-featured firewall that includes stateful packet filtering as well as proxy ser
Lesechka [4]

Answer:

Internet Security & Acceleration Server (ISA)

Explanation:

<h2><u>Fill in the blanks </u></h2>

Microsoft <u>Internet Security & Acceleration Server (ISA)</u> is a complex, full-featured firewall that includes stateful packet filtering as well as proxy services, NAT, and intrusion detection.

4 0
3 years ago
Which setting on a profile makes a tab NOT accessible in the All App Launcher or visible in any app, but still allows a user to
Levart [38]

Answer:

freezer

Explanation:

you can freeze your application and it won't show on your launcher till you unfreeze it

5 0
3 years ago
Other questions:
  • True or false over the course of ecological succession,species diversity increases over time?
    12·2 answers
  • 1.Write the Qbasic program to find sum of any 10 different numbers.
    12·1 answer
  • What function does a security certificate perform
    15·2 answers
  • Name the months that have 30 days​
    6·2 answers
  • What is the protocol developed for the wireless network communications? explain?
    8·1 answer
  • PHP can be run on Microsoft Windows IIS(Internet Information Server):
    5·1 answer
  • James would like to send a document he has saved on the hard drive to coworkers in Ireland, Brazil, and India. These coworkers h
    6·2 answers
  • Write C# program that will read name from keyboard and display it on screen. The program should throw an exception when the leng
    6·1 answer
  • What are different sheet icons
    5·1 answer
  • A user can add color to a database to highlight a modification. To do this with a macro, which command screen would you access o
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!