answer.
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
Crazy boy [7]
2 years ago
8

In Java please:

Computers and Technology
1 answer:
Nana76 [90]2 years ago
6 0

Answer:

See explaination

Explanation:

public class PalindromeChange {

public static void main(String[] args) {

System.out.println("mom to non palindrom word is: "+changTONonPalindrom("mom"));

System.out.println("mom to non palindrom word is: "+changTONonPalindrom("aaabbaaa"));

}

private static String changTONonPalindrom(String str)

{

int mid=str.length()/2;

boolean found=false;

char character=' ';

int i;

for(i=mid-1;i>=0;i--)

{

character = str.charAt(i);

if(character!='a')

{

found=true;

break;

}

}

if(!found)

{

for(i=mid+1;i<str.length();i++)

{

character = str.charAt(i);

if(character!='a')

{

found=true;

break;

}

}

}

// This gives the character 'a'

int ascii = (int) character;

ascii-=1;

str = str.substring(0, i) + (char)ascii+ str.substring(i + 1);

return str;

}

}

You might be interested in
Which of the following option is correct about HCatalog?
adell [148]

Answer:

Option (3) is the correct answer of this question.

Explanation:

  • HCatalog makes available Hive metadata to users of other Hadoop applications, such as Pig, MapReduce and Hive. it offers interfaces for MapReduce and Pig so that users can read data from and write data to the Hive warehouse.
  • This means users don't have to care about where or in what format their data is stored. So we know this way that Hcatalog makes sure our data is secure.
  • Others option does not belong to Hcatalog so these options are incorrect .

8 0
2 years ago
One form of competition-based pricing is going-rate pricing, inwhich a firm bases its price largely on competitors' prices, with
Kobotan [32]

Answer:

Out of the four options , the option that is most suitable  is

option b. Cost, demand

<u>cost</u> or to <u>demand</u>

Explanation:

Going rate pricing is a form of competition based pricing. This pricing is commonly used for homogeneous products i.e., products with very minute distinction or variation among producers.

This type of pricing is based on setting price on the basis of the prevailing market trends in pricing of goods or services, so, the prices are largely based on the competition in the market rather than considering its own cost and demand.

8 0
2 years ago
Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", output is:9_Hint: Use two if
Mashcka [7]

Answer:

Following is given the code as required.

I hope it will help you!

Explanation:

7 0
2 years ago
Translate each of these statements into logical expressions using predicates, quantifiers, and logical connectives. a) Something
yKpoI14uk [10]

Answer:

Let P(x) = x is in the correct place

Let Q(x) =  x is in the excellent place

R(x) denotes the tool

Explanation:

a) Something is not in the correct place.

P(x) is that x is in the correct place so negation of ¬P(x) will represent x is not in the correct place. ∃x is an existential quantifier used to represent "for some" and depicts something in the given statement. This statement can be translated into logical expression as follows:

                                                    ∃x¬P(x)

b) All tools are in the correct place and are in excellent condition.

R(x) represents the tool, P(x) represents x is in correct place and Q(x) shows x is in excellent place. ∀ is used to show that "all" tools and ∧ is used here because tools are in correct place AND are in excellent condition so it depicts both P(x) and Q(x). This statement can be translated into logical expression as follows:

                                       ∀ x ( R(x) → (P(x) ∧ Q(x))

c) Everything is in the correct place and in excellent condition.

Here P(x) represents correct place and Q(x) represents excellent condition ∀ represent all and here everything. ∧  means that both the P(x) and Q(x) exist. This statement can be translated into logical expression as follows:

                                              ∀ x (P(x) ∧ Q(x)

7 0
2 years ago
Your friends credit scores are 560, 675, 710, 590, and 640. Your credit score is 680. What is the difference between the average
Wittaler [7]

Answer:

560+675+710+590+640=3175/5=635

so your credit score is 45 credits better than the average of your friends

Explanation:

3 0
2 years ago
Other questions:
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • PowerPoint is a visual aid for many speakers. Discuss some points to remember when adding text to a PowerPoint presentation. How
    13·1 answer
  • A network design engineer has been asked to design the IP addressing scheme for a customer network. The network will use IP addr
    6·1 answer
  • Imagine that you have configured the enable secret command, followed by the enable password command, from the console. You log o
    12·1 answer
  • Use the image below to answer this question.
    14·1 answer
  • Suppose that, when you arrive at the sale site for $50 Apple laptops (described in the text) at 1:45 A.M., you find more than 2,
    8·1 answer
  • We have an internal webserver, used only for testing purposes, at IP address 5.6.7.8 on our internal corporate network. The pack
    15·1 answer
  • reAay ouyay aay hizway ithway igPay atin?Lay? (Translated: "Are you a whiz with Pig Latin?") Write a program that converts an En
    6·1 answer
  • To reduce costs and the environmental impact of commuting, your company decides to close a number of offices and to provide supp
    14·1 answer
  • Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!