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
Which of the following self-contained APs are autonomous, or independent, because they are separate from other network devices a
const2013 [10]

The self-contained APs are autonomous, or independent, because they are separate from other network devices and even other autonomous AP,these are referred to as the Fat APs

Explanation:

A <u>fat AP wireless access poin</u>t is used to manage wireless client. In other words it can provide wireless access independently.It can handle encryption,authentication,and management of communication of client devices.

There are two types of wireless access points, <u>intelligent (fat) and thin wireless access points. </u>

A thin access point can be a radio and antenna, that is  controlled by a wireless switch.

Some  role of Fat APs include

  • It controls the functionality of a central switch
  • It provides for the  Encryption of connected client devices
  • It Manages the connected client devices
  • It also performs the task of Authentication of the  connected client devices
3 0
4 years ago
Create a class that acts as a doubly linked list node. it should contain all the required data fields, at least 1 constructor, a
Zielflug [23.3K]

it is in Microsoft access


8 0
4 years ago
Consider the expression 3 * 2 ^ 2 &lt; 16 5 AndAlso 100 / 10 * 2 &gt; 15 - 3. Which operation is performed second?
miss Akunina [59]

Answer:

In the first expression

3 * 4 will be performed second.

In the second expression

10* 2  will be performed second.

Explanation:

In many programming language, there is an operator precedence where the operator (e.g. +, - , * , / etc) will be executed following a specific order. For example, the operator ^ which denotes power will always be executed prior to * or /    and if / and * exist in the same expression, the operator positioned at the left will be executed first.

Hence, in the expression 3*2^2 < 16 , 2 will be powered to 2 (2^2) first and then only multiplied with 3.

In the expression 100 / 10 * 2 > 15 - 3,  100 will be divided by 10 and then only multiplied with 2.

7 0
4 years ago
Compare Fibonacci (recursion vs. bottom up)
ipn [44]

Answer:

C++ code explained below

Explanation:

#include<bits/stdc++.h>

#include <iostream>

using namespace std;

int FiboNR(int n)

{

int max=n+1;

int F[max];

F[0]=0;F[1]=1;

for(int i=2;i<=n;i++)

{

F[i]=F[i-1]+F[i-2];

}

return (F[n]);

}

int FiboR(int n)

{

if(n==0||n==1)

return n;

else

return (FiboR(n-1)+FiboR(n-2));

}

int main()

{

long long int i,f;

double t1,t2;

int n[]={1,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75};

cout<<"Fibonacci time analysis ( recursive vs. non-recursive "<<endl;

cout<<"Integer FiboR(seconds) FiboNR(seconds) Fibo-value"<<endl;

for(i=0;i<16;i++)

{

clock_t begin = clock();

f=FiboR(n[i]);

clock_t end = clock();

t1=double(end-begin); // elapsed time in milli secons

begin = clock();

f=FiboNR(n[i]);

end = clock();

t2=double(end-begin);

cout<<n[i]<<" "<<t1*1.0/CLOCKS_PER_SEC <<" "<<t2*1.0/CLOCKS_PER_SEC <<" "<<f<<endl; //elapsed time in seconds

}

return 0;

}

7 0
3 years ago
Which of the following pathways relates to the Architecture and construction career cluster
Murrr4er [49]
*Design/Pre-Construction
*Construction
*Maintenance/Opreations
5 0
4 years ago
Other questions:
  • Apps are A. small, downloadable software programs that can run on tablet devices or smartphones. B. programs that can be used to
    11·1 answer
  • Which is an example of withholding you might see on your pay stub
    14·2 answers
  • Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percen
    13·2 answers
  • When doing black and white photography, which file format should you use if possible? JPEG TIFF PNG RAW
    11·2 answers
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • Which platform is the best? (X-box, PC, Playstation, Nintendo Switch, Wii)
    10·1 answer
  • What is the value of the variable index after the Python code below is executed? word = 'bAnana' index = word.find('a')
    10·1 answer
  • The character you control enters the Mystic Palace. Once inside, you find that the game’s world turns upside down. Standing on t
    9·2 answers
  • Write a loop that displays your name 10 times. 2. Write a loop that displays all the odd numbers from 1 through 49. 3. Write a l
    5·1 answer
  • Ndcdeviceid?????????????????????​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!