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
I need help..
labwork [276]

Answer:

which app are u using u should use Android studio or if u are using mac book use xcode

5 0
3 years ago
Consider the latency model for static congestion windows. If the server receives an acknowledgement for the first data segment i
Angelina_Jolie [31]

Answer:

Latency of an object O is shown below.

Explanation:

W segment and stalled state transmits nothing and waits for acknowledgement. The latency is 2 R TT + the time required for server that are using to transmit the object + the amount of time when server is in stalled state. Let K be the number of window that is K= O/WS .The serveries stalled state where K-1 is period of ime with period lasting RTT-(W-1)S/R

latency = 2RTT +O/R +(K-1)[S/R +RTT - WS/R]

After combining the two case

latency = 2 RTT + O/R + (K-1)[S/R +RTT - WS/R]

where [x] means maximum of (x.0). This is the complete ananlysis of the static windows.

server time for transmit the object is (K-1)[S/R +RTT - WS/R]

7 0
3 years ago
A(n) _________ produces dynamic reports, supports alerts/rss functionality, and supports user subscriptions.
lesantik [10]

A(n) BI server produces dynamic reports, supports alerts/RSS functionality, and supports user subscriptions.

<h3>What exactly is BI server?</h3>

An on-premises report server with a web gateway, Power BI Report Server allows you to see and manage reports and KPIs. The tools for generating Power BI reports, paginated reports, mobile reports, and KPIs are also included. A business intelligence server created by Oracle is called Oracle Business Intelligence Enterprise Edition. It has sophisticated business intelligence capabilities that are based on a single architecture. The server offers centralized data access to all corporate entity-related business information.

There are five stages to query compilation in BI server:

  • Parsing
  • Create Logical Requests
  • Navigation
  • Code Generation Rewrite

To learn more about BI server , refer to:

brainly.com/question/7601044

#SPJ4

7 0
2 years ago
A recursive method may call other methods, including calling itself. Creating a recursive method can be accomplished in two step
liq [111]

Answer:

Explanation:

The following code is written in Java. It creates the raiseToPower method that takes in two int parameters. It then uses recursion to calculate the value of the first parameter raised to the power of the second parameter. Three test cases have been provided in the main method of the program and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println("Base 5, Exponent 3: " + raiseToPower(5,3));

       System.out.println("Base 2, Exponent 7: " + raiseToPower(2,7));

       System.out.println("Base 5, Exponent 9: " + raiseToPower(5,9));

   }

   public static int raiseToPower(int base, int exponent) {

       if (exponent == 0) {

           return 1;

       } else if (exponent == 1) {

           return base;

       } else {

           return (base * raiseToPower(base, exponent-1));

       }

   }

 

}

4 0
3 years ago
Which of the following is not the name of an air mass?
Rus_ich [418]
<span>All the terms are adjectives, not names of air masses. But among the adjectives, tepid seems to be the odd one out.</span>
5 0
3 years ago
Other questions:
  • How can you find Web pages that contain news published during the past week?
    8·1 answer
  • Word Online works exact same as the downloaded Office 2016 version.<br>True<br>False​
    7·1 answer
  • You create a new document and save it to a hard drive on a file server on your company's network. then you employ an encryption
    9·1 answer
  • Which view is used to allow a publisher to view facing pages of a publication at the same time? Normal Master Page Two-Page Spre
    5·1 answer
  • There is an application which inputs hundred numbers from the user, if user enters a positive number it increments valid numbers
    6·1 answer
  • A function ________ contains the statements that make up the function.
    5·1 answer
  • In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in
    9·1 answer
  • Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use loop). If at least once out of
    14·1 answer
  • 1. Write a 400-500 word research report about Burke High School.
    6·1 answer
  • Please answer this now I need please.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!