Write a method, getFirstLine, that is passed a String argument and that returns the first line. (Recall that lines are terminated with the "\n" character.) Assume that the argument contains at least one complete, newline-terminated line.
My Solution:
public String getFirstLine(String a)
{
String[] myLines = a.split("\n");
return(myLines[0]);
}

Answers

Answer 1

Answer:  The answer to this question can be given as:

Method definition :

String getSecondLine (String aString) //define function getSecondLine()

{

return aString.substring(aString.indexOf("\n") + 1, aString.indexOf("\n") + 1 + aString.substring(aString.indexOf("\n") + 1, aString.length()).indexOf("\n"));

//return value.

Explanation:


Related Questions

Which of the following statements expresses why the following code is considered bad form? for (rate = 5; years-- > 0; System.out.println(balance)) . . . I. unrelated expressions in loop header II. doesn't match expected for loop idiom III. loop iteration is not clear II and III only I and II only I and III only I, II, and III

Answers

Answer:

l and ll only that is the answer

Answer:I , II , and III

Explanation:

Other than hard discs and flash discs, identify other three different storage media

Answers

Answer:

A storage media is any media that can store data.

1. USB flash memory

2. Memory stick

3. Floppy disk

Bharath has made a table of content for his document, in which he wants to make few changes, but he is unable to make the changes. Give reason. Explain how he can make the necessary changes.

Answers

Answer:

Explanation:

Microsoft Word has an automatic table of contents function that can automatically generate a table of contents for your document, provided you correctly tag the chapter headers and sub-headers that you wish to show in your table of contents.  Setting this up can be a time-consuming process, but if you are writing a lengthy document that will go through several drafts, the automatic Table of Contents can save you a lot of manual revising each time your page numbers or chapter titles change.

Step 1:  In order for Word to identify the headers and subheaders for your Table of Contents, you need to apply the appropriate "Heading" styles to your chapter and sub-chapter headers.

For example, to mark a chapter title as a Level 1 Heading, first select the text that you would like to appear as the chapter heading in the Table of Contents by clicking-and-dragging your cursor over it to highlight it.

A college marketing department has a networked storage device that uses the IP address 10.18.7.5, TCP port 443 for encryption, and UDP port 4365 for video streaming. The college already uses PAT on the router that connects to the Internet. The router interface has the public IP address of 209.165.200.225/30. The IP NAT pool currently uses the IP addresses ranging from 209.165.200.228-236. Which configuration would the network administrator add to allow this device to be accessed by the marketing personnel from home

Answers

Answer:

The answer to this question can be defined as follows:

Explanation:

The static NAT stands for (static Network Address Translation), which enables the user to modify a single interpretation for a local second-order to the external environment addresses, and all IP and port numbers were also transcribed inside to random traffic as well as from outside with the internal traffic.

It is used to map network traffic by an internal IP address from a static external IP address. It provides a fixed conversion for actual addresses onto maps. It offers Internet access to the network equipment via a private LAN with such a private IP address which is not recorded.Please find the attachment of the ip address.

A binary search function is searching for a value that is stored in the middle element of an array. How many times will the function read an element in the array before finding the value?

Answers

Answer: 1 time.

Explanation:

A binary function is also known as a half-interval search is a search algorithm to find the position of a given element x within a well-sorted array []. Binary search compares the target value to the middle element of the array.It ignores half of the elements just after one comparison. it compares x with the middle element.

So, the function read an element one time in the array before finding the value.

what is a good electric fan for your room?​

Answers

Answer:  a box fan

Explanation:

the get you really cold easily and its easy to turn off and on

Andy designed a web page for a product-oriented industry using CSS properties. He used several HTML tags to create the web page. He also used tables to ensure that the data is easily managed.
​Andy wants the borders to be distinctly visible for each cell in the product details table. Which of the following properties must Andy add to his code to accomplish his goal?
A. ​border-spacing: length;
B. ​border-collapse: separate;
C. ​border-collapse: collapse;
D. ​border-spacing: initial;

Answers

Answer:

CSS documentation

Explanation:

Use this CSS reference to browse an alphabetical index of all the standard CSS properties, pseudo-classes, pseudo-elements, data types, and at-rules. You can also browse a list of all the CSS selectors organized by type and a list of key CSS concepts. Also included is a brief DOM-CSS / CSSOM reference.

Locatiopn: https://devdocs.io/css/

The properties that Andy must add to his code to accomplish his goal is (B), border-collapse: separate.

What is border-collapse?

The border-collapse property in CSS determines how the borders of table cells are collapsed. The default value of border-collapse is collapse, which means that the borders of adjacent cells are merged together. To make the borders of the cells in Andy's table distinctly visible, he needs to set the border-collapse property to separate.

The other possible answers are incorrect. The border-spacing property determines the amount of space between the borders of adjacent cells. The border-spacing: initial value sets the border spacing to the default value, which is 0 pixels.

Find out more on CSS properties here: https://brainly.com/question/14918146

#SPJ2

Asia pacific and Japanese sales team from cloud kicks have requested separate report folders for each region.The VP of sales needs one place to find the reports and still wants to retain visibility of the reports in each folder. What should a consultant recommended to meet this requirement.

Answers

Answer:

B) Create all new regional folders and move the reports to the respective region folder with viewer access.

