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
Rasek [7]
4 years ago
14

I. Given the following Java code fragment, what is output? int a, b; String c, d, e; String x = new String("I LOVE"); String y =

"java!"; a = x.length( ); System.out.println("1) " + a); b = y.length( ); System.out.println("2) " + b); c = y.toUpperCase( ); System.out.println("3) " + c); d = x.toLowerCase( ); System.out.println("4) " + d); e = x.concat(y); System.out.println("5) " + e);
Computers and Technology
1 answer:
Levart [38]4 years ago
7 0

Answer:

Output: The question segment gives the following output--

1) 6

2) 5

3) JAVA!  

4) i love

5) I LOVEjava!

Explanation:

  1. "1) 6" comes because "6" is the length of "I LOVE" which is the value of "x" variable and "x.length( )" statement gives the length of the value of "x" variable which is stored on "a" variable and "a" will be printed with "1)" symbol.
  2. "2) 5" comes because "5" is the length of "java!" which is the value of "y" variable and "y.length( )" statement gives the length of the value of "y" variable which is stored on "b" variable and "b" will be printed with "2)" symbol.
  3. "3) JAVA! " comes because "JAVA!" is the upper case letter of "java!" which is the value of "y" variable and "y.toUpperCase( )" statement change the value from lower case to uppercase of the value of "y" variable which is stored on "c" variable and "c" will be printed with "3)" symbol.
  4. "4) i love " comes because "i love" is the lower case letter of "I LOVE" which is the value of "x" variable and "x.toLowerCase( )" statement change the value from uppercase to lowercase of the value of "x" variable which is stored on "d" variable and "d" will be printed with "4)" symbol.
  5. "5) I LOVEjava! " comes because " I LOVEjava! " is the mixed value of the "x" and "y" variable. It prints because "x.concat(y);" statement combines the x and y value and stored in an "e" variable and "e" will be printed with "5)" symbol.
You might be interested in
A growling noise is heard only when the driver exerts force on the clutch pedal. No noise is heard when the clutch pedal is up.
Harrizon [31]

Answer:

answer a

Explanation:

the pilot bearing isnt moveing there fore makeing a nose

7 0
3 years ago
You are responsible for a rail convoy of goods consisting of several boxcars. You start the train and after a few minutes you re
maks197457 [2]

Answer:

The program in C++ is as follows:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

   int cars;

   cin>>cars;

   double weights[cars];

   double total = 0;

   for(int i = 0; i<cars;i++){

       cin>>weights[i];

       total+=weights[i];    }

   double avg = total/cars;

   for(int i = 0; i<cars;i++){

       cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl;    }

   return 0;

}

Explanation:

This declares the number of cars as integers

   int cars;

This gets input for the number of cars

   cin>>cars;

This declares the weight of the cars as an array of double datatype

   double weights[cars];

This initializes the total weights to 0

   double total = 0;

This iterates through the number of cars

   for(int i = 0; i<cars;i++){

This gets input for each weight

       cin>>weights[i];

This adds up the total weight

       total+=weights[i];    }

This calculates the average weights

   double avg = total/cars;

This iterates through the number of cars

   for(int i = 0; i<cars;i++){

This prints how much weight to be added or subtracted

       cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl;    }

4 0
3 years ago
Explain the history of computing device of mechanical era
gayaneshka [121]

Answer:

The mechanical age can be defined as the time between 1450 and 1840. A lot of new technologies were developed in this era due to an explosion of interest in computation and information. Technologies like the slide ruler (an analog computer used for multiplying and dividing) were invented in this period.

5 0
3 years ago
Match the definitions of different business communication to the type of document
Sladkaya [172]

Answer:

Convey more factual data that helps facilitate decision making  - REPORTS

Reports are made with factual data to show the condition of the subject so convey more factual data that helps in decision making.

Are one page long  - MEMORANDUMS

Memorandums are used to convey new information and are usually brief which means they take one or two pages.

Are written in a block style, with the body text aligned along the left margin  - BUSINESS LETTERS

Business letters are to be as formal as possible and this includes writing them block style and aligning the text to the left margin.

Allow attachments of files, such as images  - EMAILS

As emails are softcopy and computer based, they allow for the attachment of other files such as images, documents, audio, etc.

8 0
3 years ago
Read 2 more answers
Which of the following is NOT an algorithm?
Nina [5.8K]
I’m pretty sure it would be “A novel assigned in English class” (algorithm is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.) Example: the recipe for baking a cake.
3 0
3 years ago
Other questions:
  • Compare and contrast how the roles of women and men in society are changing​
    14·1 answer
  • The very first thing I should type when creating a formula in excel is:
    15·2 answers
  • PLEASE HELPPPPPPP
    15·1 answer
  • Which of the following is *not* true about logging user and program actions on a computer?
    10·1 answer
  • 4. Together, what do the divisions of the DHSMV do? A. Make sure lines are long B. Use more money than other government organiza
    14·1 answer
  • Design 3 classes: Computer - Superclass
    11·1 answer
  • Please help fast
    5·1 answer
  • Which item is developed last in the cyclical design process
    11·1 answer
  • True or Fale A criminal defense attorney's main focus is to convict the accused of a crime, and a state prosecutor is to defend
    12·2 answers
  • The following is a function:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!