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
Pharming involves redirecting users to a fraudulent Web site even when the user has typed in the correct address in the Web brow
Anna35 [415]

Answer:

Pharming involves:

redirecting users to a fraudulent website even when the user has typed in the correct address in the web browser.          

Explanation:

  • When a hacker steals your confidential and private information by installing a malicious code on your computer which misdirects you to fake and fraudulent websites, this is called pharming.
  • Hacker installs virus on your computer which manipulates the host files on your computer.
  • The hacker uses DNS cache poisoning to attack DNS services on your computer which makes many users to enter fraudulent site, unknowingly, as they type the URL of the real website.
  • These fraudulent website developed by hacker can install virus on your computer and steal confidential information from your computer.
  • Pharming is done by hackers in order to steal sensitive data from a person's computer.
8 0
3 years ago
The official record of a high school student's performance is called:
Ivanshal [37]
The answer is transcript. When you apply for colleges and they want to see your high school records, they simply ask for your transcript. Hope I helped :)
5 0
3 years ago
It's the same drop-down answers for both.
tia_tia [17]

Answer:

First, medium: can see all the subject but maintain the focus in him

Second, close-up: To se the facial expressions and emotions

5 0
3 years ago
Can I have help on this
never [62]

the answer is the seconf one


6 0
3 years ago
Read 2 more answers
unlike tv or newspaper ads, internet communications are interactive, and consumers can choose which messages and information the
Softa [21]

Companies often engage the services of Advertising firms to market their products. Company web offerings can be tailor-made for the consumers.

  • Advertising agencies are firms that makes, plan and handle the advertising needs of any business. They are known for handling negotiations creating tailored marketing campaigns.

A lot of agencies do not want to talk about pricing until they know what you can afford to spend.

Tailored content are delivered experiences that speak directly to customers.

This agencies uses their connections and resources to make one's campaign successful and cost-efficient.

Learn more from

brainly.com/question/23477855

5 0
2 years ago
Other questions:
  • What is something you can do to stay connected to the relationships in your life while we spend this time at home?
    13·1 answer
  • Which of the following is not a job title associated with a career in visual and audio technology? master control operator produ
    9·1 answer
  • kevin is working on a financial project that involves a lot of statistical information. He needs software that allows him to ent
    8·2 answers
  • Your health insurance company gives you a discount if you wear a fitness-tracking bracelet. After wearing it for a few months, y
    5·1 answer
  • Which are valid double statements for java? double a = 0; double b = -1.0; double c = -425; double d = 6340; double e = -1.0; do
    12·2 answers
  • Convert the following pseudocode to C++ code. Be sure to define the appropriate variables. Store 25 in the speed variable. Store
    5·1 answer
  • Your company's data center has suffered a recent power outage, and corporate applications were unavailable for two days. You hav
    11·1 answer
  • Which of the following are NOT possible using the RANDOM(a, b) and DISPLAY(expression) abstractions?
    10·1 answer
  • Question 1
    8·1 answer
  • Is orgenized maningful and useful data​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!