i have a couple of questions on java for my homework

21229

Assume the availability of a method named makeLine that can be passed a non-negative integer n and a character c and return a String consisting of n identical characters that are all equal to c. Write a method named printTriangle that receives two integer parameters n andk. If n is negative the method does nothing. If n happens to be an even number, its value is raised to the next odd number (e.g. 4-->5). Then, when k has the value zero, the method prints a SYMMETRIC triangle of O's (the capital letter O) as follows: first a line of n O, followed by a line of n-2 O's (indented by one space), and then a line of n-4 O's (indented by two spaces), and so on. For example, if the method received 5,0 (or 4,0) it would print:
OOOOO
OOO
O
Note: in the above output , the first line contains 0 spaces before the first O, the next line 1 space, and so on.
Note: These instructions state what the method does when k is zero, but it is up to you, the programmer, to determine what it does when k is not zero and use it for your advantage.
The method must not use a loop of any kind (for, while, do-while) to accomplish its job. The method should invoke makeLine to accomplish the task of creating Strings of varying lengths.

20861

A palindrome is a string that reads the same forwards or backwards; for example dad, mom, deed (i.e., reversing a palindrome produces the same string ). Write a recursive, boolean -valued method , isPalindrome that accepts a string and returns whether the string is a palindrome.
A string , s, is a palindrome if:

s is the empty string or s consists of a single letter (which reads the same back or forward), or
the first and last characters of s are the same, and the rest of the string (i.e., the second through next-to-last characters ) form a palindrome.

20864

A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are same when scanned forward or backward) Write a recursive, boolean -valued method , isPalindrome, that accepts an integer -valued array , and a pair ofintegers representing the starting and ending indexes of the portion of the array to be tested for being a palindrome. The function returnswhether that portion of the array is a palindrome.
An array is a palindrome if:

the array is empty (0 elements ) or contains only one element (which therefore is the same when reversed), or
the first and last elements of the array are the same, and the rest of the array (i.e., the second through next-to-last elements ) form a palindrome.

Answers

Answer 1
In C, strings aren't a data type. Strings are handled as an array of char (acters). Therefore, your two palindrome assignments are basically the same.

Recursion is something that is probably the most mind warping thing to learn in programming, but it is VERY well worth it. There's a number of problems that are recursive in nature. One that you're familiar with is doing addition with pencil and paper.  Think about it: you align the numbers in columns as you're "going in", when you run out of numbers, the base case, you start adding the column of numbers and the carry and write out the least significant digit of the total and returning the most significant digit[s] up the "unwind".

Related Questions

________ is a collection of many separate networks.
A) A WAN
B) An internet
C) a LAN
D) None of the above

Answers

B.) An internet- a collection of networks

The method needed to arrange for an object to be notified when a window's close-window button has been clicked is

Answers

The correct answer that would best complete the given statement above would be the term addWindowListener. The method needed to arrange for an object to be notified when a window's close-window button has been clicked is addWindowListener. Hope this is the answer that you are looking for. 

Recovery testing is a system test that forces the software to fail in a variety of ways and verifies that software is able to continue execution without interruption.
A) TRUE
B) FALSE

Answers

true.
it tests for vitality of the system

Why are words like monkey, smile, and freedom not good to use as passwords??

Answers

Because those type of words are very simple to figure out so what you need is a more complex password like with number and symbols

A ______ is a data communication system spanning states, countries, or the whole world.
A) MAN
B) LAN
C) WAN
D) none of the above

Answers

C.) WAN (Wide Area Network)

A WAN is a data communication system spanning states, countries, or the whole world. Thus, option C is correct.

What is data communication?

Data communication is the process of sending messages or data through two devices across a wireless medium, as it is in computer systems. A combination of hardware and connectivity is used in this procedure.

A communications system known as a large area network covers a huge geographic region. Leased telecommunications lines are frequently used to construct large-area networks.

Since this includes numerous stations dispersed across a particular bregion, or perhaps the entire world, it is known as a wide-area network. This was to ensure that the data can be reached, by multiple users.

Therefore, option C is the correct option.

Learn more about data communication, here:

https://brainly.com/question/28588084

#SPJ2

Given the ip address 192.168.112.0. each network requires between 35 and 60 hosts. what is the broadcast address of the first available subnet?

Answers

Its is 255.255.255.0

