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
3 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]3 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
As a prospective student, what is the best reason to request an interview with your college application?
weqwewe [10]

Answer: The correct answer is A. I just answered this question myself!

6 0
3 years ago
Which component of the technological system is achieved when an automobiles airbag inflates
Aleonysh [2.5K]
Process is the component achieved.

8 0
3 years ago
The practice of spamming has been growing because telephone solicitation is no longer legal. it is good advertising practice and
Ratling [72]

The given question is not a true or false question. It is a Multiple Choice question. By googling it you can find the correct question here https://www.coursehero.com/file/poq0d6/The-practice-of-spamming-has-been-growing-because-a-it-is-unregulated-b-it-is/

The practice of spamming has been growing because it is so inexpensive and can reach so many people.

Option: D.

<u>Explanation:</u>

Spamming is sending unsolicited messages which is mostly used to prank initially. Spamming has increased these days in various forms and platforms, Mainly in the marketing field, in the form of email, direct messages, etc, to advertise products.  

There are various tools that can send a message along with the sender's website or product links to multiple recipients. These tools are widely used in the spamming process. These tools require only a small amount of money either to buy a membership or to send the messages.

Moreover, most of the people around the world using smartphones have mail ids and smartphones have access to the Internet. Either 2 out of 5 people will get attracted to the message and visit the respective sender's site. That, in turn, builds traffic to the sender's site or makes the recipients buy the sender's product or services.

7 0
3 years ago
in which of the following scenarios would a router send a resign message? answer if a preempted active router fails, the standby
hodyreva [135]

A scenario in which a router would send a resign message include the following: A. if a preempted active router fails, the standby router becomes the active router. If the preempted active router regains service, it sends a coup message. The current active router sends the resign message after receiving the coup message.

<h3>What is a router?</h3>

In Computer technology, a router can be defined as a network device (node) that is designed and developed to connect two (2) different computer networks together, in order to allow them communicate by forwarding and receiving encapsulated data (Ethernet frame) and packets.

<h3>What is a resign message?</h3>

In Computer networking, a resign message can be defined as a set of information that is typically sent by an active Hot Standby Router Protocol (HSRP) network device when it is preparing to go offline or whenever it wants to relinquish the active role due to some other reasons.

This ultimately implies that, a resign message instructs or informs a standby router to get ready to become the active router and take over the active role.

Read more on router here: brainly.com/question/24812743

#SPJ1

8 0
1 year ago
Solid state storage stores data in erasable, rewritable circuitry, rather than on spinning disks, tape, or optical media.
Gwar [14]
It’s true because it’s also called “flash memory”
7 0
4 years ago
Other questions:
  • What does pdf stand for in computer terms?
    15·1 answer
  • What is a pin? part of a connector a port part of a cable a NIC
    14·1 answer
  • The LPN/LVN cares for an older client admitted to the hospital for treatment of a fractured femur. The LPN/LVN notes the client
    10·2 answers
  • A printer would be considered _____. Select 2 options. 1 an input device 2 an output device 3 hardware 4 software 5 storage
    10·1 answer
  • When operating a forklift, what should you do to ensure a clear view and proper balance when traveling with a load?
    6·2 answers
  • Explain the relevancy of computers in today's global society​
    11·1 answer
  • No down payment, 18 percent / year, payment of $50/month, payment goes first to interest, balance to principal. Write a program
    9·1 answer
  • HAIIIIIII ANYONE FEELING JOLLY OR SAD
    9·2 answers
  • Helppp plzz ajjsndndbsskdjf​
    11·1 answer
  • 7. Suppose that a RISC machine uses 5 register windows. a. How deep can the procedure calls go before registers must be saved in
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!