Write a public static method named evens that takes in 1 argument int a, and returns a String containing all positive even numbers with each separated by a comma from O up to that number inclusive if it is also even
Remember if the argument is odd not to include it in the output
Remember there should be no trailing comma after the values
If the argument a is negative return a String that says "NONE!
(Do not print the String)
Example evens(5) String returned by method. 0.2.4
Example evens(8) String returned by method. 0.2.4,6,8
Example evens (9) String returned by method 0.246,8
Example evens(-5), String returned by method: NONE
Example evens(O) String retumed by method 0
Example evens(1) String returned by method 0

Answers

Answer 1

public class JavaApplication48 {

   public static String evens(int a){

       String txt = "";

       if (a < 0){

           return "NONE!";

       }

       else if(a%2 == 1){

           a -= 1;

       }

       for (int i = 0; i <= a; i+=2){

           if (i < a){

               txt += i+",";

                       }

           else{

               txt += i;

           }

       }

       return txt;

   }

   public static void main(String[] args) {

       System.out.println(evens(1));

   }

   

}

I hope this helps!

Answer 2

The public static method named evens that takes in 1 argument int a, and returns a String containing all positive even numbers with each separated by a comma is in explanation part.

What is programming?

The process of creating a set of instructions that tells a computer how to perform a task is known as programming.

Here's a possible implementation in Java:

public static String evens(int a) {

   if (a < 0) {

       return "NONE!";

   }

   StringBuilder result = new StringBuilder();

   for (int i = 0; i <= a; i += 2) {

       if (i > 0) {

           result.append(",");

       }

       result.append(i);

   }

   return result.toString();

}

Thus, this method first checks if the argument is negative, and if so, returns the String "NONE!".

For more details regarding programming, visit:

https://brainly.com/question/11023419

#SPJ2


Related Questions

When you read in data from a file using the read() method the data is supplied to Python in the form of:
A. A list of Strings
B. A String
C. A list of lists
D. Raw ASCII values

Answers

Answer:

B. A String

Explanation:

Remember, there are other methods or ways to read data from a file such as readlines(), and the for ... in loop method.

However, if you read in data from a file using the read () method the data would be supplied to Python in the form of a String (or single String). This is the case because a String supports only characters, unlike lists that could contain all the data types.

Using the read() method in python is used to read in files such as text files, csv and other file types. The read() method will render the read in data as as a string.

In general, the read in data from the file is supplied in the form of a string, however, depending on the version of python which is being used, the string type may vary.

When using python 2, the data is supplied as a bytestring while the data is supplied a unicode string in python 3.

Hence, the read() method renders data as a string.

Learn more : https://brainly.com/question/19973164

For risk monitoring, what are some techniques or tools you can implement in each of the seven domains of a typical IT infrastructure to help mitigate risk

Answers

Answer:

 a. User Domain: Create awareness for acceptable user-policies and security risk to educate employees of pending risk.

b. Workstation Domain: Install anti-virus and constantly update the system software.

c. LAN Domain:  Access control list or ACL should be configured in routers and port security in switches to avoid hackers physically connecting to the network.

d. LAN-to-WAN Domain: Configure firewalls and intrusion detection and prevention protocols to mitigate unwanted access.

e. WAN Domain: Configure demilitarized or demarcation zone to provide secure access and prevent unwanted users from accessing network information.

f. Remote Access Domain: The use of VPNs to grant remote access to users or employees working from home and internet protocol security (IPsec) to encrypt the packet transmission.

g. Systems/Applications Domain: Administration should be well trained and ensure to get security software patches from appropriate vendors and testing them before use.

Explanation:

Risk monitoring is one of the IT infrastructure risks management plan that observes and analyzes the threats of risk in an IT infrastructure.

Question No. 5:
Convert the following by showing all the steps necessary
a) (1001111) 2 = ( ) 10
b) (11000001) 2 = ( ) 16
c) (E16) 16 = ( ) 10
d) (56) 10 = ( ) 16
e) (63) 10 = ( ) 2