The _____ address range is reserved for a computer to communicate with itself and is called the loopback.

Answers

The answer is 127 I had that question before

Which term describes the order of arrangement of files and folders on a computer?

Answers

Its called Folder window if you have a window 7 

Acceptance tests are normally conducted by the
A) developer
B) end users
C) test team
D) systems engineers

Answers

The answer is D. System engineers

B: End Users

That is the correct answer

A circuit has a voltage of 24 V and a current of 40 mA. What is the power of the circuit?

A. 6 W
B. 9.6 W
C. 6.24 W
D. 0.96 W

Answers

Hi! There is a relation between voltage, current, and power. It's very simple, too! It's voltage multiplied times current.
[tex]P=IV[/tex]
or [tex]VI=P[/tex] might be easy to remember because V.I.P. (like V.I.P. stadium seating)

Then you just have to work with units to get watts. Watts is volt-amps.

You can convert at any point to get watts as the unit. I'll turn the current to amps first.
[tex]40\text {mA}\cdot\frac{1\text A}{1000\text{mA}}=0.040\text A[/tex]
Then, multiply [tex]VI=P[/tex]
[tex]24\text V\cdot0.040\text A=0.96\text V\cdot\text A = 0.96\text W[/tex]

What type of Microsoft Server serves as an email server?

Answers

I have a feeling you're looking for Microsoft Outlook.
Outlook. Outlook is the new email server by Microsoft and is was made on July 31, 2012!

which of the following is the default letter assigned for the primary hard drive

Answers

The drive letter is C. C:\

In your opinion, is it more beneficial to have many folders or is it better to “nest” subfolders? Explain your response.

Answers

You can have one folder such as "Workspace" and have multiple different sub-folders that relate that to "Workspace". Also if you store pictures in a folder, it might be a good idea to separate them into different sub-folders.

Like one set of pictures could be in the sub-folder "2015-2016". All your pictures from 20015 to 2016 could be in that folder.
I think it's better to have multiple folders because for say you have 6 school subjects but only have 1 folder how are you going to keep track with all 6 subjects in one folder ? You could use each folder for each subject which would save you a lot of time when it comes to getting out your complete work .

C++ code-- Factorial Recursion
Write code to complete PrintFactorial()'s recursive case. Sample output if userVal is 5:
5! = 5 * 4 * 3 * 2 * 1 = 120
#include
using namespace std;

void PrintFactorial(int factCounter, int factValue){
int nextCounter = 0;
int nextValue = 0;

if (factCounter == 0) { // Base case: 0! = 1
cout << "1" << endl;
}
else if (factCounter == 1) { // Base case: Print 1 and result
cout << factCounter << " = " << factValue << endl;
}
else { // Recursive case
cout << factCounter << " * ";
nextCounter = factCounter - 1;
nextValue = nextCounter * factValue;


}
}

int main() {
int userVal = 0;

userVal = 5;
cout << userVal << "! = ";
PrintFactorial(userVal, userVal);

return 0;
}

Answers

Handle the print outside of the factorial function, which only needs one userVal when called.

int factorial( int foo )
{
  if( foo == 1 )
   return 1;
 else
   return( foo * factorial( foo - 1 ) );
}

Answer:

void PrintFactorial(int factCounter, int factValue){

int nextCounter = 0;

int nextValue = 0;

if (factCounter == 0) { // Base case: 0! = 1

cout << "1" << endl;

}

else if (factCounter == 1) { // Base case: Print 1 and result

cout << factCounter << " = " << factValue << endl;

}

else { // Recursive case

cout << factCounter << " * ";

nextCounter = factCounter - 1;

nextValue = nextCounter * factValue;

printFactorial(nextCounter, nextValue);

}

}

Explanation:

The only things that is left is calling the recursive function in the else statement. It is the bolded command on the answer.

factCounter is the value we are multiplying. In the function, it is nextCounter. So for 5, it is 5, then 4, then 3, until 0...

factValue is the value of the factorial. In the function, it is nextValue So it is 5, then 5*4 = 20, then 5*4*3 = 60, then...

