1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Allushta [10]
3 years ago
12

Create a method called randomValues that uses a while loop to generate a random number between 1-25 until the value 10 is genera

ted. Therefore, 10 will be the value that stops your loop from generating a random number.
Computers and Technology
1 answer:
ahrayia [7]3 years ago
3 0

Answer:

The method in Java is as follows:

public static void randomValues(){

    Random r = new Random();

    int sentinel = 10;

    int randNum = r.nextInt(24) + 1;

    while(randNum!=sentinel){

        System.out.print(randNum+" ");

        randNum = r.nextInt(24) + 1;

    }

    System.out.print(sentinel);

}

Explanation:

This defines the method

public static void randomValues(){

This creates a random object, r

    Random r = new Random();

This sets the sentinel value to 0

    int sentinel = 10;

This generates a random number

    int randNum = r.nextInt(24) + 1;

This loop is repeated until the the random number is 10

    while(randNum!=sentinel){

Print the generated number

        System.out.print(randNum+" ");

Generated another random number

        randNum = r.nextInt(24) + 1;     }

Print the sentinel (i.e. 10)

    System.out.print(sentinel);

}

You might be interested in
Virtualization, like cloud computing, is a technology that can be useful for _____ sites. hot warm business cold
natima [27]

Answer: Hot sites

Explanation:

 Virtualization in the cloud computing is the technology that are useful for the hot sites. It basically making the virtual image of the network devices so that it can be easily use multiple machine at the similar time.

There are various types of benefits of the virtualization in the cloud computing are as follow:

  • It protect the system from the system failure.
  • It is the cost effective technology.
  • By using this we can easily transfer the data from the physical storage to the virtual server.
8 0
3 years ago
Which of the following is not a characteristic of a good value log entry
Stolb23 [73]
What are we supposed to find? Help us
6 0
2 years ago
1. Your task is to process a file containing the text of a book available as a file as follows:A function GetGoing(filename) tha
Irina18 [472]

Answer:

See explaination

Explanation:

#function to count number of characters, words in a given file and returns a list of words

def GetGoing(filename):

file = open(filename)

numbrOfCharacters =0

numberOfWords = 0

WordList = []

#iterate over file line by line

for line in file:

#split the line into words

words = line.strip().split()

#add counn of words to numberOfWords

numberOfWords = numberOfWords + len(words)

#find number of characters in each word and add it to numbrOfCharacters

numbrOfCharacters = numbrOfCharacters + sum(len(word) for word in words)

#append each word from a line to WordList

for word in words:

WordList.append(word)

#display the result

print("The number of characters: ", numbrOfCharacters)

print("The number of Words: ", numberOfWords)

#return the list of words

return WordList

#find matches for keywords given in textlist

def FindMatches(keywordlist, textlist):

for keyword in keywordlist:

keyword = keyword.lower()

print ("The number of occurrences of {} is: {}".format(keyword,len([i for i, s in enumerate(textlist) if s == keyword])))

#main

booktext = GetGoing("constitution.txt")

FindMatches (['War', 'Peace', 'Power'], booktext)

7 0
3 years ago
At _________ the ip header is exposed and so filtering or firewalls can be applied to ip addresses. select one:
zvonat [6]
T<span>he IP packet header is what tells an IP-based host what to do with the packet that was received. 
</span>The TCP/IP<span> model describes the </span>protocols used by the Internet. The third layer is the Network layer and in the case of the Internet (the Internet Protocol IP). <span>The </span>Internet layer<span> is responsible for addressing, packaging, and routing functions.</span>
At layer 3 the IP header is exposed and so filtering or firewalls can be applied to IP addresses. 
7 0
3 years ago
In what way would web-based applications be useful to organizations?
SIZIF [17.4K]

Answer:

to share information through e-mail messaging

to increase trafficking through their web sites

to facilitate the use of desktop virtualization

Explanation:

The organization employees can share the information via an email client like outlook express as well. However, if the email option is included within the web application then it will be a kind of expeditating communication or speed up communication, as the users can mail from within the web application itself. And the web application does serve as a website as well, and hence can help in increasing the trafficking. And since its a sort of SaaS, it does facilitate the use of desktop virtualization. However, the purpose of the web application can change only with the new version, or else it is not possible. And hence, the fourth option is not legitimate fully. And hence, the correct options are as mentioned above in the answer section.

8 0
3 years ago
Other questions:
  • Dinah is using an I.D.E to write, modify, and save code. Which tool should she use?
    8·2 answers
  • When using an online media source, students should ensure the information is
    13·2 answers
  • How would you delete a slide from your presentation after selecting it?
    12·1 answer
  • Provide an example of a question that could NOT be answered with a binary message. Explain why this is the case, making referenc
    7·1 answer
  • What property of semi-metals is useful in the computer industry?
    7·1 answer
  • What is the purpose of the Occupational Safety and Health Act?
    7·2 answers
  • A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields
    15·2 answers
  • The merge sort algorithm____________.A. Can be used only on vectors of even length.B. Works by reducing vectors down to the base
    9·1 answer
  • Note oj cyber security​
    6·1 answer
  • Why are default parameters useful? *This is JavaScript*
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!