Answers

Answer:

The answers are:

[tex]a) (1001111)_2 = (79 )_{10}\\b) (11000001)_2 = (C1 )_{16}\\c) (E16)_{16} = ( 3606)_{10}\\d) (56)_{10} = (38 )_{16}\\e) (63)_{10}= (111111 )_2[/tex]

Explanation:

a. (1001111) 2 = ( ) 10

In order to convert a base 2 number to base 10 number system the place values are used.

the procedure is as follows:

[tex](1001111)_2\\=(1*2^6)+(0*2^5)+(0*2^4)+(1*2^3)+(1*2^2)+(1*2^1)+(1*2^0)\\=(1*64)+(0*32)+(0*16)+(1*8)+(1*4)+(1*2)+(1*1)\\=64+0+0+8+4+2+1\\=79[/tex]

b) (11000001) 2 = ( ) 16

In order to convert a base 2 number into base 16, group of 4-bits are made starting from right to left

The groups from the given number are:

1100 0001

Then the groups are changed in to decimal/hexa

So,

[tex](1100)_2 = (1*2^3)+(1*2^2)+(0*2^1)+(0*2^0)\\=(1*8)+(1*4)+(0*2)+(0*1)\\=8+4+0+0=12=C\\\\0001=1[/tex]

Writing in the same order in which groups were:

[tex](C1)_{16}[/tex]

c) (E16) 16 = ( ) 10

[tex](E16)_{16}\\=(E*16^2)+(1*16^1)+(6*16^0)\\=(E*256)+(1*16)+(6*1)\\=3584+16+6\\=3606[/tex]

d) (56) 10 = ( ) 16

Dividing by 16 and noting remainders

16        56

           3 - 8

So,

The number in base 16 is 38

e) (63) 10 = ( ) 2

Dividing by 2

2         63

2         31 - 1

2         15 - 1

2          7 -  1

2          3 -  1

            1 - 1

So the  number after converting in base 2 is:

111111

Hence,

The answers are:

[tex]a) (1001111)_2 = (79 )_{10}\\b) (11000001)_2 = (C1 )_{16}\\c) (E16)_{16} = ( 3606)_{10}\\d) (56)_{10} = (38 )_{16}\\e) (63)_{10}= (111111 )_2[/tex]

A(n) __________ prevents outsiders from accessing corporate information the user does not want others to see.

Answers

Answer:

Firewall

Explanation:

A Firewall prevents outsiders from accessing corporate information the user does not want others to see. It could be in the form of a hardware or a software.

Most companies use this in order to keep confidential informations from the public. This is very important to prevent unauthorized access which could lead to different types of problems in the long run.

differences between formula and function as used in spreadsheet​

Answers

I hope it is helpful for you ...

_______________ is a computer networking protocol used by hosts to retrieve IP address assignments.

Answers

Answer:

DHCP

Explanation:

stands for dynamic host configuration protocol and is a network protocol used on IP networks where a DHCP server automatically assigns an IP address and other information to each host on the network so they can communicate efficiently with other endpoints.

The type of wireless access that uses a modem to connect to cell towers is called ___
broadband.

Answers

Answer:

What are the Wireless Broadband Technologies?

What are the Wireless Broadband Technologies?

Wireless broadband services are similar to wired broadband in that they connect to an internet backbone usually a fiber-optic trunk; however they don’t use cables to connect to the last mile or business/residences. Instead they use Wireless Fidelity (Wi-Fi) connections or radio waves. A computer or mobile device has a wireless adapter that translates data into a radio signal and transmits the signal using an antenna. A wireless router receives the signal, decodes it and then sends it to the Internet through a wired Ethernet connection.

Fixed wireless is a type of high-speed Internet access where connections to service providers use radio signals rather than cables. Fixed wireless offers connections speeds between 1 and 10 mbps and use transmission towers similar to cell phone towers that communicate to a resident’s transceiver equipment that, as the name implies is fixed at the premise. The transceiver equipment communicates with the providers’ ground stations.

