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

A Cisco Catalyst switch has been added to support the use of multiple VLANs as part of an enterprise network. The network technician finds it necessary to clear all VLAN information from the switch in order to incorporate a new network design. What should the technician do to accomplish this task

Answers

Answer:

The technician should delete the startup configuration and the "vlan.dat" file residing in the flash memory of the newly added switch and lastly, he should reboot the switch.

Explanation:

In this scenario, a Cisco Catalyst switch has been added to support the use of multiple virtual local area networks (VLANs) as part of an enterprise network. The network technician finds it necessary to clear all virtual local area network (VLAN) information from the switch in order to incorporate a new network design. To accomplish this task successfully, the technician should delete the startup configuration and the "vlan.dat" file residing in the flash memory of the newly added switch and lastly, he should reboot the switch. The VLAN informations are stored in a file with the name "vlan.dat" residing in the flash memory of the switch.

However, in order to delete the startup configuration he would be required to login as an administrator, so as to have all privileges.

Also, the essence of deleting the startup configuration and the "vlan.dat" is to avoid any conflict in the network.

function of C:\>DIR*.doc/p​

Answers

Answer:

list all the files that end with ".doc" and pause after each page of results.

You have an on-premises network that contains several servers. You plan to migrate all the servers to Azure. You need to recommend a solution to ensure that some of the servers are available if a single Azure data center goes offline for an extended period.
What should you include in the recommendation?
A. fault tolerance
B. elasticity
C. scalability
D. low latency

Answers

Answer:

A). Fault tolerance

Explanation:

The Microsoft Azure is described as the cloud computing service that is known for its flexibility, cost-effectiveness, and quick and easy compliance to fulfill the company's requirements.

As per the question, in order to ensure that 'some servers are available in case of a single Azure data center going offline for an increased time period', the recommendation must include the 'fault tolerance' ability of Azure services. Azure infrastructure has the ability to immediately react in case of a failure to restore the servers and its services. In case of hardware failure, crashing of hard-disks, or short-term availability problems with servers, Azure predicts and manages such failures effectively. Thus, option A is the correct answer.

Given that Jamie worked 50 hours (Hours = 50) last week and earns $10.00 an hour (Rate = 10), how much did Jamie earn last week, before taxes (TotalPay)? If (Rate >=10) OR (Hours <=40) Then TotalPay = Hours * Rate Else TotalPay = (Hours * Rate)+(Hours–40)*Rate*1.5 End If

Answers

Answer:

Jamie earned (Total pay)  $500.

Explanation:

We are given the following code:

If (Rate >=10) OR (Hours <=40) Then

   TotalPay = Hours * Rate

Else

   TotalPay = (Hours * Rate)+(Hours–40)*Rate*1.5

End If

Let us understand the code line by line:

The first line contains an if statement with 2 conditions:

i.e. 1st condition:

The rate is greater than or equal to 10

2nd condition:

Number of hours are lesser than or equal to 40.

There is OR between the two condition i.e. the statement next to if() statement will get executed if any one of them becomes true and else part will not be executed.

The next statement is:

TotalPay = Hours * Rate

It calculates the pay if any of the two conditions written earlier becomes true.

Next statement is else statement:

It will get executed given that the above if() statement becomes false.

Now, we are given that Jamie worked 50 hours last week and earns $10.00 an hour:

i.e.

Hours = 50

Rate = 10

Now, let get to the code execution.

The first condition is true i.e. Rate >= 10 (because Rate is 10 here)

So, the following statement will be used to calculate the Total pay:

TotalPay = Hours * Rate

and else part will not be executed.

TotalPay = 50 * 10  = $500  

Jamie earned (Total pay)  $500.

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.

solve the following equations and check your result 1) 3x=2x+18​

Answers

Answer:

x = 18

Explanation:

3x = 2x+18

3x-2x = 18

x=18

Answer:

Explanation:

3X-2X=2X-2X+18

X=18

Suppose you have a tablet with a capacity of gigabytes. For a plain text​ book, one byte typically corresponds to one character and an average page consists of 2000 characters. Assume all gigabytes are used for plain text books. a. How many pages of text can the tablet​ hold? b. How many​ 500-page books can the tablet​ hold?

Answers

Answer:

a. 17,500,000 pages

b. 35,000

Explanation:

The computation is shown below:

As we know that

