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
damaskus [11]
3 years ago
4

Write a program that reads a floating point value (double) and prints the closest whole number less than and greater than that v

alue. For example , if the number is 28.466, the program would print 28 and 29
Computers and Technology
1 answer:
Shkiper50 [21]3 years ago
5 0

Answer:

  1. public class Main {
  2.    public static void main(String[] args)
  3.    {
  4.        Scanner input = new Scanner(System.in);
  5.        System.out.print("Enter a floating point value: ");
  6.        double value = input.nextDouble();
  7.        System.out.println(Math.floor(value));
  8.        System.out.println(Math.ceil(value));
  9.    }
  10. }

Explanation:

Firstly create a Scanner object (Line 4).

Next, prompt the user to enter a floating point value and assign it to variable value (Line 6 -7).

Use the Java Math floor and ceil method to get the number less than and greater then the value, respectively, and print them out to the console (Line 9 - 10).

You might be interested in
Indicate the order that the three files will be processed <br><br> Please answer
defon
The answer is 10 because I looked it up
6 0
4 years ago
What is the main storage device where the computer stores data?
Fudgin [204]
D. RAM
<span>Primary storage typically refers to random access memory (RAM), while secondary storage refers to the computer's internal hard drive. RAM, commonly called "memory," is considered primary storage, since it stores data that is directly accessible by the computer's CPU.</span>
8 0
3 years ago
Warning or pop-up that convinces a user that his or her computer or mobile device is infected with a virus or other problem that
o-na [289]
Idk... just dont trust those pop-ups unless your device is acting weird.
3 0
3 years ago
What does the CMYK tab let you do
Paha777 [63]

<span>CMYK means cyan, magenta, yellow, and key (black). They are the four color model used in color printing or printing color images. It lets you subtract the colors on the image. CMYK partially or fully masks colors on a lighter view. </span>

3 0
3 years ago
Read 2 more answers
Which situations are most likey to use Telehealth
Scilla [17]

Answer:

Emergency situations that make it difficult to go to a clinic will likely require Telehealth. Examples include cases of

1. heart attack

2. breathing difficulties

3. health challenges that begin in the night

4. onset of child labor

5. a pandemic situation where hospitals are filled up

6. sickness among aged people in rural communities with no clinic, etc.

Explanation:

Summarily, the World Health Organization (WHO) defines Telehealth as the 'incorporation of Information Communication Technology in the delivery of health care services in situations where patients and health care providers are separated by distance'. Emergency health situations that make it difficult to quickly access medical help can benefit from Telehealth.

In the cases of a pandemic such as the one experienced in 2020, where hospitals were filled to the brim, telehealth proved to be a useful form of health care delivery.

4 0
3 years ago
Other questions:
  • What was Leonardo da Vinci an expert in
    11·1 answer
  • If a = 3 and b = a+3 find value of b.
    14·2 answers
  • Data ____________ refers to any technique that recodes the data in a file so that it contains fewer bits.​
    10·1 answer
  • Explain what might happen if two stations are accidentally assigned the same hardware address?
    15·1 answer
  • If you're able to understand directions more easily when you hear them instead of reading them you are most likely
    12·1 answer
  • Data are sent through a network on bundles called ____packets____. select one:
    14·2 answers
  • We discussed making incremental dumps in some detail in the text. In Windows it is easy to tell when to dump a file because ever
    5·1 answer
  • Who predicted nearly 60 years ago that the rise of electronic media would create a "global village," thereby reducing the barrie
    12·1 answer
  • An option already selected by windows is called____ ( default option/ default selection)​.
    6·1 answer
  • Why do software managers have to be generalists with a range of skills, rather than simply technical specialists?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!