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
ladessa [460]
3 years ago
12

Given a variable n that is associated with a positive integer and a variable s that is associated with the empty string, write s

ome statements that use a while loop to associate s with a string consisting of exactly n asterisks (*) . (So if n were associated with 6 then s would, in the end, be associated with "******" .
Computers and Technology
1 answer:
k0ka [10]3 years ago
8 0

Answer:

//Scanner class is imported to allow the program receive user input

import java.util.Scanner;

//Class Solution is created

public class Solution {

   // The main method which is the beginning of program execution

   public static void main(String args[]) {

       //Scanner object 'scan' is created to accepted user input from the keyboard

       Scanner scan = new Scanner(System.in);

       //A prompt is displayed to the user to enter a positive number

       System.out.println("Please enter a positive number: ");

       //User input is stored as variable n

       int n = scan.nextInt();

       // An empty string is assigned to s

       String s = "";

       

       // Beginning of while loop

       // The loop begin while n is a positive number

       while(n > 0){

           //s is concatenated with *

           s+= "*";

           // the value of n is reduced.

           n--;

       }

       

       // The value of the string s is displayed to the screen

       System.out.println(s);

       

   }

}

Explanation:

First the Scanner class is imported, then the class Solution is created. Inside the main method, a prompt is first displayed to the user to enter a positive number. After that, a scanner object scan is created to receive the user input and assigned to n. An empty string is assigned to s.

Then the while loop repeat for each value of n greater than 0 and concatenate "*" to s.

Finally, the value of s is displayed to the user.

You might be interested in
An international pharmaceutical company is fully compliant with local and international regulations. However, they suffered a ma
lesya [120]

Accenture respond to the international pharmaceutical company the reason of the data breach is because compliance to local and international laws does not necessarily enforce security.

<h3>What are the three main causes of a data breach?</h3>

A hack, such as phishing or stolen credentials; a mistake, such as lost devices or wrong system configuration; or a physical attack, such as a skimmer at a gas station pump that collects credit card data, all resulted in data being exposed or stolen.

Thus, due to there is not an enforcement of security.

For further details about data breach, click here:

brainly.com/question/24174542

#SPJ1

7 0
2 years ago
Which of the following apply to the definition of Wide Area Networks? Check all of the boxes that apply.
zalisa [80]

Answer: Cover large geographic areas, link many networks together, known as WANs

Explanation:

Just took it got it right

7 0
3 years ago
Read 2 more answers
Three business partners are forming a company whose name will be of the form "name1, name2 and name3". however, they can't agree
V125BC [204]

ANSWER: Here 3 print line statements are needed. So, the best code would be

import java.util.Scanner;

public class business {

public static void main(String args[]){

Scanner stdin = new Scanner(System.in);

String Larry = stdin.nextLine();

String Curly = stdin.nextLine();

String Moe = stdin.nextLine();

System.out.println(Larry +"\t" + Curly + "\t" + Moe);

System.out.println(Larry + "\t" + Moe + "\t" + Curly);

System.out.println(Curly + "\t" + Larry + "\t" + Moe);

System.out.println(Curly + "\t" + Moe + "\t" + Larry);

System.out.println(Moe + "\t" + Larry + "\t" + Curly);

System.out.println(Moe + "\t" + Curly + "\t" + Larry);

}

}

5 0
3 years ago
Compare and contrast between Client/Server and Peer-to-Peer networks. What are some of the business benefits of using such netwo
fgiga [73]
Client/Server and Peer-to-Peer networks are the two major network architecture models in use today. They each have advantages and disadvantages that can be used to benefit a particular outcome.

Briefly, the client/server model relates to one or many client performing relatively simple requests, which are then executed by a server. The server is performing more complex tasks, and often interacting with many clients simultaneously. Examples of client/server models include most websites, including the Brainly page you are running right this instant. Your web browser is acting as a client, and the Brainly.com website is running as a web server. It receives simple requests or information from your browser, such as clicking on a question or text typed by your keyboard, and then acts on this information by consulting a database, returning values, or returning a whole new web page to your browser. The client/server model is very powerful in business as it allows powerful and secure server-side processing and relatively simple clients. Office 365 that runs all microsoft office suites such as word and excel in a web browser on 'the cloud' is an example of a highly sophisticated client/server architecture.

By contrast, peer-to-peer networks are a distributed architecture of equals. Instead of a simple client and complex server, all clients are equals and link together to form nodes on a distributed network. There is no central control (server) and each node acts as a client and server to other nodes. This is also an extremely powerful network; as there is no central control it is difficult to shut down a peer-to-peer network. Taking out one node will not break the network in comparison to the client/server architecture where if the server goes down, services halt. Prime examples of famous peer-to-peer networks are the Bitcoin network and similar cryptographic currency networks, and music and file sharing networks such as Torrents. The torrent tracker websites are client/server however once a torrent is loaded into a torrent downloading application, the file is collectively downloaded from hundreds of 'peers' across the world as part of the torrent peer-to-peer network.


3 0
4 years ago
Which of the following can be considered classifications of technology companies? (Select all that apply)
artcher [175]
The answer is A, B, and C.

D. is too broad a term that actually includes A-C. So in other words there is no company that specializes in "Technology"

There are companies that specialize in E-Commerce, Hardware, and Security.

I guess if you wanted to say Google and Apple are technology companies you could say that but even they would fit into a particular classification. Google would be a Search Engine technology, and Apple would probably still be considered a hardware company even though both companies are involved across all of the 3 subjects in the answer.
4 0
4 years ago
Other questions:
  • In cell F29, use an IF function to display the correct Shipping Charge, based on the amount of the Discounted Total. If the Disc
    9·1 answer
  • On the Internet, you can use a(n)______to look for information on any topic, such as books, movies, scholarly articles, news, an
    6·2 answers
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • You use worksheets to perform calculations. How do you perform these calculations? ______ are used for performing calculations i
    12·2 answers
  • Organizational sites with .org domains are usually managed by what type of organization
    7·1 answer
  • Read the Security Guide about From Anthem to Anathema on pages 238-239 of the textbook. Then answer the following questions in t
    14·1 answer
  • Hi weegy, what is the latest android os?
    9·1 answer
  • Implement the Dining Philosophers problem (described on pages 167-170 in the textbook (chapter 2.5.1)). Create a Graphical User
    13·1 answer
  • Photographs, illustrations, and videos are increasingly created an and viewed in digital formats. True or False​
    5·2 answers
  • Will creates an entry in his calendar and marks it as an all-day instance. Which item has he created?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!