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
lapo4ka [179]
3 years ago
11

I just need some help working out this Java code! I can list the instructions below:

Computers and Technology
1 answer:
Ipatiy [6.2K]3 years ago
5 0

Answer:

public class CountSpaces

{

   public static void main(String[] args)

   {

       String quote = "The concept of infinity is meaningless inside of an insane human mind.";

       int nrSpaces = calculateSpaces(quote);

       System.out.println("Nr spaces in your quote is " + nrSpaces);

   }

   

   public static int calculateSpaces(String inString)

   {

       int count = 0;

       

       for (int i = 0; i < inString.length(); i++) {

           if (inString.charAt(i) == ' ') {

               count++;

           }

       }

       return count;

   }

}

Explanation:

In this example there is only one class, and since all methods are static the true concept of the class is not even being used.

You might be interested in
Select the correct answer.
CaHeK987 [17]

Answer:

C. FTP

Explanation:

FTP is a network protocol for transmitting files between computers.

5 0
2 years ago
uppose you are going on a road trip with friends. Unfortunately, your headlights are broken, so you can only drive in the daytim
tiny-mole [99]

Answer:

Explanation:

Algorithm:

a. In each day, you will have to loop through the hotels that come to the hotel after you stayed last night.

b. If a hotel 'h' is found at more than 'd' distance away from last stayed hotel, then the hotel previous of 'h' is chosen to wait for that night. This is the greedy step, and you stay in this hotel.

c. The process for steps a and b is then repeated until we've reached the last hotel xn.

Running time:

Notice that the worst case occurs if each hotel is at a distance of successive multiples of 'd'. The best move is to estimate the distance to each hotel twice the whole computation in the scenario.

Thus, the total running time that could occur in the worst case is O(2n) = O(n). This is said to be linear time.

6 0
3 years ago
Which education level has the highest return on investment (ROI)?
Keith_Richards [23]
The correct option is B.
Having a bachelor degree from a college gives the highest returns on investments. People who go to college usually secure high paying jobs compare to their counterparts who have less education.
The type of college one attends also matter, for instance in USA, the college in the first position, which gives the highest return on investment is Massachusetts Institute of Technology  [MIT].
5 0
3 years ago
Read 2 more answers
For activities with output like below, your output's whitespace (newlines or spaces) must match exactly. See this note. Jump to
Vinvika [58]

Answer:

The program to this question can be given as:

Program:

#include<stdio.h>//include header file

int main() //defining main method

{

printf("Hello..! and please vote the answer."); //print value.

return 0;

}

Output:

Hello..! and please vote the answer.

Explanation:

In the given question some information is missing that is the message to be printed, In this code assume some message to be displayed, and the description to the above code as follows:

  • In the above code firstly header file is included for using a basic function like print method, input method, etc.
  • In the next line main method is defined, inside the main method a print function is used in this function a message is passed with a double-quote ("'). When the code will execute it will print the message that is given in the output section.

5 0
3 years ago
You'd like to change the minimum password length policy in the default domain policy group policy preference (gpo). What's the b
Naya [18.7K]

The best way to change the minimum password length policy is to open the Group Policy Management Console by running gpmc.msc from CLI.

<h3>What is a password policy?</h3>

A password policy refers to a set of rules and standard that are designed and developed by the data security of an organization, so as to enhance computer security and ensure all password meet the minimum requirements such as:

  • Password length
  • Password maximum age.
  • Password combination

In this scenario, the best way to change the minimum password length policy is to open the Group Policy Management Console by running gpmc.msc from CLI.

Read more on password here: brainly.com/question/3404286

#SPJ12

8 0
2 years ago
Other questions:
  • _____ is two or more connected computers.
    8·1 answer
  • What tips or techniques should you keep in mind when shooting photographs on a rainy day?
    6·1 answer
  • Problems with using a single Local Area Network (LAN) to interconnect devices on a premise include ______.
    12·1 answer
  • Can y’all help me with these questions ?
    5·1 answer
  • What will happen if you type pseudocode in another language's programming environment and try to run the
    11·1 answer
  • PLEASE HELP!<br> How do you "brainliest" an answer?
    13·2 answers
  • class student_record { public: int age; string name; double gpa; }; Implement a void function that has five formal parameters: a
    15·1 answer
  • I love science its my favorite subject
    13·2 answers
  • Primary functions of lighting are sufficient light to...
    13·1 answer
  • Join my giggl PLEASE i am so bored link will be in comments
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!