Wireless fidelity (Wi-Fi) is a fixed, short-range technology that is often used in combination with DSL, fixed wireless, fiber, or cable modem service to connect devices within a home or business to the Internet using a radio link between the location and the service provider’s facility. Wi-Fi service can be available in your home or at community locations (airports, coffee shops, schools, businesses, etc.) and are often called “hotspots.” A Wi-Fi network uses radio waves, similar to two-way radio communications. A computer has a wireless adapter that translates data into a radio signal and transmits it using an antenna. A router receives the signal, decodes it, and then sends the information to the Internet using a physical connection, usually via an Ethernet cable, a cable that carries the broadband signal between the modem, router, computer, and other wired Internet capable devices.

Mobile Wireless (3G, 4G)

Mobile wireless is high-speed wireless broadband connection that is accessible from random locations. The locations depend on the provider’s cellular towers and monthly service plans. Many technologies make up wireless networks, but no matter the technology or acronyms you read or hear, mobile wireless networks are radio systems.

Mobile wireless services are continually being upgraded to provide data transmission speeds considered to be broadband. The faster mobile wireless networks are referred to as 3G or 4G.The “G” stands for “generation,” meaning 3rd and 4th generation or the evolution of broadband cellular networks; supposedly, each generation provides a faster more secure wireless network. A mobile wireless service requires a base station that is connected to a high capacity landline data transmission network to reach the Internet. In other words, it’s never wired OR wireless; ultimately, it has to be both. Wireless broadband in common usage means that the so-called “last mile” connection to the user is done via radio signals from a tower to a cell phone or other wireless devices (e.g., a tablet).

Long Term Evolution (LTE)

LTE is a 4G technology provides increased peak data rates, reduced latency, scalable bandwidth capacity than 4G predecessors. LTE can manage multi-cast and broadcast streams and handle quick-moving mobile phones. It uses an IP-based network architecture that allows for seamless handovers for voice and data to older model cell towers.

Satellite

Satellite broadband is sometimes the only option available to users in very rural or sparsely populated areas. Like telephone and television services, satellites orbiting the earth provide necessary links for broadband. With satellite service, you must have a clear view of the southern sky. Satellite service can be disrupted by weather conditions and changes in line of sight to the orbiting satellite. Satellite may have a higher monthly service charge than other broadband options and the need to purchase more home or business equipment compared to the other options. Because satellites are located a significant distance from customers, there are issues of “latency” and therefore a noticeable time lag between sending and receiving data by the end customer.

Downstream and upstream speeds for satellite broadband depend on several factors, including the provider and service package purchased the consumer’s line of sight to the orbiting satellite, and the weather. Satellite speeds may be slower than DSL and cable modem, but they can be about 10 times faster than the download speed with dial-up Internet access. Service can be disrupted in extreme weather conditions.

Source: Information from Wisconsin’s Broadband Reference Guide produced by: WI Public Service Commission, UW-Extension Madison, and the Center for Community Technology Solutions, January 2014

Explanation:

What happens if you try to compile and run this program?
#include <stdio.h>
int main (void) {
int i = 1, j = 0, k;
k = (i >> j) + G >> i) + (i >> i) + (j >>
k <<= i;
printf("%d", k):
return 0;
}​

Answers

Answer:

identifier "G" is undefined

Explanation:

The syntax of the code you provided is incorrect, so you cannot run this program.