Explanation:

Below are the options

A) Create grouped folders, keeping the top region folder sharing settings and limiting the sharing settings for the grouped folders for each region.

B) Create all new regional folders and move the reports to the respective region folder with viewer access.

C) Create all new regional folders and move the reports to the respective region folder with subscribe access.

D) Create subfolders, keeping the top region folder sharing settings and limiting the sharing settings for the subfolders for each region

In order to required reports at one place and also wants to retain the visibility for each folder the consultant should suggest that all new regional folders should be created and afterwards it would be moved to their relevant region folders by involving the viewer access feature so that the VP should access it anytime

Hence, the correct option is B.

Based on the information given, the correct option will be B. Create all new regional folders and move the reports to the respective region folder with viewer access.

From the information given, it was stated that the VP of sales needs one place to find the reports and still wants to retain visibility of the reports in each folder.

Therefore, it's important to create all new regional folders and move the reports to the respective region folder with viewer access.

Learn more about folders on:

https://brainly.com/question/20262915

GuardIN is an IT security firm. It deals with highly secure data for a wide variety of software and e-commerce agreements, trademark licenses, and patent licenses. GuardIN needs a cloud computing option that would allow it to purchase and maintain the software and infrastructure itself. The cloud also needs to be designed in such a way that all users of the organization can access it without any lag. Which of the following cloud computing options would be most suitable for GuardIN?
A) A public cloud
B) A community cloud
C) A hybrid cloud
D) A private cloud

Answers

Answer:

D) A private cloud

Explanation:

Note we are told that GuardIN needs a cloud computing option that would allow it to purchase and maintain the software and infrastructure itself.

Thus, to be able to manage the cloud infrastructure itself; it implies buying it's own hardware equipments, which means it is best to use a private cloud computing option.

Doing so would give GuardIN the opportunity to design the cloud storage in a way that all users of the organization can access it without any lag.

BP measuring machine is an example of __________

A)Computing device
B)Medical device
C)Embedded machine
D)None of these​

Answers

Answer:

I think it is a Medical device.

BP = blood pressure

Explanation:

Write a pseudocode algorithm which inputs numeric scores and outputs how many of them are over 100. The end of the data is signalled by a user input of -1.

Answers

Answer:

calculateCountGreaterThan100()

{

declare variable count with zero

while True

 {

 input numeric values from user

 if user inputted value > 100

  increment the count

 if user inputted value == -1

  break the loop

 }

print the value of count

}

Explanation:

First of all, let us have a look at the meaning of a pseudocode:

A pseudocode is nothing but a informative way of expressing our code in simple plain English.

It is not written in programming language so it does not have any syntax rules.

Here, we are asked to write pseudocode algorithm for inputting numeric scores and output the number how many of them are greater than 100. The end of numbers is signalled by a user input of -1.

The answer is:

calculateCountGreaterThan100()

