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
maw [93]
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.
Computers and Technology
1 answer:
cupoosta [38]3 years ago
7 0

Answer:

Following are the program in java language:

import java.util.*; // import package

public class Main

{

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

{

 int num; // integer variable declaration

 double r; //double varaible declaration

 char ch; // char variable declaration

Scanner scnr=new Scanner(System.in); // creating the instance of scanner

 System.out.println("Enter the string:");

 String str=scnr.nextLine(); // reda string by user

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

 num=scnr.nextInt(); // Read integer value by the user

 System.out.println("Enter the Double value:");

 r=scnr.nextDouble(); // read double value by user

 System.out.println("Enter the character value:");

 ch= scnr.next().charAt(0); // read character by user

 System.out.print(num + " ,"); // display them in a single line

 System.out.print( " " +r +" ,");//dislpay in a single line  

  System.out.print( " " +ch +",");//dislpay in a single line

 System.out.print(" " +str);//dislpay in a single line

}

}

Output:

Enter the string:

ram

Enter the integer value:

34

Enter the Double value:

45.789

Enter the character value:

r

34 , 45.789 , r, ram

Explanation:

Following are the description of program

  • Read the integer ,string,char,double value by the user by using scanner class in "num","str","ch" and "r" variable respectively
  • Print that value in a single line separated by comma by System.out.println statement.

You might be interested in
Which internet explorer security feature restricts the browsing session information that can be tracked by external third-party
Anarel [89]

Tracking protection internet explorer security feature restricts the browsing session information that can be tracked by external third-party websites and applications

The internet can be a dangerous place, and it's important to take steps to protect your privacy. One way to do this is to enable tracking protection in your web browser.

Tracking protection is a security feature that restricts the information that can be tracked by external websites and applications. This means that your browsing session will be more private, and your data will be less likely to be collected and used without your consent.

To enable tracking protection in Internet Explorer, go to the Tools menu and select Internet Options. On the Privacy tab, click the Tracking Protection button. You can then choose to enable tracking protection for all websites, or only for certain websites that you trust.

Enabling tracking protection can help to keep your data safe and your privacy protected. So if you're concerned about online privacy, be sure to enable this feature in your web browser.

Learn more on internet explorer here:

brainly.com/question/28431103

#SPJ4

6 0
1 year ago
Help fast plzzzzzzzzzzzz ​
eimsori [14]

Answer:

Which question would you like help with?

4 0
3 years ago
Read 2 more answers
A spreadsheet is an interactive computer program used for
aksik [14]
Making charts, files that need complicated calculations
5 0
3 years ago
You need to upgrade memory in a system but you don't have the motherboard documentation available. you open the case and notice
Harlamova29_29 [7]
<span>The three yellow slots probably indicate triple channeling, which means the board uses DDR3 DIMMs. To know for sure, remove a DIMM and look for the position of the notch on the DIMM.</span>
6 0
3 years ago
The location on the Word screen where text will be entered is known as the _____.
mixas84 [53]
Insertion point is represented by blinking vertical line
4 0
3 years ago
Other questions:
  • Which of the following statements about Java Class Libraries is false: a. Java class libraries consist of classes that consist o
    9·1 answer
  • Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
    10·1 answer
  • To move one screen to the left press ____.
    9·1 answer
  • Write the function mystrchr(). the function has two parameters: a const char * s pointing to the first character in a c-style st
    14·1 answer
  • A mobile device user has tried to install a new app numerous times without success. She hasclosed all unused apps, disabled live
    12·1 answer
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
  • Can someone help me get spotify premium
    7·2 answers
  • These days, a digital signature is just as legitimate and trusted as an old-fashioned John Hancock on paper.
    9·1 answer
  • If I am working in a document and wish to follow a hyperlink, what should I do?
    7·1 answer
  • SO I LIKE BOILED EGGS AND MY MUM WAS MAKING SALAD FOR DINNER SO I SAID DID YOU MAKE AND EGG-TRA ONE FOR ME
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!