BOTH QUESTIONS ONLY FILL IN C++ CODEWrite a copy constructor for CarCounter that assigns origCarCounter.carCount to the constructed object's carCount. Sample output for the given program:Cars counted: 5Sample program:#include using namespace std;class CarCounter { public: CarCounter(); CarCounter(const CarCounter& origCarCounter); void SetCarCount(const int count) { carCount = count; } int GetCarCount() const { return carCount; } private: int carCount;};CarCounter::CarCounter() { carCount = 0; return;}// FIXME add copy constructorvoid CountPrinter(CarCounter carCntr) { cout << "Cars counted: " << carCntr.GetCarCount(); return;}int main() { CarCounter parkingLot; parkingLot.SetCarCount(5); CountPrinter(parkingLot); return 0;}QUESTION #2!!!!!!!!!!!!!!!!_______________----------------------------------------------_______________________________Overload the + operator as indicated. Sample output for the given program:First vacation: Days: 7, People: 3Second vacation: Days: 12, People: 3Sample program:#include using namespace std;class FamilyVacation{ public: void SetNumDays(int dayCount); void SetNumPeople(int peopleCount); void Print() const; FamilyVacation operator+(int moreDays) const; private: int numDays; int numPeople;};void FamilyVacation::SetNumDays(int dayCount) { numDays = dayCount; return;}void FamilyVacation::SetNumPeople(int peopleCount) { numPeople = peopleCount; return;}// FIXME: Overload + operator so can write newVacation = oldVacation + 5,// which adds 5 to numDays, while just copying numPeople. void FamilyVacation::Print() const { cout << "Days: " << numDays << ", People: " << numPeople << endl; return;}int main() { FamilyVacation firstVacation; FamilyVacation secondVacation; cout << "First vacation: "; firstVacation.SetNumDays(7); firstVacation.SetNumPeople(3); firstVacation.Print(); cout << "Second vacation: "; secondVacation = firstVacation + 5; secondVacation.Print(); return 0;}

Answers

Answer:

im lost tell me a question then ill answer

Explanation:

Memory compression is a useful alternative to paging:_______.
a. when the compression algorithm is can achieve the best possible compression ratio.
b. when the system has slow magnetic disks but not faster SSDs.
c. when the speed of the compression algorithm fastest.
d. even when the system has faster SSDs.

Answers

Answer:

d. even when the system has faster SSDs.

Explanation:

Given that Memory compression and Paging are both means of performing memory management in different ways.

However, Memory compression is a useful alternative to paging "even when the system has faster SSDs."

This is because Memory compression enhances the productivity of Radom Access Memory, RAM, which in turn increases the performance level of a computer.

Also, paging requires consistent writing on Disks, which has been found to degrade disks most especially solid-state drives, SSDs.

Please solve the ones you can. Solving Both will be appreciated. thank you

Answers

Answer:a=b+c=2ca

Im not sure about this answer

Explanation:

Write a program that asks the user for the name of a text file. The program should display the first 10 lines of the file on the screen. If the file has fewer than 10 lines, the entire file should be displayed along with a message indicating the entire file has been displayed.

Answers

Answer:

Written in Python

filenm = input("File name: ")

myfile = open(filenm+".txt")

for i in range(10):

     line = myfile.readline()

     print(line)

print("End of file")

Explanation:

This line prompts user for file name

filenm = input("File name: ")

This line creates an instance of the file

myfile = open(filenm+".txt")

This line iterates through the 10 lines

for i in range(10):

This line reads the line

     line = myfile.readline()

This line prints each line

     print(line)

This line prints a message indicating that all possible lines have been printed

print("End of file")

The following statements are the rules to be followed in maintaining good health standards in the workplace EXCEPT.
A. Adequate sanitary facilities
B. Wellness of workers
C. Promoting a positive social climate
D. Establishing good relationship with co-workers​

Answers

I think all the statements are the rules to be followed in maintaining good health standard in the workplace

Iman manages a database for a website that reviews movies. If a new movie is going to be added to the database what else will need to be added.

Answers

Answer:

The answer would be a record.

Explanation: Took the test

Florian and Tobias would like to begin communicating using a symmetric cryptosystem, but they have no prearranged secret and are not able to meet in person to exchange keys. What algorithm can they use to securely exchange the secret key?

a. IDEA
b. Diffie-Hellman
c. RSA
d. MD5

Answers

The answer is MD5

Hope this helps you have a great thanksgiving