{

declare variable count with zero

while True

 {

 input numeric values from user

 if user inputted value > 100

  increment the count

 if user inputted value == -1

  break the loop

 }

print the value of count

}

Here, we have declared a variable with initial count as 0.

Then, in a loop we are taking input from user in which user is giving integer input.

If the value is greater then zero, the count is incremented.

If the value is -1, we come out of the loop and then print the count value.

Pseudocode algorithm are algorithms that are implemented using pseudocodes, and it does not obey the syntax of a programming language.

The Pseudocode algorithm

The pseudocode algorithm is as follows:

count = 0

input num

while num != -1:

    if num > 100:

         count++

print(count)

The flow

The flow of the above pseudocode algorithm is as follows

First, variable count is initialized to 0Next, we take input for numNext, a loop is repeated until the input is -1During each loop, the inputs over 100 are countedLastly, the count of inputs greater than 100 is printed

Read more about pseudocode algorithm at:

https://brainly.com/question/11623795

Which of the following statements is true? A. Ethernet connections allow the most mobility for users. B. Maximum advertised connection speeds are for Wi-Fi connections only. C. Every computer user can expect the same Internet connection speed. D. The actual speed of a network can differ from the maximum advertised speeds. E. Wi-Fi is the best option for intensive Internet users who have high data

Answers

Answer:

A

Explanation:

Ethernet connections allow the most mobility for users

Employees often have more than one laptop-so one or both of them are always handheld. For this cause, companies turn to the versatility and scalability of wireless networks. It is convenient to grant workers connectivity through a wireless network, which they can use to connect several devices. Tablets, smartphones and laptops can all be connected to the network, which enables employees to access

Answer: D. The actual speed of a network can differ from the maximum advertised speeds



Explanation:

just got it correct on the test

Your program will read in an existing text file. You want the program to terminate if the file does not exist. Which of the following indicates the correct code for the main method header? public static void main(String[] args) throws FileNotFoundException public static void main(String[] args) throws UnknownFileException public static void main(String[] args) public static void main(String[] args) throws FileMissingException

Answers

Answer:

FileNotFoundException

Explanation:

Which is an aspect of structural-level design? A. scaling B. player-adjusted time C. difficulty level D. radiosity

Answers

Answer:

D. radiosity

Explanation:

This is because in computers the definition of radiosity is an application of the elemental method of solving the equation for other particular scenes with surfaces that gradually reflects light diffusely.

Answer:

its d

Explanation:

im right

Given the variable ip, already declared as a pointer to an integer, write the code to dynamically allocate memory for a single integer value, assign the resulting pointer to ip, and initialize the integer value to 27.

Answers

Answer:

In C++:

int *ip;

ip = new int;

*ip = 27;

Explanation:

First of all, let us have a look at the methods of memory allocation to a variable.

1. Compile Time: The memory gets allocated to the variable at the time of compilation of code only. It is also called static allocation of memory.

Code example:

int a = 5;

2. Run Time: The memory is allocated to the variable on the fly i.e. during the execution of the program. It is also called dynamic allocation of memory.

Now, we have to write code for a variable ip, which is an integer pointer to dynamically allocate memory for a single integer value and then initialize the integer value 27 to it.

Initializing a variable means assigning a value to variable for the first time.

Writing the code in C++ programming language:

int *ip;      // Declaring the variable ip as a pointer to an integer

ip = new int;    // Dynamically allocating memory for a single integer value

*ip = 27;   // Initializing the integer value to 27.

You asked your colleague to provide feedback on a blog post you recently wrote. When they sent you their feedback, they made edits directly in the doc. Is this a best practice for a content editing process?

Answers

Explanation:

This question can have both answers that is yes as well as no.

1.Yes, it can serve as an editor who completes your content and ensures it will read well to others.

2. No, the editor should have tracked changes which would have shown you where they would apply recommended edits.