void PrintFactorial(int factCounter, int factValue){

int nextCounter = 0;

int nextValue = 0;

if (factCounter == 0) { // Base case: 0! = 1

cout << "1" << endl;

}

else if (factCounter == 1) { // Base case: Print 1 and result

cout << factCounter << " = " << factValue << endl;

}

else { // Recursive case

cout << factCounter << " * ";

nextCounter = factCounter - 1;

nextValue = nextCounter * factValue;

printFactorial(nextCounter, nextValue);

}

}



XML Schemas consist of:
A.
properties and methods.
B.
elements and attributes.
C.
structure and data.
D.
tables and relationships.
View Answer Workspace Report Discuss in Forum
9.
The expression FOR XML RAW tells SQL Server to:
9.
A.
place the values of the columns as attributes in the resulting XML document.
B.
place the values of the columns into elements rather than attributes.
C.
place some columns into elements and others into attributes.
D.
None of the above is correct.

Answers

none of the above is correct

Which of the following is an approach to debugging?
A) backtracking
B) brute force
C) cause elimination
D) code restructuring
E) a, b, and c


Answers

C) cause elimination

The following is an approach to debugging:

A) backtracking

B) brute force

C) cause elimination

There are different approaches to debugging a Software Applications, these are:

Brute Force Method: This method commonly used but it has the least efficiency for isolating the cause of a software error.Back Tracking Method: This method is commonly used for small applications.Cause Elimination: The approach involves induction or deduction.

Find out more at: https://brainly.com/question/23959780

Debugging is not testing, but always occurs as a consequence of testing.
A) TRUE
B) FALSE

Answers

A) True Hope that helps

It is true to say that Debugging is not testing but always occurs as a consequence of testing.

What is Debugging?

Debugging is the process of identifying and fixing defects in computer programs, software, or systems. It is a crucial step in computer programming and software development.

Debugging is used to identify and correct errors. The testing procedure just displays the consequences of the coding fault on the application; it does not assist the developer in identifying the mistake in the code.

Software developers and engineers use debugging to find and correct bugs in programs before making them available to the general public. It's an additional step to testing, which entails discovering how an issue impacts a program as a whole.

Debugging is the act of locating and fixing problems in software code that might lead to unexpected behavior or crashes. These mistakes are sometimes referred to as "bugs." Debugging is used to identify and fix faults or flaws in software or systems so that they don't operate incorrectly.

To read more about Debugging, refer to - https://brainly.com/question/13966274

#SPJ2

_______ is the protocol suite for the current Internet.
A) TCP/IP
B) NCP
C) UNIX
D) ACM

Answers

A? not very sure sorry

A ________ is a set of rules that governs data communication.
A) forum
B) protocol
C) standard
D) none of the above

Answers

the organised system of rules governing affairs is called protocol. the answer is B) protocol

What two tasks need to be done after installing a secondary hard drive?

Answers

Make sure everything is connected, then turn it on and see if it works.

Antel and imd both produce similar computer chips and the two companies dominante this

Answers

Answer:

Because it will restrict the supply of computer chips

Explanation:

Antel and imd both produce similar computer chips and the two companies dominante this

Because they can both charge more for the product at the given level of production

Because it will restrict the supply of computer chips

Because overall demand for computer chips will increase

Because the firms' marginal costs increase as output increases

As both companies have the total supply of the product in the market they can dominate everything that they are providing because of this, they cab restrict the supply of the computer chips, if they cooperate and work together they can set a minimum price and a ceiling price, they can dictate how the market flows, because of that, the price of the computer chips will depend solely on them.

Which of the following strategic issues needs to be addressed in a successful software testing process?
A) conduct formal technical reviews prior to testing
B) specify requirements in a quantifiable manner
C) use independent test teams
D) wait till code is written prior to writing the test plan
E) both a and b

Answers

The strategic issues that should be addressed for a successful software testing process include the conducting of a formal technical reviews prior to testing and specifying the requirements in a quantifiable manner.

The test strategy has to do with the testing approach of the development cycle of the software and its aim is to ensure that the objectives of the software are met.

It should be noted that using independent test teams and waiting till the code is written prior to writing the test plan doesn't need to be addressed in a successful software testing process.

Therefore, the correct option is E since both option and B are correct.

Read related link on:

https://brainly.com/question/13262403

Regression testing should be a normal part of integration testing because as a new module is added to the system new
A) control logic is invoked
B) data flow paths are established
C) drivers require testing
D) all of the above
E) both a and b

Answers