what is the answer only right answers

Answers

Answer:

hmm....

Explanation:

What printer prints in different languages ​

Answers

Answer:

Printing in a different language

HP Deskjet 2630.Microsoft Windows 10 (32-bit)

Write a complete program that reads a string and displays the vowels. The vowels are A, E, I, O, U and a, e, i, o, u. Here are three sample runs:Sample Run 1Enter a string: Welcome to PythonThe vowels are eoeooSample Run 2Enter a string: Student UnionThe vowels are ueUioSample Run 3Enter a string: AREIOUaeiouRTEThe vowels are AEIOUaeiouENote: your program must match the sample run exactly.using python

Answers

text = input("Enter a string: ")

new_text = ""

vowels = "aeiou"

for x in text:

   if x.lower() in vowels:

       new_text += x

print(new_text)

I hope this helps!

Where in the computer is a variable such as "X" stored?

Answers

Answer:

The value of "x" is stored at "main memory".

Explanation:

Simply Central processing unit, input device and output device can not store the data.

In a program a menu shows a list of?

Answers

Answer:

implemented instructions

Compress
00eb:0000:0000:0000:d8c1:0946:0272:879
IPV6 Address

Answers

Answer:

Compress

00eb:0000:0000:0000:d8c1:0946:0272:879

IPV6 Addres

Explanation:

Let's play Silly Sentences!

[name] was planning a dream vacation to [place].
[name] was especially looking forward to trying the local
cuisine, including [adjective 1] [food 1] and [food 2].

[name] will have to practice the language [adverb] to
make it easier to [verb] with people.

[name] has a long list of sights to see, including the
[noun] museum and the [adjective 2] park.

Answers

Answer:

Miah was planning a dream vacation to paris.

James was especially looking forward to trying local cuisine, including a barber shop , pizza joint, ice cream shop.

Mathew will have to practice the language slower to make it easier to communicate with people.

Jozlynn has a long list of sights to see, including the chicago museum and the lila arboretum park in michigan

Explanation:

Answer:

Ooh, ok ok.

Michelle was planning a dream vacation to Costa Rica. She was especially looking forward to trying the local cuisine, including picadillo, crema de fruta, and quesadillas.

Michelle will have to practice the language thoroughly to make it easier to socialize with people.

Michelle has a long list of sights to see, including the Jade Museum and the dog park.

If you don't mind will you please mark brainliest?! Thanks!  :)

A boundary marks the inside and outside of a system and sets the system apart from its environment.

A. True

B. False

Answers

Answer:

True

Explanation:

The system boundary can be regarded as a conceptual line that demacate

the system that is under study from 'everything else'. which is the environment. The environment consist of things that can influence the system but not part of the system. when the system is small , its boundary will be sharper. Some Large systems usually have multiple boundaries.boundary can as well be regarded as the point of contact which gives room for meeting between a system its environment , it is also point subsystems meet each other. It should be noted that boundary marks the inside and outside of a system and sets the system apart from its environment.

UK UKI
Different
DIFFERENTIATE BETWEEN FORMULA & A FUNCTION GNING EXAMPLE​

Answers

Explanation:

A Formula is an equation designed by a user in Excel, while a Function is a predefined calculation in the spreadsheet application. Excel enables users to perform simple calculations such as finding totals for a row or column of numbers. Formulas and functions can be useful in more complex situations, including calculating mortgage payments, solving engineering or math problems, and creating financial models.

What is created automatically when you install Windows Server 2019 on a system with a disk drive that has never had an OS installed on it before?

Answers

Answer:

System volume

Explanation:

The System Volume Information folder can be regarded as a zone on the hard drive which is usually created by the Operating System, this is utilized

by Windows which allows storing of critical information that is related to the system configuration. As well as the computer storage is concerned, The volume/ logical drive is viewed as a single accessible storage area containing single file system, which lies on a single partition in hard disk.