Other Questions
For the following information, determine whether a normal sampling distribution can be used, where p is the population proportion, is the level of significance, p is the sample proportion, and n is the sample size.Claim: p >=0.28; :0.08. Sample statistics: p=0.20, n= 180Required:If a normal sampling distribution can be used, decide whether to reject or fail to reject the null hypothesis and interpret the decision. Miriam is setting up a fishing game in a kiddie pool for her niece's birthday party. The pool has a circular base with a diameter of 4 feet and a height of 0.75 feet. She wants to fill the pool halfway so there is plenty of space left for the plastic fish. Approximately how many cubic feet of water does she need? 9.4 1.5 2.4 4.7 The temperature is 58 F. It gets warmer by h degrees and reaches to 65 F. Find h. suppose a triangle has sides 3,4,and 6. Which of the following must be true? Which is an aspect of structural-level design? A. scaling B. player-adjusted time C. difficulty level D. radiosity J&R Renovation, Inc., is trying to determine its cost of debt. The firm has a debt issue outstanding with 20 years to maturity that is quoted at 107 % of face value. The issue makes semi-annual payments and has a coupon rate of 9 % annually.A. What is the company's pretax cost of debt? B. If the tax rate is 35 %, what is the aftertax cost of debt? Help please!!!!!thxxxx If the m1 = 40, what is the m 3 MARKING BRAINLIEST!! - Chlorine reacts with methane to form gaseous hydrogen chloride and chloromethane according to the following equation: Cl2 (g) + CH4 (g) HCl (g) + CH3Cl (g) If 100 mL of chlorine reacted with excess methane at constant pressure and temperature, what volume of chloromethane would be formed? Question 7 options: 50, cannot tell from the information provided, 200, 100 Which of the following equations have no solutions?Choose all answers that apply:4x + 5 = -4x + 5B5x + 5 = -4x 5-4x + 5 = -43 - 5D-4x+5= - 4x - 4 Analyze Richard Nixon's handling of the protests against the Vietnam War. Did these protests influence Nixon to end the war? Why or why not? Were other factors involved?Protests against the Vietnam War were usually held by young college men refusing to go into service. These acts consisted of, ignoring draft notices, qualifying for conscientious objector status, burning draft cards on television, and purposely failing the physical examination. All in which were mostly successful.Nixon handled the anti-war protests by creating, what he called, Vietnamization. The Nixon organization's Vietnamization design accommodated a steady, staged withdrawal of American combat To verify the accuracy of the physical reactions to stress mentioned in this article, the BEST reference source to use would be A) a textbook used in a health class for college level students B) someone suffering from excessive stress who was interviewed and videotaped Eliminate C) the web site that originally produced this article and other health-related articles D) a current study on the effects of stress on the body published by a medical journal Identify an equation in point-slope form for the line perpendicular toy=-2x+ 8 that passes through (-3,9).O A. y - 9 = -2(x+3)O B. y+3 - 3(x-9)O C. y-9-(x + 2)O D.y +9 = 2(x 3) Psychology 1AQuestion:Dr. Tsai, a family therapist, views an individuals unwanted behaviors as influenced by, or directed at, other family members and treats the family as a ___.Group of answer choicesAnswers:schemestructuresymbiosissystem What is the unit charge on each subatomic particles HELP MEEEEEEE please Quick!!! Urgent!!!!!!!!! Suppose a 185 kg motorcycle is heading toward a hill at a speed of 29 m/s. The two wheels weigh 12 kg each and are each annular rings with an inner radius of 0.280 m and an outer radius of 0.330 m. Randomized Variables m = 185 kg v = 29 m/s h = 32 mA. How high can it coast up the hill. if you neglect friction in m?B. How much energy is lost to friction if the motorcycle only gains an altitude of 33 m before coming to rest? Hope is the coach of the Wilson High School girls' soccer team. There are 3 minutes left in the game they are currently playing, and they are losing by 1 goal. In the past, when losing by 1 goal, Hope has pulled a defender out of the game and replaced her with a forward a total of 9 times. When in the same position, she has left the defender in the game 10 times. In the situations when Hope has pulled her defender, the team has lost 4 times, tied 2 times, and won 3 times. In situations when she has left her defender in the game, the team has lost 1 time, tied 3 times, and won 6 times. Based on the information above, if the goal is to either tie or win the game, should Hope pull the defender or leave her in the game? How does the girl in Vermeer's painting represent the new merchant class springing up in Denmark?