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
castortr0y [4]
3 years ago
6

Assume that nextWord is a String variable that has been given a String value consisting entirely of letters. Write some Java cod

e that outputs the message "First half of the alphabet" , provided nextWord precedes "N" in alphabetic ordering. IfnextWord does not precede "N" in alphabetic ordering, the code should output"Second half of the alphabet" . (Note that "N"uses double quotes to produce aString value, as opposed to using single quotes to produce achar value.) '
Computers and Technology
1 answer:
wel3 years ago
8 0

Answer:

The code example is given below with explanation in c++ language.

Explanation:

Comments will explain what's going on in the code. Below code is already compiled and tested.

#include <time.h>

#include <iostream>

#include <sstream>

using namespace std;

int main(void)

{

//defining start and end time variable

// which will be used to break the infinte loop

   time_t endwait;

   time_t start = time(NULL);

   time_t seconds = 3; // end loop after this time has elapsed

cout<<"Input your number :";

long userNum;

cin>> userNum;

// initializing end time by adding seconds with start time

   endwait = start + seconds;

   // defining outputString which will concatenate all the  

   // divisible numbers in loop

string outputString="";

// bool isCompleted will use to check whether our  

// loop breaks successfully or time is expired.

bool isCompleted=true;

// iterate loop until it comes to 1. as in loop

// the program already displayed the 1 value.

   while (userNum>1)

   {  

  // checking start and end time comparison to  

  // break the infinite loop after some seconds

    if(start >= endwait){

     cout<< "Program end never reached.";

     isCompleted=false;

     break;

 }

 

    userNum=userNum/2;

   // defining stringstream to convert from long to string

    stringstream longToString;

    longToString<<userNum;

  // concatenating all the values

    outputString = outputString + longToString.str()+" ";

   // re initializing the start time with current time.

       start = time(NULL);

   }

   

  // check if while loop breaks successfully then print the

   // series of numbers here.

   if(isCompleted) {

    cout << outputString;

}

   return 0;

}

You might be interested in
How does the zone theory of optical systems resolve the apparent incompatibility of trichromacy and opponency?
lara [203]

Answer:

Money money money

Explanation:

4 0
3 years ago
All it services and servers are equally critical. <br> a. True <br> b. False
g100num [7]

False

Not all IT services are equally critical. In an increasingly digital world whereby cyber threats are a big threat, it is vital to prioritize the critical assets in order to achieve digital resilience. This involves building tighter defenses in systems that are critical.

4 0
3 years ago
​Five elements that can prove the genuineness of a user. What you know, what you have, what you are, what you do, and where you
nataly862011 [7]

Authentication factors are the factors that describe about the ingenuition or origination of the user. This is the tag that tells about the actuality of user that is getting connected with internet by the five elementals.

Hope this helps!

8 0
3 years ago
What is returned by the code: range (20, 100, 30) ?
Hunter-Best [27]
Answer : (20, 50, 80)





4 0
2 years ago
Why do we need the binary system?
nika2105 [10]

Answer:

We need to have binary numbers because that is how computers process data.

Explanation:

6 0
3 years ago
Other questions:
  • Recall that book ciphers do not necessarily require a full book to decode, but instead any written text, such as the Declaration
    6·1 answer
  • What is the significant feature of computer capabilities?​
    14·1 answer
  • Before his job interview, Shabnam took the time to carefully wash and iron his best khaki pants and a button-down shirt. He even
    15·2 answers
  • A computerized spreadsheet program is useful for
    6·2 answers
  • Enterprise Resource Planning (ERP) is an example of a single user database.
    7·1 answer
  • Write a program that receives an character and displays its Unicode. Here is a sample run: Enter an character: E The Unicode for
    8·1 answer
  • What term refers to the text label that describes each data series?
    9·1 answer
  • One key criterion for selecting social networks is the number of daily visitors to the website. when comparing linkedin traffic
    7·1 answer
  • 2. Discuss CORBA functions<br><br>​
    6·2 answers
  • Select the correct answer.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!