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
Katena32 [7]
3 years ago
11

Write a program that does the following:

Computers and Technology
1 answer:
Nataly_w [17]3 years ago
8 0

Answer:

Following is the program in Java language:

import java.util.*;//import package

public class Main // main class

{

public static void main(String[] args) // main method

{

    String  firstname,lastname; // Declare the two String variables

    Scanner ob=new Scanner(System.in); // create a object of scanner //class

    System.out.println("Enter the first name:");  // Prompt the user for // enter the first name

   firstname=ob.nextLine();// Read in the first name by user

    System.out.println("Enter the last name:"); // Prompt the user for last //name

   lastname=ob.nextLine();// Read in the last name by user

   System.out.println("Hello " + firstname +' ' +lastname); // print the //firstname,lastname

}

}

Output:

Enter the first name:

San

Enter the last name:

ert

Hello San ert

Explanation:

Following are the description of program

  • Declared two variable of string type i.e "firstname"  and "lastname".
  • Create a instance or object  of scanner class .i.e "ob".
  • Prompt the user to enter the first name in the  "firstname" variable
  • Read in the first name by the user by using the method nextLine() in the first name variable
  • Prompt the user to enter the  last name.
  • Read in the last name by the user by using the method nextLine() in the lastname variable.
  • Finally, print the first name and last name.

You might be interested in
How do you record your own video game Music and post Them on yt
Alex777 [14]

Answer:I would try downloading a beat app and making a song,then posting

Explanation:

8 0
3 years ago
Read 2 more answers
Which network could NOT carry commercial traffic?
sattari [20]

ARPANET would not carry it

4 0
3 years ago
Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
slavikrds [6]

Answer:

Here are the for loop for the given question.

 for (i = 0; i < NUM_VALS; i++)  // for loop

       {

         /* check if the value of i is equal to NUM_VALS or not.If it is

         equal then just print the value without comma.*/

       if(i==(NUM_VALS-1))  // if block

       System.out.print(hourlyTemp[i]);

  /* if i is not equal then just print the value with comma.*/

       else   // else block

       System.out.print(hourlyTemp[i] + ", ");

       }

Explanation:

In this we iterating the for loop  and check the condition

check if the value of i is equal to NUM_VALS or not.If it is  equal then just print the value without comma

If i is not equal then just print the value with comma .

Output:

90,92,94,95

3 0
3 years ago
The preferred means of creating multithreaded Java applications is by implementing the ________ interface. An object of a class
Kaylis [27]

Answer:

Runnable.

Explanation:

Java is an all round programming language which is typically object-oriented and class-based. It was designed by James Gosling, developed by Sun microsystems and released officially on the 23rd of May, 1995. Java programming language is designed to have only a few implementation dependencies as possible because it was intended to be written once, and run on any platform.

Java makes concurrency to be available to software developers through the application programming interface (API) and the language. Also, it supports multiple threads of execution, by making each thread have its respective program counter and method-call stack, which then allow concurrent executions with other threads.

The preferred means of creating multithreaded Java applications is by implementing the runnable interface. An object of a class that implements this interface represents a task to perform. The code is public void run ().

8 0
3 years ago
Andy uses a dial-up modem to connect to the Internet. He usually browses news sites, but he notices that online video takes a lo
Korvikt [17]
The answer is C. The modem does not contain enough bandwidth to handle modern video streaming.
4 0
4 years ago
Read 2 more answers
Other questions:
  • Can you use a backup camera when you take your drivers test
    9·1 answer
  • What is the best strategy to avoid paying interest on your credit card
    8·1 answer
  • Alto Innovations creates custom software for organizations. The company's managers want to build a high-performance culture in t
    11·1 answer
  • A relational database is different from a simple database because it has more than one _____.
    13·1 answer
  • What is a job that was created by automobiles
    9·1 answer
  • How do web bugs invade a person's privacy?
    7·1 answer
  • Can someone URGENTLY help me with my java code (I WILL GIVE BRAINLIEST)!? Ive been working on it for hours and its not working!
    12·1 answer
  • A program that will accept the ages of girls and boys and calculate the total and average age​
    15·1 answer
  • Which insert image option allows a user to insert images from the internet?
    5·2 answers
  • How can you create a messages to look like an IMessage?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!