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
What does using indirect quotations allow a writer to do?
Marrrta [24]
Indirect quotations can add information that strengthens your content in many of the same ways as direct quotations so. Essentially, indirect quotes carry the meaning of a speaker or writer's original words without using the exact words.
7 0
3 years ago
Read 2 more answers
You can invoke or call a method from another program or method. When methods must share data, you can pass the data into and ret
san4es73 [151]

Answer:

1. You can invoke or call a method from another program or method: TRUE

2. When methods must share data, you can pass the data into and return the data out of methods: TRUE

3. A method could be called using any numeric value as an argument, whether it is a variable, a named constant, or a literal constant: TRUE

Explanation:

4 0
3 years ago
Omar wants to know how his organization has been doing financially over the last year. He wants to also compare this information
IRINA_888 [86]

C is the right answer for apex

8 0
2 years ago
Read 2 more answers
Describe the Order of Operations in Java programming.
cestrela7 [59]

Answer:

It stands for Parentheses, Exponents, Multiplication/Division, Addition/Subtraction. PEMDAS is often expanded to the mnemonic "Please Excuse My Dear Aunt Sally" in schools. Canada and New Zealand use BEDMAS, standing for Brackets, Exponents, Division/Multiplication, Addition/Subtraction.

5 0
2 years ago
According to your course, two benefits of a cloud-based system are_ and_
vodomira [7]
Data backup and collaboration.
4 0
3 years ago
Other questions:
  • Which reading strategy refers to reading only the key words and phrases?
    13·2 answers
  • The _____ function is a logical function that returns a TRUE value if any of the logical conditions are true and a FALSE value i
    10·1 answer
  • Linda subscribes to a cloud service. The service provider hosts the cloud infrastructure and delivers computing resources over t
    10·1 answer
  • Which letter would appear in the third position of the standard wheel marking of a hard-grade wheel?
    10·2 answers
  • Hi wanna play fortnite tomorrow add me im batjoker09 no caps or spaces
    13·1 answer
  • Write a sed command that will display all lines of the birthday file that do not contain the string March. What was the sed comm
    13·1 answer
  • Why does the peot use a simular pharase at the beggining of each stanza
    8·1 answer
  • Why optical disk is slower than magnetic disk.?​
    9·2 answers
  • What is the most used gaming keyboard in 2022?
    8·1 answer
  • Question 5 / 15
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!