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
Lemur [1.5K]
3 years ago
10

What is output with the statement System.out.println(x+y); if x and y are int values where x=10 and y=5? Group of answer choices

15 105 10 5 x+y An error since neither x nor y is a String
Computers and Technology
1 answer:
makkiz [27]3 years ago
4 0

Answer:

15

Explanation:

Java's output statement can be used to print String values when the are enclosed in a pair of quotations marks (" "). Given that the values x =10 and y=5 have been declared as integers, the statement:

System.out.println(x+y); will output 10+15 = 15

On the other hand consider if these variables x and y were declared as Strings like this;

String x="10";

String y ="5";

Then the output of the statement System.out.println(x+y); will be 105

You might be interested in
In Java.Use a single for loop to output odd numbers, even numbers, and an arithmetic function of an odd and even number. Use the
rosijanka [135]

Answer:

<em>This program is written using java programming language</em>

<em>Difficult lines are explained using comments (See Attachment for Source file)</em>

<em>Program starts here</em>

import java.util.*;

import java.lang.Math;

public class oddeven{

public static void main(String [] args)

{

 double even,odd;//Declare variables even and odd as double

 //The next iteration prints odd numbers

 for(int i = 1;i<=173;i+=2)

 {

  odd = i;

  System.out.format("%.4f",odd);//Round to 4 decimal places and print

System.out.print("\t");

 }

 System.out.print('\n');//Start printing on a new line

 //The next iteration prints even numbers

 for(int i = 0;i<=173;i+=2)

 {

  even=i;

  System.out.format("%.4f",even);//Round to 4 decimal places and print

System.out.print("\t");

 }

 System.out.print('\n');//Start printing on a new line

 double  ssqrt;//Declare ssqrt to calculate the square root of sum of even and odd numbers

 for(int i = 0;i<=173;i+=2)

 {

  ssqrt = Math.sqrt(2*i+1);//Calculate square root here

  System.out.format("%.4f",ssqrt); //Round to 4 decimal places and print

System.out.print("\t");

 }

}

}

Explanation:

Libraries are imported into the program

import java.util.*;

import java.lang.Math;

The following line declares variables even and odd as double

double even,odd;

The following iteration is used to print odd numbers  with in the range of 0 to 173

for(int i = 1;i<=173;i+=2)  {

odd = i;

System.out.format("%.4f",odd); This particular line rounds up each odd numbers to 4 decimal places before printing them

System.out.print("\t"); This line prints a tab

}

The following code is used to start printing on a new line

System.out.print('\n');

The following iteration is used to print even numbers  with in the range of 0 to 173

for(int i = 0;i<=173;i+=2)

{

even=i;

System.out.format("%.4f",even); This particular line rounds up each even numbers to 4 decimal places before printing them

System.out.print("\t"); This line prints a tab

}

The following code is used to start printing on a new line

System.out.print('\n');

The next statement declares ssqrt as double to calculate the square root of the sum of even and odd numbers

double  ssqrt;

for(int i = 0;i<=173;i+=2)

{

ssqrt = Math.sqrt(2*i+1);This line calculates the square root of sum of even and odd numbers

System.out.format("%.4f",ssqrt); This particular line rounds up each even numbers to 4 decimal places before printing them

System.out.print("\t"); This line prints a tab

}

Download java
7 0
3 years ago
Does anyone know the code for codeHS 5.4.7 teenagers?
Over [174]

Answer:

function start(){

var age = readInt("Age: ");

if(age == 15){

println("Yes, you are a teenager.");

}else{

println("No, you are not a teenager.");

}

}

Explanation:

6 0
3 years ago
Mention 5 advantages of internet​
alexira [117]

Answer:

1) We can get various types of information, knowledge.

2) We can communicate with each other no matter where they are if they have internet connection.

3) It can be used as a source of entertainment.

4) Through internet, we can work from home especially in this quarantine time.

5) Through internet, we can show our talent and skills.

Hope it helps :)

If you liked it, please mark this answer as the brainliest one.

4 0
4 years ago
Which type of chart is most useful when a user is trying to visually represent sets of data as parts of a whole, such as product
nataly862011 [7]

Pie chart, I’m fairly sure the rest aren’t real

5 0
3 years ago
Read 2 more answers
In case of rdt 3.0 Stop and Wait, suppose we send a packet of 1KB through 1 Gbps link and RTT=20 msec. Find the sender utilizati
Mamont248 [21]

Answer:

a. Utilization =  0.00039

b. Throughput = 50Kbps

Explanation:

<u>Given Data:</u>

Packet Size = L = 1kb = 8000 bits

Transmission Rate = R = 1 Gbps = 1 x 10⁹ bps

RTT = 20 msec

<u>To Find </u>

a. Sender Utilization = ?

b. Throughput = ?

Solution

a. Sender Utilization

<u>As Given </u>

Packet Size =  L = 8000 bits

Transmission Rate = R = 1 Gbps = 1 x 10⁹ bps

Transmission Time = L/R = 8000 bits / 1 x 10⁹ bps = 8 micro-sec

Utilization =  Transmission Time / RTT + Transmission Time

                 =  8 micro-sec/ 20 msec + 8 micro-sec

                 =  0.008 sec/ 20.008 sec

Utilization =  0.00039

b. Throughput

<u>As Given </u>

Packet Size = 1kb

RTT = 20ms = 20/100 sec = 0.02 sec

So,

Throughput = Packet Size/RTT = 1kb /0.02 = 50 kbps

So, the system has 50 kbps throughput over  1 Gbps Link.

5 0
3 years ago
Other questions:
  • WILL UPVOTE ALL.
    7·1 answer
  • Calculated fields can be entered in queries. What row should you type a calculated field in?
    13·1 answer
  • Where should you look to find contact information about a company? I. on the company website II. at your local library III. in t
    11·2 answers
  • . If you have written the following source code:
    9·1 answer
  • Beth would like to run an nmap scan against all of the systems on her organization's private network. These include systems in t
    15·1 answer
  • What was the first computer programming language?
    7·2 answers
  • Hello! I am a new coder, so this is a simple question. But I am trying to create a code where you enter a number, then another n
    8·1 answer
  • Write a multi-way if statement that compares the double variable pH with 7.0 and makes the following assignments to the bool var
    11·1 answer
  • To manage OpenLDAP policies over Command Line Interface (CLI), a certain type of file is needed. What is this type of file calle
    7·1 answer
  • Which of the following declares an abstract method in an abstract Java class?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!