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
sleet_krkn [62]
3 years ago
12

Write a static boolean method named beginsWithZ. It should accept a String object as a parameter. It should return true if the f

irst character in the String is either of two characters: a capital ‘Z’, or a lowercase ‘z’. (Note: Check the parameter for a null value, and for an empty string. Nulls and empty strings do not start with an ‘z’.)
Computers and Technology
1 answer:
almond37 [142]3 years ago
6 0

Answer:

public static boolean beginsWithZ(String word){

if(string == null || string.length() == 0)

return 0;

if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')

return 1;

else

return 0;

}

Explanation:

This method is a boolean method, meaning it returns true if the string begins with Z or z and false otherwise. So:

The Java command charAt() let's you find the character at each position of the string, so i use it.

public static boolean beginsWithZ(String word){

if(string == null || string.length() == 0)

return 0;

if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')

return 1;

else

return 0;

}

You might be interested in
What is the difference between a crosstab query and a subquery?
shtirl [24]

Answer:

A crosstab query is a type of select query. ... When you create a crosstab query, you specify which fields contain row headings, which field contains column headings, and which field contains values to summarize. You can use only one field each when you specify column headings and values to summarize.

Explanation:

8 0
3 years ago
Read 2 more answers
On a chart created in excel, the horizontal axis is also called the ____.
Artyom0805 [142]
The chart<span> types created in Excel have two axes: a </span>horizontal axis  and a vertical axis. These charts are used to<span> illustrate the workbook data graphically in order to see trends.</span><span>
On a chart created in excel, the horizontal axis is also called the X axis. The vertical axis on the other hand is called Y axis.


</span>
3 0
3 years ago
Which fonts do not have a practical use in writing
kondaur [170]
To be honest with you, I don’t know but you can always look up on google “which fonts do not have a practical use in writing” and then there are links you can look up for the answer . Sorry but I don’t know which link is the best answer for your question ;) have a great day bro
8 0
3 years ago
Software intended to damage computer systems.
DIA [1.3K]

Explanation:

id 6488886211

pass 9999

7 0
3 years ago
Read 2 more answers
Write a function named ilovepython that prints out I love Python three times. Then, call that function.
Brums [2.3K]

Answer:

The program to this question can be described as follows:

Program:

def ilovepython(): #defining a method

   for i in range(3): #defining a loop that print messasge three times

       print('I love Python')#print messasge

ilovepython() #calling the method

Output:

I love Python

I love Python

I love Python

Explanation:

Description of the python program can be described as follows:

  • In the above Python program, a method "ilovepython" is defined, inside the method a for loop is used, inside the loop print method is used, that print the message "I love Python".
  • In python for loop is used to iterate over series and we can execute a set of statements with the loop, tuple, series, once for each element in the list.
8 0
3 years ago
Other questions:
  • Which best describes IMEI?
    7·1 answer
  • What is the keyboard shortcut to display the merge to printer dialog box?
    5·1 answer
  • Write a Bash script that takes the name of a file or directory as an argument, 1. reports if it is a directory or a file, and if
    14·1 answer
  • You can divide the code for an application into logical parts by moving some of the code from the main() method to other _______
    8·1 answer
  • write an algorithm and draw a flowchart to calculate the sum of of the first 10 natural numbers starting from 1​
    13·1 answer
  • An algorithm whose worst-case time complexity is bounded above by a polynomial function of its size is called a(n)
    13·1 answer
  • an attacker is attempting to crack a system's password by matching the password hash to a hash in a large table of hashes he or
    9·1 answer
  • ***URGENT***
    8·1 answer
  • If you wish to install a new OS without disturbing the old one so that you can boot to either OS, what type of boot setup should
    6·1 answer
  • Game Design!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!