Regression testing should be a normal part of integration testing because as a new module is added to the system new control logic is invoked and data flow paths are established.

What is regression testing?

Regression testing is a software testing practice which ensures that an application is still functioning as it need to or expected after making any code changes or improvements. Regression testing checks for the overall stability and functionality of the existing features of the software.

Now, the Regression testing is integrated with the software so that if any changes are made, new control logics are automatically invoked and data flow path is established.

Thus, the correct option is E. i.e. both A and B.

Learn more about regression testing.

https://brainly.com/question/13327687

#SPJ2

Which topology requires a central controller or hub?
A) Mesh
B) Star
C) Bus
D) Ring

Answers

I Think it is Topology of star but I am not sure.

Each component of a network is connected to a central node, frequently referred to as a hub or switch, in a star architecture. Thus, option B is correct.

What topology requires a central controller or hub?

A benefit of star topologies is that just the central site needs to be modified, making it simple to add new sites. The centre site is crucial in a star topology; if it fails, all connections would be lost. The connection's performance is determined by how well the central hub functions.

A star network is a local area network (LAN) topology in which all nodes, such as personal computers (PCs), workstations, or other devices, are directly connected to a single common hub, which is frequently referred to as a central computer. As a result, a hub-and-spoke network structure is another name for a star network.

Therefore, Star topology requires a central controller or hub.

Learn more about topology here:

https://brainly.com/question/10536701

#SPJ2

keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equation? (24+75)/(6*3)

Answers

5.5
it is not equation

well maintained websites may have an unmaintaned page that has not been updated

Answers

Yes, and no, some sites do have these, but ones that are developed by many teams of people and are updated constantly, do not have unmaintained and incomplete pages. 

Assign True to the variable has_dups if the string s1 has any duplicate character (that is if any character appears more than once) and False otherwise.



Here is the answer I wrote:


i = []
for i in range(len([s1])):
if s1.count(s1[i]) > 1:
has_dups = True
elif s1.count(s1[i]) = 1:
has_dups = False


Here is the message I got from the system:

Solutions with your approach don't usually use: elif



Please Help me to correct it.

Answers

i dont know the language of the code
probably you have sintacs mistakes in it

has_dups = false
for i in range(len([s1])):
has_dups = has_dups || s1.count(s1[i]) > 1

A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large computer.

Answers

I think it'd be terminal concentrator.  A(n) terminal concentrator is a front - end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large computer. 

the internet is an example of

a. a large multi user program
b. a computer program
c. wireless connection
d. mass file storage

Answers

The internet is an example of a large multi-user program. Thus the correct answer is A.

What is the internet?

The Internet is refers to a Network of thousands of computers used to connect people from miles away. This has shortened the distance between people.

It helps to communicate, do online shopping, education, research, play games, animations, and so on. It allows many people to connect over the program.

Therefore, option A  a large multi-user program is the appropriate answer.

Learn more about the Internet, here:

https://brainly.com/question/13308791

#SPJ2

How many passwords can be created in the form [a - z][a - z]9[0, 1]6? that is, a capital letter followed by 9 lowercase letters followed by 6 bits.?

Answers

no capital letters expected
26 * 26^9*2^6 = 9034694121816064

