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
What is the big-O performance estimate of the following function?
larisa [96]

Answer:

The time complexity of the code is O(log₇n).

Explanation:

The i is updated by 7*i.On each iteration i is multiplied by 7.So on finding the time complexity of the code given above it will come out to  be log base 7.

When we divide the input by 2 the time complexity is log base 2.

So on dividing it by 7 we get the time complexity of log base 7.

8 0
3 years ago
Read 2 more answers
What is the minimum number of bits you need to encode the 26 letters of the alphabet plus a space?Pace?
Andrei [34K]

Answer

5 bits

Explanation

A bit is the least or the smallest unit of data in a computer. They are  the units of information in information theory, consisting of the amount of information required to specify one of two alternatives 0 and 1. This is because A bit has a single binary value, either 0 or 1

If you use roman alphabet A to Z lets use log 2(26)=4.7 bits. when you round off it will be 5 bits.

8 0
3 years ago
You decide to buy some stocks for a certain price and then sell them at another price. Write a program that determines whether o
ser-zykov [4K]

Answer:

#here is code in python.

#read number of shares

num_share = int(input("Enter number of shares:"))

#read purchase price

buy_p = float(input("Enter purchase price:"))

#read sell price

sell_p = float(input("Enter sale price:"))

#total buying cost

buy_cost=buy_p*1.03*num_share

#total selling cost

sell_cost=sell_p*0.97*num_share

#if net profit

if(sell_cost>buy_cost):

   print("After the transaction, you made " +str(sell_cost-buy_cost)+ " dollars.")

#if net loss

else:

   print("After the transaction, you lost " +str(buy_cost-sell_cost)+ " dollars.")

Explanation:

Read the total number of shares from user.Then read buying price of a share and selling price of a share.Then calculate total buying cost including commission.Calculate total selling cost excluding the commission.If total buying cost is greater than total selling cost the print the profit else print the loss in the transaction.

Output:

Enter number of shares:10

Enter purchase price:10

Enter sale price:10

After the transaction, you lost 6.0 dollars.

4 0
3 years ago
A series of dialog boxes that guides you through creation of a form or report is called a ____.
victus00 [196]

Answer:

c i think it mit be right i'm sorry if it's not ,

Explanation:

it's c or D.

4 0
2 years ago
The blank method returns an integer between the two provided numbers. It can take the value of either of the provided numbers
Elis [28]

Answer:random

Explanation:

A random method returns a number between zero and one.

4 0
3 years ago
Other questions:
  • PLEASE HELP!!!!! MUCH OBLIGED!!!!
    15·1 answer
  • Which of the following illustrates an example of a Boolean data type?
    15·1 answer
  • The number of bits per pixel is called what
    7·1 answer
  • I Just Realized................
    7·2 answers
  • Think about some of the most memorable and forgettable games ever created. They can be games that were
    15·1 answer
  • The term generally used to describe storage systems that function at high speeds is:
    12·1 answer
  • The first tools that analyzed and extracted data from floppy disks and hard disks were MS-DOS tools for ____ PC file systems.
    6·1 answer
  • I have been charged for brainly plus yet I still have to watch ads why? What do I do?
    12·2 answers
  • What is the largest place value in a 12 bit binary number?
    10·1 answer
  • Brianna is feeling overwhelmed by the amount of digital
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!