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
andrew-mc [135]
3 years ago
15

JAVA In this exercise, you are given a phrase that starts with ‘A'. If the word after ‘A' begins with a vowel, add an ‘n' after

the ‘A', otherwise, return the phrase as is. Example: grammer("A word") --> "A word" grammer("A excellent word") --> "An excellent word" public String grammar(String phrase) { }
Computers and Technology
1 answer:
stiks02 [169]3 years ago
4 0

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

   

 System.out.println(grammar("A excellent word"));

}

public static String grammar(String phrase) {

    if (phrase.charAt(2) == 'a' || phrase.charAt(2) == 'e' || phrase.charAt(2) == 'i' || phrase.charAt(2) == 'o' || phrase.charAt(2) == 'u')

        return "An" + phrase.substring(1);

    else

        return phrase;

}

}

Explanation:

Create a function called grammar that takes one string parameter, phrase

Check if the character after "A", is one of the vowels, using charAt function. If it is, then insert "n" after "A". (To insert "n", concatenate two parts: "An", and the substring of the initial string after A).

Otherwise, return the initial string

You might be interested in
Explain the importance of determinism in an industrial LAN
nevsk [136]

Explanation:

 Determinism in an industrial local area network (LAN) basically improve the network and allow different types of technology use in various applications.

It basically refers to the network communication that uses various types of technology in the system like time scheduling to improve the deterministic real-time communication. It basically improve the transmission and provide ability to transfer data from one point to another.

The main importance of industrial LAN that it provide more flexible and efficient ethernet network in the system. It provide communication and interconnect various types of devices in the internet for efficient communication.

3 0
4 years ago
all of the following are new technology-related trends in mis except: group of answer choices the mobile digital platform. iot.
Bess [88]

The option that is note a new technology-related trends in MIS is co-creation of business value.

<h3>Technology and Management Information System:</h3>

Technology and Management Information System is known to be a term that connote the way a person can know or understand data that is obtained from a lot of units and departments of an organization.

Note that It can be used in the area of integration with other types of technology and as such, The option that is note a new technology-related trends in MIS is co-creation of business value.

Learn more about  business value from

brainly.com/question/25528419

#SPJ1

5 0
2 years ago
This is a legitimate question if you have a problem then just ignore it. What is the difference between CRVM and SAPX in a progr
g100num [7]

Answer: SAPX is used with Java

Explanation:

4 0
3 years ago
Read 2 more answers
How many instructions can the microprocessor execute each second if the assembly line is present?
SpyIntel [72]

The instructions that he microprocessor can execute each second if the assembly line is present will be depending on the workload and the architecture’s core because it is all depending on the speed of the CPU and the multiplier that it acquires.

3 0
3 years ago
can I join some1 zoom meeting just for fun but some1 else do something funny or something I WONT BE DOING ANYTHING FUNNY IM TO S
Gelneren [198K]

Answer:

yes

Explanation:

3 0
3 years ago
Other questions:
  • Aubrey didnt like to use graphics or images on her slides. She preferred to use only a title for her slides and bullet-poinged t
    14·2 answers
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • Which port-authentication network access control standard forces devices to go through a full authentication, authorization, and
    13·1 answer
  • Read each statement below. If the statement describes a peer-to-peer network, put a P next to it. If the statement describes a s
    12·1 answer
  • Which of the following is an advantage of using
    6·2 answers
  • Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The String
    9·1 answer
  • A device that filters data traffic at a network boundary​
    14·1 answer
  • The main part of your program has the following line of code.
    7·1 answer
  • Write a statement that slices a substring out of the string quote and puts it into a variable named selection. If given the stri
    8·1 answer
  • The three main objectives of information security are
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!