Other Questions
Which rates are equivalent to 25 miles per gallon? 150 miles/ 6 gallons50 miles/ 1.5 gallons100 miles/ 3.8 gallons75 miles/ 3 gallons Which sphere does a dolphin swim in? A.atmosphere B.lithosphere C.magnetosphere D.hydrosphere Which type of wave is characterized by circular motion?A. transverse wave B. longitudinal wave C. primary wave D. surface wave What country was responsible for colonizing most of south america in the sixteenth century? What did Herbert Hoover initially believe about the federal government's role in the Great Depression?A.The federal government should spend massive amounts of money to get the economy back on its feet.B.The federal government could not and should not solve the economic crisis.C.The federal government should bail out the banks and brokerage firms on Wall Street in order to help Main Street.D.The federal government could and should give handouts to the unemployed so they can stay afloat during the depression. Cambie las oraciones de la voz activa a la voz pasiva. Ponga atencin al contexto para determinar si el verbo debe ser pasado, presente o futuro.1 Voz activa: El oficial verificar mi pasaporte.Voz pasiva: Mi pasaporte ____(a)____ ____(b)____ por el oficial.Answers: a) sera b) verificado 2. Voz activa: Ay, no! Los empleados escribieron las instrucciones en ingls.Voz pasiva: Ay, no! Las instrucciones ____(a)____ ____(b) ____ en ingls por los empleados.Answers: a) fueron b) escritos 3. Voz activa : Creo que ella colecciona todos los documentos.Voz pasiva : Creo que todos los documentos ____(a)____ ____(b)____ por ella.Answers: a) Son b) coleccionados 4. Voz pasiva : La mquina fue rota por el obrero.Voz activa : El obrero _______ la mquina. Answer: rompi 5. Voz pasiva : Esos tapices son hechos a mano por mujeres indgenas.Voz activa: Mujeres indgenas _______ esos tapices. Answer: hacen 6. Voz pasiva: Los resultados sern enseados por el presidente de la compaa.Voz activa : El presidente de la compaa __________ los resultados.Answer: ensear Rewrite the following sentences adding accents if necessary.7. Solo tengo su nombre, no tengo su direccion. Answer: Solo tengo su nombre, no tengo su direccin.8. Si, seor, estoy sola. Answer: S seor, estoy sola. 9. Son todos esos tuyos? Answer: Son todos esos tuyos? 10.Si, todos esos carros son mios. Answer: S, todos esos carros son mos. Verbos mezclados. Escoja el verbo apropiado para completar cada oracin.11. Lo hara si ________ el tiempo. (Tengotengatendratuviera) Answer: tuviera 12. Te dir la verdad si me la _______ a m. (Dicendigandirandijeran) Answer: dicen 13. Era importante que _______ a tiempo. (Llegamoslleguemosllegaramos llegramos) Answer: llegramos 14. Si ganara la lotera, __________ el mundo. (Viajoviajeviajaraviajara) Answer: viajara 15. Habra terminado el royecto si los otros _________ hecho su trabajo.(Hanhabanhayanhubieran) Answer: hubieran 16. ______ a levantarme temprano, pero decid quedarme en cama hasta las 9.00.(FuiIbaIraFuera) Answer: Iba 17. Si yo ________ presidente, no habra ms guerra.(Fui, iba, ira, fuera) Answer: fuera For which market model is there a very large number of firms?A.monopolistic competitionB.oligopolyC.pure monopolyD.pure competition Which form of promotion would be most effective at correcting a damaged business reputation? A. public relations B. advertisements C. direct marketing D. sales promotions What is the value of y in terms of x in the following equation? x - 8y = 1/4 The equation y=ax describes the graph of a line. If the value of A is megative the line:a) goes down and to the leftb) goes up and to the leftc) is verticald) is horizontal ...how could your mother bear a careless girl like you? Look at your fine clothes lying here neglected who is speaking here The Bible centers on the theme of salvation T or FThe only way we can sin is by doing a wrong action T or Fthe beginning of eternal life is called regeneration T or FOne sins because he is a sinner T or FPersonal trust in Jesus Christ as lord and saviour is The only way of salvation T or F If North Carolina is south of Florida then the capital of Ohio is Columbus? True or False Which of the following people is most likely to be suffering from depression?A.Violet is a very talented and a very competitive tennis player. She loses her temper fast and sulks for days whenever she loses a match.B.Sammy doesn't especially like going to parties or talking on the phone with his friends. He prefers reading in his room and playing with his dog.C.Natalie hasn't made friends at her new school after she moved because her parents got divorced. She spends a lot of time in her room and has trouble studying. Eight students on a class treasure hunt found the following number of hidden chocolates. Their teacher wanted to be sure that each student received the same number of chocolates after the event. Which measure(s) of central tendency can the teacher use to distribute the chocolates equally among all of the students?A.the medianB.the modeC.the meanD.either the mean or the mode Why did William Penn advertise his new colony of Pennsylvania in Europe? Oley Scotchgard sells TV's. He earns a 4.5% commission on sales. If his sales last week were $9000, how much did Oley earn? which flow chart below shows the energy conversions that occur when you turn on your laptopA: electrical> light,sound and thermal B: thermal> light,sound and electricalC: electrical> light,sound and nuclearD: thermal> sound,nuclear and electrical triangle ABC has vertices A (0,10) B (4,10) and C (-2,4) find the orthocenter of triangle ABC Alternating between running and walking Steam Workshop Downloader