It should be noted that the System volume is created automatically when you install Windows Server 2019 on a system with a disk drive that has never had an OS installed on it before.

Windows Server 2019 is version of Windows Server server operating system which is a server from Microsoft,

this shows you where text will appear as you type.

Answers

Answer:  what?

Explanation:

PLS HELP I WILL MARK BRAINLIEST

Answers

Answer:B

Explanation: its the nucules

The answer most likely is B

The CEO, calls you into her office and tells you that she's learned that the company needs a database to keep track of supplier contact data as well as the experiences that buyers and operations personnel have with the suppliers. She asks you to begin developing this database. What is your first step in developing the database?

Answers

the database has been a very unique way to park in

Please help. Will give brainliest

Answers

I don’t understand it sorry :(.

Which of the following is a real job title on The interactive media career pathway?

Answers

Answer:

The right answer is A

Explanation:

Plzzzzzzzzzzzzz give me brainiest

The answer to your question is B
Other Questions
Presente del indicativo:Este perro (morder) a los niosA.MordaB.MordiC.Muerde What is the slope?-23-1011325 membership to iron gym cost $40 per month plus $30 registration fee. the monthly cost is deducted automatically from your account. if your starting balance is $350 how many months will you be able to go to the gym before you have to add money to your account?A. 6B. 7C. 8D. 9 when your having a panic attack and your left side of your chest hurts but your chest doesn't stop hurting.please answer this is happening to me and ive been put on anxitey meds for it but it doesnt seem to be working. and ive been to the doctors for heart x-ray and a EKG and everything seems fine. What is the domain and range please? 25 points + Brainliest PLZ HELP DUE RIGHT NOWWhich technological advancement encouraged more mills to be built because they no longer required an immediate water source for power? (4 points)a James Watt's combustion engine improvementsb James Watt's more efficient version of the steam enginec Thomas Newcomen's first steam engined Robert Fulton's steamboat invention What is the slope of the line on the graph? Read the following excerpt from Sullivan's article:If you've ever taken a creative writing workshop, you'vebeen warned never to do this, pile up adjectives, interposedescriptive terms between the reader's imagination andthe scene.Which word best describes the style of this excerpt?A. ExuberantB. ElegiacC. InstructionalD. Conversational Solve the system of equations.x + 3y = -12x + 2y = 6 Which of these 20th-century art movements emphasized emotion over form?A. ExpressionismB. CubismC. FuturismD. Surrealism (Will mark brainliest and give $5 Starbucks digital card Include SC!!!) For which set of triangles can you immediately use the AAS congruence criteria to prove them congruent?(1 point)1. triangles STU and VWX, where TW, UX, and SUVX2. triangles GHI and JKL, where GJ, HK, and GHJK3. triangles MNO and PQR, where NQ, MNPQ, and NOQR Is this a function or not? A skier rides horizontally off of a 200 meter high cliff. If he lands 25 meters away from the base of the cliff, how fast was he skiing as he went off the edge?A. 0.91 m/sB. 2.91 m/sC. 3.91 m/sD. 25.91 m/s How did the Treaty of Paris (1763) affect Florida? Verbal description of a rotation requires: Click all that apply.-Center Point-Horizontal Movement-Vertical Movement-Degree of Rotation-Scale Factor-Direction of Rotation A submarine was situated 800 feet below sea level. If it ascends 250 feet, what is its new position? Show your work Please answer this correctly, and you'll recieve brainliest, Answers below:28=14=0.2563=21=282=41=436=12=0.5 3) You read the following excerpt in a third-person limited point of view: "The English teacher, Mr. Blakemore, demanded that the students complete a minimum of threehours of homework per night." Then you read the following excerpt in a first-person point of view: "I knew Timothy Blakemore when he and I were students and he did everything he could to avoidhomework," you would believe that the author was using____.metonymyironyanalogysymbolismsynecdoche job Diane ran 28.6 miles in a marathon She averaged 6 minutes per mile. How many total minutes did Diane run? What does the expression (20-w)w represent