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
ask user to input a string. (assume length of input string is 1) If the string is lower case, print its upper case If the string
Helga [31]

Answer:

import java.util.*;

import java.util.Scanner;

class Main

{

public static void main(String[] args) {

System.out.println("Enter String");

Scanner sc1=new Scanner(System.in);

String s1= sc1.nextLine();

boolean b= isNumerc(s1);

if (b== true)

{

    System.out.println("Its number: Sorry");

}

else

{

boolean a=isStringUpperCas(s1);

if(a == false)

{

    System.out.println(s1.toUpperCase());

}

else

{

    System.out.println(s1.toLowerCase());

}

}

}

private static boolean isStringUpperCas(String st1){

     

     

      char[] arr = st1.toCharArray();

     

      int k =0; boolean flag=true;

      while(k<arr.length)

      {

         

          if( Character.isUpperCase( arr[k] ))

          {

              flag=true;

              k++;

          }

          else

          {

              flag=false;

              k++;

          }

         

      }

      return flag;

}

             

  public static boolean isNumerc(final String st1) {

     

      if (st1 == null || st1.length() == 0) {

          return false;

      }

      for (char ch : st1.toCharArray()) {

          if (!Character.isDigit(ch)) {

              return false;

          }

      }

      return true;

  }

 

}

Explanation:

Please find the program above.

8 0
3 years ago
I have this assignment due TONIGHT BEFORE 10PM! Please help. 50 points for whoever will help!! Here is the assignment.
saveliy_v [14]

Answer:

# include <iostream.h>

# include <conio.h>

using namespace std;

int generatelist ( int z[]);

int addlist(int x []; int y []);

int mullist(int x []; int y []);

int displayList(int z[]);

main()

{

int a[10] , b[10], add[10], mul[10];

cout<<"Enter value in array a";

generatelist(a[10]);

cout<<"Enter value in array b";

generatelist(b[10]);

for (int i=0; i<=9; i++)

{

add[i]=addlist( a[i], b[i]);

cout<<"sum of list = "<< add[i];

}

for (int i=0; i<=9; i++)

{

mul[i]=mullist( a[i], b[i]);

cout<<"multiplication of list = "<< mul[i];

}

for (int i=0; i<=9; i++)

{

displayList(a[i]);

}

for (int i=0; i<=9; i++)

{

displayList(b[i]);

}

for (int i=0; i<=9; i++)

{

displayList(add[i]);

}

for (int i=0; i<=9; i++)

{

displayList(mul[i]);

}

getch();

}

int generatelist ( int z[])

{

for (int j=0 ; j<=9 ; j++)

{

cin>>z[j];

return z[j]

}

}

int addlist(int x []; int y [])

{

int add

add=x+y;

return add;

}

int mullist(int x []; int y [])

{

int mul

mul=x*y;

return mul;

}

int displayList(int z[]);

{

for(int i=0; i<=9;i++)

cout << z[i]

}

7 0
4 years ago
Sally thought of adding a new paragraph after the
hram777 [196]

Answer:

1) press the enter key

2) start typing the new paragraph

Explanation:

did it on edg

7 0
4 years ago
Given the Query Data Type, which of the following is incorrectly matched with the corresponding Storage Data Type?
Tamiku [17]

Answer:

<h2>c) Date : Date</h2>

Explanation:

A type of attribute of data is called data type in computer science, data types tells the interpreter how a person wants to use the data. The basic data types are supported by most of the programming languages, the basic data types are Integers, float, characters, strings, point numbers and arrays. The terminology may differ from one language to other.

3 0
3 years ago
Which sentence best descibes an activity stream
Marina CMI [18]

Answer: a list of recent activities performed by an individual, typically on a single website.

Explanation:

7 0
3 years ago
Other questions:
  • Which presenter would most likely benefit from a custom slide show?
    15·1 answer
  • Movie that has a knife and shower​
    14·1 answer
  • What does the following code print?double[] myList = {1, 5, 5, 5, 5, 1};double max = myList[0];int indexOfMax = 0;for (int i = 1
    8·1 answer
  • Fred has to write a report on the general opinion of the influence of television on political decision-making. What internet res
    7·2 answers
  • The primary difference between a DVD and a CD is that one is read and written using optics while the other uses magnets.
    12·2 answers
  • What is the quickest way to change the format of a table?
    8·1 answer
  • Documenting Business Requirements helps developers control the scope of the system and prevents users from claiming that the new
    13·1 answer
  • A network administrator is attempting to troubleshoot an issue regarding certificates on a secure website. During the troublesho
    8·1 answer
  • True or False: Mapping annotations are exclusive - an annotated method will only be accessible to requests sent to a matching UR
    14·1 answer
  • Help me. thank you very much
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!