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
Alborosie
2 years ago
5

Write a Java program to accept an item's name and price from the user and output them to the console

Computers and Technology
1 answer:
Anit [1.1K]2 years ago
6 0

Answer:

// program in java.

// package

import java.util.*;

// class definition

class Main

{// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner object to read inputs

Scanner scr=new Scanner(System.in);

 // variables

String name;

   double price;

   System.out.print("Enter item's name: ");

   // read item's name

   name = scr.next();

   System.out.print("Enter item's price: ");

   // read item's price

   price= scr.nextDouble();

   // print name

   System.out.println("name of item is:"+name);

   // print price

   System.out.println("price of item is:"+price);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read name & price of item from user and assign it to variables "name" & "price" respectively with scanner object.Then print the name and price of item .

Output:

Enter item's name: Apple                                                                                                  

Enter item's price: 100                                                                                                    

name of item is:Apple                                                                                                      

price of item is:100.0

You might be interested in
Data with values that change continuously or smoothly over time is known as:
Alexeev081 [22]

Answer:

A.  \:  \boxed{analog  \: data}

5 0
3 years ago
Read 2 more answers
When’s The release date for Mobile legends project next phase 3 going To come
Gennadij [26K]

Answer: This Project will involve Hero Revamps, Hero Adjustments, Hero Remodels, and much more. Project NEXT is divided into 2 phases: the first phase was released on September 22, 2020, the second phase was released on June 15, 2021 and the third phase is to be released on "September 2021".

4 0
2 years ago
Nonprocedural access to a database
777dan777 [17]

Answer:

Option D: All of above.

is the correct answer.

Explanation:

  • Non-procedural access is the feature of the database.
  • This means that when a database is created in a database management system (DBMS) using data definition language (DDL), it will be accessed every time using a data manipulation language (DML). The standard DML is SQL. SQL stands for Sequential Query Language.
  • This feature of database ultimately improves the software productivity.
  • Most of the tools of Database Management systems (DBMSs) support the non-procedural access.
  • This feature permits a user to submit queries to a database without knowing how to retrieve data.

i hope it will help you!

4 0
2 years ago
With _____ transmission, both parties in a global network are connected at the same time, as in a phone call
butalik [34]

Answer:

<u>synchronous</u>

Explanation:

During synchronous transmission parties are exchanging messages in real time.

5 0
2 years ago
¿Cual es la ultima combinacion de celdas en Excel 365?
Furkat [3]
I need points but i don’t know so.
i really need points.
4 0
3 years ago
Other questions:
  • When malicious code is planted on your computer and alters your browser's ability to find web addresses, it is known as ________
    7·2 answers
  • 4. Who developed the first design technology program which had a
    12·1 answer
  • There are several factors that can substantially affect the consumer search process. Match the factor with an example of how the
    5·1 answer
  • Which of the following is true about ethical issues in graphic design?
    11·2 answers
  • Suppose you have four 500 MB hard drives plus one 2 GB flash drive. How many GB of capacity is this overall?
    12·1 answer
  • How does the system work for this:
    15·2 answers
  • Select the correct answer from each drop-down menu.
    7·1 answer
  • The question is inside the screenshot
    13·1 answer
  • What is the value of: 1 + int(3.5) / 2?<br> Select one:<br> a. 2<br> b. 2.25<br> C. 2.5<br> d. 3
    6·1 answer
  • Assume you are a manager in the security department of a high-tech corporation. You are mentoring Mary, an entry-level network t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!