[tex]1 giga\ bytes = 1 \times 10 ^ {9} bytes[/tex]

So for 35 gigabytes it would be

[tex]= 35 \times 10 ^ {9} bytes[/tex]

And it is given that there is 2,000 characters

a. So the number of text pages would be

Let us assume that

for 2,000 it would be 1 page

So for [tex]35 \times 10 ^ {9} bytes[/tex] it would be x

Now we solve the x which is equal to

[tex]= \frac {35 \times 10 ^ {9} bytes}{2,000}[/tex]

= 17,500,000 pages

b. Now for 500 pages, it would be

[tex]= \frac{17,500,000}{500}[/tex]

= 35,000

Assume the existence of a BankAccount class with a method, getAvailable that returns the amount of available funds in the account (as an integer), and a subclass, OverdraftedAccount, with two integer instance variables:

Answers

Answer: This is hard but I will research ok

Explanation:

Page No.:
Date:
Find the roots the quadratio
equation 3 x ² - 2 16 x + 2 =0.​

Answers

First plug in all of the values into the quadratic equation. -b+-sqrt(b^2-4ac)/2a to get 216+-sqrt(216^2-4(3)(2))/6 simply to get about 216+-216/6. This gets us about 0 and 72. THIS IS ESTIMATION NOT EXACT ANSWER

Explain motherboard in detail

Answers

Answer:

A motherboard is the main printed circuit board in general-purpose computers and other expandable systems. It holds and allows communication between many of the crucial electronic components of a system, such as the central processing unit and memory, and provides connectors for other peripherals. Unlike a backplane, a motherboard usually contains significant sub-systems, such as the central processor, the chipset's input/output and memory controllers, interface connectors, and other components integrated for general use. It also makes arithmetical operations

Explanation:

Have a nice day ;]

Answer:

motherboard is the main printed circuit board (PCB) in a computer. The motherboard is a computer’s central communications backbone connectivity point, through which all components and external peripherals connect. The large PCB of a motherboard may include 6-14 layers of fiberglass, copper connecting traces and copper planes for power and signal isolation.

The motherboard contains the connectors for attaching additional boards, such as the CPU, BIOS, memory, mass storage interfaces, serial and parallel ports, expansion slots and all the controllers that are required to control standard peripheral devices such as the display screen, keyboard, and hard drive.

Kris is the project manager for a large software company. Which part of project management describes the overall project in detail? Analysis report Resources document Scope Scope creep

Answers

Answer:

The given option "Resource document" is the correct answer.

Explanation:

Whenever it applies to chronology as either the documentation a resource records collection of specific documents should indeed be regarded as a component of this kind of record. The resource component encompasses a series of proclamations provided by the researcher including its memorandum, and therefore is willing to take responsibility for each other by the very same body is nonetheless accountable again for the file.

The remaining three options do not apply to something like the specified scenario. And the latter is the correct one.

Answer:

Resource document

Explanation:

Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a sublist of the input list. The sublist should contain the same values of the original list up until it reaches the number 5 (it should not contain the number 5).

Answers

Answer:

Following are the code to this question:

def sublist(l):#defining a method list sublist that accepts a list

   val=[]#defining an empty list

   x=0#defining x variable that store value 0

   while(x<len(l)):#defining loop that check x is lessthen list length  

       if(l[x]==5):#defining if block that checks list value equal to 5

           break#using break keyword  

       val.append(l[x])#add value in val list

       x+= 1#increment the value of x variable by 1

   return val#return val

l=[3,4,7,8,5,3,2]#defining list l

print(sublist(l))#using print method to call sublist method

Output:

[3, 4, 7, 8]

Explanation:

In the above python code, a method "sublist" is declared that accepts a list, inside the method an empty list "val" and an integer variable x is defined that stores "0"  value. In the method, a while loop is declared that checks list length and define if block to checklist element value equal to "5". which the condition is true it will return before values. In the last step, a list "l" is declared that holds value and used the print method to call sublist to prints its return value.

After the unforeseen failure of her Bigfoot picture sharing service, bgfootr, which got hacked when she failed to stay on top of her security updates Janelle has a great new idea for a new service to report Loch Ness monster sightings. What service would help her keep from having to play system administrator

Answers

Answer:

C) Platform as a Service

Explanation:

The service which helps her by having to play administrative is a platform.

