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
The ______ network became functional in 1969, linking scientific and academic researchers across the United States. Group of ans
denis23 [38]

Answer:

The <u>ARPANET </u>network became functional in 1969, linking scientific and academic researchers across the United States.

Explanation:

ARPA Net is the network that has become functional in 1969 in united States. The basic purpose of this network is to link all the researchers and scientists across united states. The full form of ARPANet is Advanced Research Project Agency Network.

The importance of this network is increase because small chunks of data that are called packets has been proposed for data transmission in the network. The data is divided into small packets and send it over the network, at destination point these packets are combined together and become orignal information.

7 0
3 years ago
Read 2 more answers
You have a sales chart and excel that you want to include in a 3rd quarter report to include in a 3rd quarter report quit it in
Nataliya [291]

Answer:

The paste function to use is the Advanced Paste Function that reads Use Destination Theme and Link Data or Keep Source Formatting and Link Data.

Explanation:

The first function adopts the Theme (such as colors, fonts, and other formatting) whilst retaining links to the data in the excel workbook. The latter imports the formatting or theme as-is from excel.

In both scenarios, (for as long as both documents are open and are in the same file) when the data in excel is opened and updated, it reflects automatically in the chart on the Microsoft Word document.

Cheers

5 0
2 years ago
Which sns gets its names from one of its unique features
Komok [63]

Answer:

no

Explanation:

3 0
3 years ago
How long would you need to work at McDonalds to earn enough money to buy a optiplex 3050, monitor, mouse and keyboard all from d
r-ruslan [8.4K]
So assuming you were buying this piece of trash with the mouse and keyboard it would be around $450. Average pay per hour is $9.10-$10.20 depending on were you live so we will just say $9.50. You'd need to work rougly 47 hours (without taxes) So i'd say 65-75 Hours.
8 0
3 years ago
Read 2 more answers
Write a recursive definition of x^n, where n≥0, similar to the recursive definition of the Fibonacci numbers. How does the recur
Levart [38]

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

int recurs(int x, int n)//defining a method recurs that accepts two parameter

{

if(n==0)//defining if block that checks n value

{

return 1;//return value 1

}

else//defining else block

{

return x*recurs(x,n-1);//use return keyword that retun value

}

}

int main()//defining main method

{

cout<<recurs(5,3); //use print method to call recurs method

   return 0;

}

Output:

125

Explanation:

In the above-given program, the integer method "recurs" is declared which accepts, two integer variables, which are "x, n", inside the method the if conditional statement is used.

  • In the if block, it checks the value of n is equal to "0" if this condition is true, it will return a value, that is 1.
  • Otherwise, it will go to the else block, in this block, it will use the recursive method to print its value.    
5 0
3 years ago
Other questions:
  • Are there protections for people in terms of what data can be collected by different sites?
    10·1 answer
  • Merge arrays A and B into array C using merge sort algorithm. Give final sorted numbers of C using colored numbers without showi
    13·1 answer
  • Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    8·1 answer
  • Recall that through either photographic or computer technology, researchers can make a composite (or "averaged") face out of any
    11·1 answer
  • Choose the best technology device for the
    12·1 answer
  • At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase
    12·1 answer
  • To change the way a slide moves from one slide to the next, what tab should be selected?
    12·1 answer
  • What is the purpose of OPPA<br>​
    13·1 answer
  • Definition of powerpoint animation
    14·1 answer
  • Fill in the blank with the correct response.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!