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
lakkis [162]
3 years ago
15

Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on th

e same line to the screen
Computers and Technology
1 answer:
Alexus [3.1K]3 years ago
4 0

Answer:

// here is code in java.

// import package

import java.util.*;

// class definition

class Main

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

      // print the name

       System.out.print("my name is Sam. ");

       // print the major

       System.out.print("my major is CS.");

   }catch(Exception ex){

       return;}

}

}

Explanation:

In java, System.out.print() will print the statement but didn't go to the next line.If there is another System.out.print(), then it will also print into the same line.So here first the System.out.print() will print the name and second will print the major in the same line.

Output:

my name is Sam. my major is CS.

You might be interested in
How do you invite someone to a conversation on brainly
Alona [7]
You can’t sorry dude
3 0
3 years ago
If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value
miss Akunina [59]

Answer:

Run time error, no output. If myInt = 0 and other is 3, then 3%0 will never occur...apart from that, myInt was neither declared nor initialized

Explanation:

8 0
3 years ago
This isn't school wise but like.. I can't log into IMessage so I decided to try and log into FaceTime but thats not working. Cau
Butoxors [25]
Restart the device that may help
4 0
3 years ago
True False The explicit location always tells you where users are located when they type the query.
gregori [183]
It's true for only some users
7 0
3 years ago
Read 2 more answers
This algorithm requires you to find the perimeter of 12 different squares.
k0ka [10]

Answer:

BEGIN

SET count = 1

WHILE count <= 12 THEN

     INPUT length

     perimeter = length * length

     PRINT perimeter

END WHILE

END

Explanation:

You can also set count to 0 and in while loop use count < 12 to loop just 12 times just as above

4 0
3 years ago
Other questions:
  • Write a new function called "listmax" based on the following IPO # function: listmax # INPUT: a list # PROCESSING: obtains the l
    9·1 answer
  • What is the first step in the exchange between a web browser and a database?
    7·1 answer
  • What is the hexadecimal and decimal equivalent of the binary number 110010001110
    5·1 answer
  • Bulldog Holdings is a U.S.-based consumer electronics company. It owns smaller firms in Japan and Taiwan where most of its cell
    5·1 answer
  • Select the correct answer.
    11·1 answer
  • Design and implement an application that reads a set of values in the range 1 to 100 from the user and then creates a chart show
    8·1 answer
  • Plsss help me plsssssss
    11·1 answer
  • Interactivity and Blank______ are two important capabilities of the Internet in the Blank______ relationship.
    14·1 answer
  • What are the nuclear codes?
    14·1 answer
  • The specialized programs used by the operating systems to help ensure that memory is used properly and there are no memory confl
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!