The platform as a service refers to the platform in which the it allowed to create, run, manage the applications over the cloud computing. Also it could be done without having difficulties with respect to maintaining the infrastructure as it is done online so no physical appearance needed

By focusing into it, she centralize her mind in creating the service

Hence, the correct option is C.

Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode. What can she do to make the games work properly in Windows

Answers

Complete Question:

Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode.

Group of answer choices;

A. Reboot into Safe Mode

B. Run compatibility mode for 640 x 480 resolution.

C. Reduce her screen resolution to 640 x480

D. Reboot into Low Resolution Mode

Answer:

B. Run compatibility mode for 640 x 480 resolution.

Explanation:

In this scenario, Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode. In order to make the games work properly in Windows, Missy should run compatibility mode for 640 x 480 resolution.

The video graphics array (VGA) is the standard graphics or display interface used for computer monitors. It was developed in 1987 by IBM and it had a standard display resolution of 640 x 480 pixels.

Hence, if the output of a software program (games) looks fuzzy or is not being displayed properly, you should run compatibility mode for 640 x 480 resolution. This is to enable low resolution video mode on the computer.

The VGA mode is very basic because only minimal video drivers are being loaded on the windows.

Which of the following statements is false? a. Java allows a class to implement multiple interfaces in addition to extending one class. b. Classes declared with implementation inheritance are tightly coupled. c. Classes declared with interface inheritance are tightly coupled. d. An interface also may extend one or more other interfaces

Answers

Answer:

The answer is "Option d".

Explanation:

In java, programming language interface is used to achieve the multiple inheritances,  that's why it used the extends keyword to inherit the interface to interface, that's why above given point is correct and \wrong choices can be described as follows:

The choice (a) is incorrect because it uses the implement keyword to inherit the class to an interface.  Choice b and choice c both are wrong because it can't be tightly coupled.

An interface consists of the shared boundary within the 2 separate components of the computer system of interchange.

The exchange takes place between the software computer and periphery devices. An interface cannot be extended to more than one devices. Hence e the option D is correct.

Learn more about the following statements are false.

brainly.com/question/17095049.

One technique to find the "things" that need to be included in the new system begins by starting with a user and the use cases and then try to identify the necessary informational "things." This technique is called the _______.​ a. ​ check list technique b. ​ domain analysis technique c. ​ noun technique d. ​ brainstorming technique

Answers

Answer:

Coding is a skill where you take instructions (the steps in a task) and translate it into a languaage.

Explanation:

Coding is a skill where you take instructions (the steps in a task) and translate it into a language the computer understands since computers do not communicate like humans. They communicate in a language called BINARY and

Jorge wanted to find out how many 9-volt batteries connected in a series are required to create a 120-volt circuit. So, he divided 120 by 9 and concluded that he needed 13 1/3. Write a sentence explaining Jorge's mistake, and tell the correct answer.

Answers

Answer:

Jorge needed to have over 13 (thirteen) 9 volt batteries to create 120 volts.

Explanation:

Rather than saying he just needs 13 1/3 (one-quarter) 9 volt batteries, Jorge would have correctly concluded he needed over over 13 number of 9 volts battery to create 120 volts.

This is the case because in a series connection, two or more batteries are connected in a way that the same current would flow through each battery through their terminal. If he had taken note of the fact that each battery has an internal resistance, which may reduce the flow of current through the batteries Jorge would know that the  13 number of 9 volts batteries would not give exactly 120 volts because of the internal resistance of the battery circuit.

These commands are established by combatant commanders when authorized by the Secretary of Defense through the Chairman of the Joint Chiefs of Staff to conduct operations on a continuing basis in accordance with the criteria set forth for unified commands. They may be established on a geographic area basis such as U.S. Forces Japan or on a functional basis such as Special Operations Command, Pacific.
a. Subordinate Unified Commands
b. Combatant Command
c. Unified Command Plan
d. None of above

Answers

Answer:

b. Combatant Command

Explanation:

