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
A number of related records that are treated as a unit is called
vladimir2022 [97]
The answer is file , related records organized by common a attribute is a field , and information in that in a record is called data
8 0
3 years ago
Relational operators allow you to ________ numbers
Sonja [21]

Relational operators allow an end user to <u>compare</u> numbers.

<h3>What are relational operators?</h3>

Relational operators can be defined as a programming language construct which allows an end user to compare both numbers and char values.

Also, it can be used to determine whether one number is less than (<), greater than (>), equal to (=), or not equal to another.

This ultimately implies that, relational operators allow an end user to <u>compare</u> numbers.

Read more on relational operators here: brainly.com/question/14995818

#SPJ1

6 0
2 years ago
Which of the following refers to programs that install themselves on computers without the users' knowledge or permission and sp
defon

Answer:

The correct answer is C "Computer Virus"

Explanation:

Computer virus is a piece of code that install itself in a computer without the knowledge and permission of the user and start replicating itself and as it execute it self also start damaging the computer files.

Computer virus have ability to replicate itself and it attached to files and move from one computer to another with these files when files are transferred.

5 0
4 years ago
The objective is to work with your partner to fix the HTML bugs so that none of the code is pink. In general, how do I change HT
Elan Coil [88]

Answer:

Click inspect then go to change color

Explanation:

there you go have a nice day!

8 0
3 years ago
Which individual of the following would be most likely to be directly concerned with web security?
prohojiy [21]
Network Engineer is correct.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which item is essential to know before sketching a navigation menu flowchart
    15·2 answers
  • Each phase of the system development life cycle is accomplished as a discrete, separate step. (1 point) (Points : 1.5) True
    7·1 answer
  • What type of computer is likely to use so-dimms, have an internal power supply, and use a desktop processor socket?
    10·1 answer
  • Julian is adding a column of numbers as he inputs expenses from his receipts. Holly wants to create a simple comparison between
    13·1 answer
  • What are the trinity of the computer system
    15·1 answer
  • suspect that several users are attempting to install unauthorized software. Upon researching, you discover that the attempts wer
    12·1 answer
  • Puede existir la tecnologia sin la ciencia y sin las tecnicas,explique si o no y fundamente el porque de su respuesta
    11·1 answer
  • WILL MARK BRAIN LIST!
    9·2 answers
  • Write about how this item was important to you.
    9·1 answer
  • What is the output of the code? (CHECK IMAGE)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!