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
alex41 [277]
3 years ago
9

Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho

se four values on a single line separated by a space.Enter integer:99Enter double:3.77Enter character:zEnter string:Howdy99 3.77 z Howdyimport java.util.Scanner;public class BasicInput {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);int userInt;double userDouble;// FIXME Define char and string variables similarlySystem.out.println("Enter integer:");userInt = scnr.nextInt();// FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by a space
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
5 0

Answer:

import java.util.Scanner;

public class BasicInput {

   public static void main(String[] args) {

       //Create an object of the Scanner class

       Scanner scnr = new Scanner(System.in);

       

       //Define int and double variables

       int userInt;

       double userDouble;

       

       //Define char and string variables similarly

       char userChar;

       String userString;

       

       //Prompt the user to enter an integer

      System.out.println("Enter integer:");

       //Store the input in the integer variable

       userInt = scnr.nextInt();

       

       //Prompt the user to enter a double

        System.out.println("Enter double:");

       //Store the input in the double variable

      userDouble = scnr.nextDouble();

       

       //Prompt the user to enter a char

        System.out.println("Enter char:");

       //Store the input in the char variable

      userChar = scnr.next().charAt(0);

       

       //Prompt the user to enter a string

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

       //Store the input in the string variable

      userString = scnr.next();

       

       //Output the four values on a single line

       //separated by a space

       System.out.println(userInt + " " + userDouble + " " + userChar + " " + userString);

       

   }

   

}

Sample Output:

Enter integer:

>>12

Enter double:

>>23

Enter char:

>>s

Enter String:

>>asdasd

12 23.0 s asdasd

Explanation:

The code above has been written in Java. It contains comments explaining every part of the code. Please go through the comments.

You might be interested in
What is the best stratiget to avoid paying intrest in your credit cared
pochemuha
Paying it in full month over month.
4 0
3 years ago
Transistor was the major technology used during the ____ generation of hardware.
gulaghasi [49]

 

<span>Second generation of computer apparatus. Second Generation: Transistors (1956-1963)</span>

The world would see transistors substitute vacuum tubes in the second generation of computers. The transistor was created at Bell Labs in 1947 but did not see omnipresent use in computers until the late 1950s. 

The transistor enormously higher positioning to the vacuum tube, allowing PCs to transform into littler, speedier, less expensive, more vitality effective and more dependable than their first-generation predecessors. Though the transistor still generated a great deal of heat that subjected the computer to destruction, it was a vast development over the vacuum tube. Second-generation computers still confidence on punched cards for input and printouts for production.

<span> </span>

6 0
3 years ago
What type of computer processing system is characterized by data that are assembled from more than one location and records that
ikadub [295]

Answer:

d) Online, real-time systems.

Explanation:

The options are:

a) Batch processing systems.

b) Personal computer systems.

c) Data compression systems.

d) Online, real-time systems.

And the correct option is D. Online, a real-time system. And this is because it is this which is characterized by the data which is assembled from more than one location as it is online, and various clients from various locations enter the data, and it's updated immediately, as it is a real-time system, which is updated in real-time. And hence D. is the correct option. The data compression system takes the data from one location at a time. The batch processing system is made up of different programs for input, output, and process. and hence is different from real-time, which requires continual all the three. And a PC is not made to a specific function, and it does different activities. Hence, its also not the right option here.

5 0
4 years ago
Respond to Social EngineeringYou work as the IT security administrator for a small corporate network. The company president has
Cloud [144]

Answer:

Delete any emails that are attempts at social engineering

Explanation:

The actual URL of an email could tell if an hazardous, an unwanted or an unexpected email is being received, hence one can be sure of social engineering through this means. Hence, this could provide a solution to this problem.

4 0
4 years ago
To use the wireless network in the airport you must pay the daily fee unless you are a subscriber to the service. Express your a
just olya [345]

Answer:

s ----> w V d

Explanation:

<em>s: You are a subscriber to the service</em>

<em>w: You can use the wireless network in the airport</em>

<em>d: You pay the daily fee</em>

From the statement, we can deduce that To use the wireless in the airport, you either have to be a subscriber to the service or you pay the daily fee.

The statement can be written logically as :

If you are a subscriber to the service, then you can use the wireless network in the airport or you can pay the daily fee

it can be written symbolically as:

s --------> w V d

5 0
4 years ago
Other questions:
  • _____ is the network protocol that deals with the routing of packets through interconnected networks to the final destination.
    9·1 answer
  • Where does gateway antivirus scan for viruses
    7·1 answer
  • In our networked world, we have more opportunities to stereotype, which is problematic because:
    7·2 answers
  • If a DirectAccess user has issues with their laptop or remote device, what can be enabled to facilitate help desk personnel get
    11·1 answer
  • Use BlueJ to write a program that reads a sequence of data for several car objects from an input file. It stores the data in an
    5·1 answer
  • In information security, a specification of a model to be followed during the design, selection, and initial and ongoing impleme
    5·1 answer
  • Which feature should be used prior to finalizing a presentation to ensure that audience members with disabilities will be able t
    13·2 answers
  • What is a task that is not associated with loading existing data into a new ERP system.
    11·2 answers
  • Assume three jobs arrive at approximately the same time (arrival time are all 0), but Job A arrives slightly before Job B, and J
    13·1 answer
  • Online banking is a convenience that mostly affects which area of your life?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!