The Combatant commands are commands which are primarily authorized by the Secretary of Defense with approval from the President. They are then executed by the Combatant Commanders (CCDR's), who receive information from the higher authorities through the Chairman of the Joint Chiefs of Staff. The combatant commanders head the combatant commands and are usually four-star Generals. The combatant commands have a broad and continuing purpose.

They ensure synergy for the command and control of the United States military forces. They are formed on the basis of geography or function. The United States Defense Department has eleven (11) combatant commands which serve either a geographic or functional purpose.

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

A flat-panel detector is exposed with nothing between the x-ray tube and detector. 5 images were acquired on 5 different days using the same exposure. The pixel readings within a region of interest (ROI) are compared. What quality control test was performed?
a. Detectability
b. Linearity
c. Repeatability
d. Uniformity

Answers

Answer:

c. Repeatability

Explanation:

Since in the question it is mentioned that the falt panel detects the relation between the x-ray tube and detector. Also five images were purchased on five different days but used the similar exposure

So for the quality control test, the repeatability should be performed as the reading of the pixel is done within a region of interest also it examines the consistency of the pixel reading over time

Hence, the correct option is c.  

What is a Text Whap​

Answers

Answer:

it's when in a word processor document a word in a line does not fit on that same line therefore some of its characters appear in the next line

You have been contracted by a local school to evaluate their computer labs for security threats. They are most worried about the hard drives and RAM being stolen from inside the computers. What could they do to prevent this from happening

Answers

Explanation:

To avoid the theft of  the hard drives and RAM being stolen from inside the computers, all they need to do is replace the PC's screws with proprietary security screws. These screw have very different head, thus impossible to unscrew with common tools. They are also called tamper proof screws.

Do you know best way to know WiFi password which you are connected to?​

Answers

Answer:

Download a wifi password saver on playstore or appstore

Explanation:

Answer:

Ask the person who set up the wifi router.

Look behind the wifi box and there should be a small sticker that says the password.

Call the wifi provider and say you forgot your wifi password

Reset your password using your account.

Which of these protects against the most common attacks on the internet via a database of signatures, but at the same time actually represents an additional attack surface that attackers can exploit to compromise systems?

Answers

Answer:

Antivirus Software

Explanation:

The software that the question is describing is known as an Antivirus Software. Like mentioned, this is a computer program that is used with the main goal of preventing, detecting, and removing malicious files on the computer known as computer viruses. They also act as a shield to prevent these malicious files from entering the computer through the internet, but like any other software these Antivirus Softwares can be exploited by hackers to gain access into a system.

The software that protects against the most common attacks on the internet via a database of signatures, but at the same time actually represents an additional attack surface that attackers can exploit to compromise systems is called; Anti-virus software

The correct answer is Anti-virus software. This is because it is also called Anti-Malware and it is used to help computers to detect threats to it both via a software installed or even via the internet.

It carries out this detection and neutralization of computer attacks by utilizing it's internal variation of database signatures that can find any type of potential attack against the computer.

Read more on Anti-virus software at; https://brainly.com/question/17209742

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.

1) What is Net beans

Answers

Answer:

it's a software

Explanation:

NetBeans IDE lets you quickly and easily develop Java desktop, mobile, and web applications, as well as HTML5 applications with HTML, JavaScript, and CSS. The IDE also provides a great set of tools for PHP and C/C++ developers.

Which of the following Teacher Tips would NOT be helpful when trying to select content from the Chrome Web Store? "Can be used across subject areas" "Helped my struggling students really understand the concept of color harmony." "Doesn’t have much of a learning curve" "This app is not available in the Chrome Web Store"

Answers

Answer:

I'd say all of them have somewhat of a profound amount of viability and usefulness when it comes to teachers trying to find appropriate content, but "Can be used across subject areas" is not distinct enough, and is to broad/unclear, since quite obviously if teachers are looking for content for there students they will be looking for apps that are used for teaching certain subject areas. Every app used for teaching will be used for certain subject areas, so stating that statement is a mere waste of time & space. Where as "This app is not available in the Chrome Web Store" is pretty helpful to know, because knowing if an app is available or not is really important. "Helped my struggling students really understand the concept of color harmony." may be helpful if you are trying to find an app that correlates to science as the concept of color harmony is science. And  "Doesn’t have much of a learning curve" shows that the app can be used long-term and is informative.

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:

what should i do after learning python? how can I make apps or gaming apps? IF YOUR ANSWER WILL BE GOOD I WILL MARK AS BRAINLIEST

Answers

Answer:

Here are some of the things that you can do after learning Python:

Learn a Web Development Framework

Learn Machine Learning

Start Teaching Python to Beginners (and earn some bucks)

These are the top three ways to proceed

Explanation:

Learn a web development framework

