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
IgorC [24]
3 years ago
5

Part 3a. Largest power of two less than (10 pts) Implement the method public static int largestPow2LessThan(int n) which calcula

tes and returns the largest integer power of 2 less than n. You may assume n is greater than 1. For example, if n is 10, the largest power of 2 less than n is 8 (8 is 2 cubed). If n is 8, the answer is 4. If n is 2, 20
Computers and Technology
1 answer:
Oksi-84 [34.3K]3 years ago
5 0

Answer:

Check the explanation

Explanation:

========================================================================

// Part 3 (a)

public static int largestPow2LessThan(int n) {

   int two = 1;

   while (two * 2 < n) {

       two *= 2;

   }

   return two;

}

================================================================

You might be interested in
Is regular Facebook use healthy? Why or why not?
melamori03 [73]
No. social media makes people share too much information about their personal lives.
7 0
3 years ago
Read 2 more answers
To maintain your body temperature, your body converts chemical potential energy into thermal energy T or F
PilotLPTM [1.2K]
True
This is physics btw
CPE --> TE
4 0
3 years ago
QUESTION
Lady_Fox [76]

Answer:

Explanation:

#include <iostream>

using namespace std;

int main ()

{

   int responses[30],count[6];

   int score = 0;

   string resp = " ";

   for (int i = 0; i < 30; i++)

   {

    responses[i] = 0;

   }

   for (int i = 0; i < 6; i++)

   {

    count[i,1]=0;

    count[i,2]=0;

    count[i,0]=0;

   }

   while ((resp != "Y") && (resp != "y"))

   {

    for (int i = 0; i < 30; i++)

    {

        while ((score > 5) || (score < 1))

           {

            cout << "Student " << (i+1)<< " please enter a value (1-5):";

            cin >> score;

        }

           responses[i] = score;

           if((score > 5)||(score<1))

           {

               if(score==1) count[1]++;        

               if(score==2) count[2]++;        

               if(score==3) count[3]++;        

               if(score==4) count[4]++;        

               if(score==5) count[5]++;        

           }

           score = 0;

    }

    cout<< "Response               Frequency              Percentage"<<endl;;

    cout<< "    1                      "<<count[1]<<"               "<<(count[1]/30)<<"%"<<endl;

    cout<< "    2                      "<<count[2]<<"               "<<(count[2]/30)<<"%"<<endl;

    cout<< "    3                      "<<count[3]<<"               "<<(count[3]/30)<<"%"<<endl;

    cout<< "    4                      "<<count[4]<<"               "<<(count[4]/30)<<"%"<<endl;

    cout<< "    5                      "<<count[5]<<"               "<<(count[5]/30)<<"%"<<endl;

    cout<< "Do you want to exit? Press Y to exit any other key to continue: ";

    cin>> resp;

   }

   return 0;

}

8 0
3 years ago
Word processing programs have different view options that you can use depending on the tasks your performing
inysia [295]

Answer:

Microsoft Word has five types of views for a document, and there are a different set of advantages with each of them. There is a full-screen reading option, print layout, web layout, Draft and the Outline, and you can find what purpose they server through their name. And you can change the views of a document in two ways. You can either hit the View tab or you can select a certain view from the View tab. Or you can make use of the view button which is next to the zoom slider, which you can see at the bottom right section of the work space. Let's have a look at each of them now.

Explanation:

Microsoft Word has five types of views for a document, and there are a different set of advantages with each of them. There is a full-screen reading option, print layout, web layout, Draft and the Outline, and you can find what purpose they server through their name. And you can change the views of a document in two ways. You can either hit the View tab or you can select a certain view from the View tab. Or you can make use of the view button which is next to the zoom slider, which you can see at the bottom right section of the work space. Let's have a look at each of them now.

Word Views

The Print Layout View

Its the default one, and you will find this one as you open the document. It's best when you are documenting with things such as images, footers, columns headers, etc. And each of the components is going to be visible. You will hence get a view of documents, and how it looks like as per the page breaks.

The full-screen reading view is for reading purposes. It also shows how a printed page will look like.

Web Layout View

This gives us a view of how the document will look like on the web page. And the text gets wrapped to fit into the view if required.

Outline View

This helps when you want to move the sections in your documents, or if you are creating an outline.

Draft View

This will help you to quickly edit the text with the document being opened as a draft, and the headers and footers cannot be viewed in this view.

5 0
3 years ago
F1: 2^14 formula ....................................................................
QveST [7]

Answer:

=POWER(2,14)

Explanation:

The complete question is to write the given formula in cell F1

We have:

F1 = 2^\wedge {14}

The above formula implies 2 raised to the power of 14.

In Excel, this can be achieved using the power function

And the syntax is:

=POWER(m,n)

which means m^n

So, 2^14 will be entered in cell F1 as:

=POWER(2,14)

4 0
3 years ago
Other questions:
  • Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
    10·2 answers
  • Is the cell phone changing our views about polite and impolite behavior? For example,
    15·2 answers
  • Do you need to know javascript to learn python?
    8·1 answer
  • Help!!!!!!!!!!!!!!!!!!!
    12·1 answer
  • Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). Sample output w
    12·1 answer
  • The main advantage of a solid state drive is:
    5·1 answer
  • Even though a high-level programming language
    11·1 answer
  • Obtaining the data of a video file from a flash drive is an example of a(n) _________ operation.
    6·1 answer
  • This can change the fit of your respirator. A) A mustacheB) A beardC) Weight gainD) All of the above
    15·1 answer
  • Explain the concepts of GIGO—garbage in, garbage out. Why do you think it’s a helpful concept in coding? How do you think it can
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!