Adam is using the software development life cycle to create a new game. He made an outline of what functionality the game will require, determined how long it will take to create the game, and made a list of people who could help him with the graphics. What should Adam do next

Answers

Answer:

Write pseudocode and create a mock-up of how the game will work and look

Explanation:

Since in the question it is mentioned that Adam wants to develop a new game for this he made an outline with respect to game functions needed, time period, people who help him.

After that, he writes the pseudocode i.e a programming language and then develops a model i.e mock up that reflects the working of the game and its look so that he would get to know how much work is pending.

Other Questions
A 15 kg object is pulled by a force of 68 N. If the surface exerts a friction force of 23 N, with what acceleration does the object move? Franklin the fly starts at the point $(0,0)$ in the coordinate plane. At each point, Franklin takes a step to the right, left, up, or down. After $10$ steps, how many different points could Franklin end up at? ____ tres aos que hablo espaol.O A. HagoB. EsO C. HaceO D. Est find the value of x and y John Cage'shas a percussive sound inspired by African dance music and reminiscent of gamelan music.O A. tablaO B. prepared pianoO C. musique concrteO D. synthesizer A painter can paint a building in 15 days and a coworker can do the same job in 10 days. If the first painter starts and 3 days later the coworker joins in to help finish the job, how many days does it take to paint the building? Solve for w in terms of t 3w-8=tPlease explain steps the resistor of values 6 ohm,6 ohm are connected in series and 12 ohm are connected in parallel. the equivalent resistance of the circuit is Each of the following is a shipping hazard that a package may be exposed to except ____. a. retraction b. vibration c. compression d. rough handling e. all of the above are shipping hazards for a package Vanessa is studying the art history of Hindu temples. Help Vanessa complete the sentence to identify a theme found in some Hindu temple art. Some Hindu temples include images of_____with a focus on_____. Q3. Sketch the character of Shankar. (Read the Literature lesson 'The Station' andwrite) 24) Neoclassical composers favoredA) program musicB) atonalityC) tonalityD) large orchestras Around the Grand Canyon the predators of deer were largely exterminated by people. The deer population grew rapidly as a result of the lack of predators until the deer exhausted their food supply. This led to a massive die-off (known as a population crash) and hundreds of deer died of starvation. The point at which the food supply no longer supported the large deer population can best be considered a A broker-dealer and its associated persons may be subjected to sanctions for violations of FINRA and SEC rules. Which of the following penalties can be levied against both the member firm AND its associated persons?A. CensureB. Limits placed on activitiesC. ImprisonmentD. Loss of SIPC coverage Read the excerpt from "A Modest Proposal." A very worthy person, a true lover of his country, and whose virtues I highly esteem, was lately pleased, in discoursing on this matter, to offer a refinement upon my scheme. He said, that many gentlemen of this kingdom, having of late destroyed their deer, he conceived that the want of venison might be well supply'd by the bodies of young lads and maidens. The underlined portions of the excerpt are examples of verbal irony because this man truly is virtuous and patriotic, so Swift is surprised by the mans support of eating children to solve the poverty issue. anyone who is truly virtuous or patriotic would not suggest using children for food, so Swift means the opposite of what he says. this man is a close friend of Swifts, so Swift is just expressing his personal thoughts and feelings about the mans character. anyone who tries to better his country must be virtuous and patriotic, so Swift is simply explaining what is already obvious to the reader. A screen is placed 43 cm from a single slit which is illuminated with 636 nm light. If the distance from the central maximum to the first minimum of the diffraction pattern is 3.8 mm, how wide is the slit in micrometer which following pairs of body functions are normally involuntary actions but can be controlled voluntary for a short periods of time A researcher measures job satisfaction among married, single, and divorced employees to determine whether marital status can influence job satisfaction. Based on the following description in APA format, state the value for k, N, and n. A one-way analysis of variance showed that job satisfaction did not vary by marital status, F(2, 24) = 1.93, p > 0.05.a. k = _____b. N = _____c. n = _____ Which of the following prohibits consumers from taking cash from manufacturers, suppliers, or their representatives for making recommendations, reviews, or endorsements, unless full disclosure is provided?A. The world of mouth Marketing association's ethics code.B. The fourth principle of IMCC. The American associations of advertising agencies creative For each of the following system of linear equations, state the number of solutions without solving the system. a) -x+3y=9, -4x+12y=12 b) 2x-y-4=0,6x=3y+12