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
Ne4ueva [31]
3 years ago
11

Follow the directions below to submit Assignment 2:

Computers and Technology
1 answer:
Komok [63]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java and performs every action requested in the question. Instead of converting back and forth it saves the decimal/double value in one variable and the integer value in another variable so both can easily be accessed and printed.

import java.util.Scanner;

public class DecimalFloor {

   public static void main(String args[]) {

       //Ask for input and place into variable decimalValue

       Scanner in = new Scanner(System.in);

       System.out.println("Input decimal value:");

       double decimalValue = in.nextDouble();

       //Rounding down decimalValue to integer

       int integerValue = (int) Math.floor(decimalValue);

       //Print both integerValue and decimalValue

       System.out.println(integerValue);

       System.out.println(decimalValue);

   }

}

You might be interested in
If you create and invoke a recursive function without accounting for a base case, what can go wrong?
oksian1 [2.3K]

Every recursive function should have an exit criterion (=handling the base case) to exit the recursion.

Without it, it wil recurse forever, until system resources run out (typically the call stack will overflow and your program will crash).

6 0
3 years ago
Outline various methods of collecting data
Sati [7]

Answer:

interviews

observation

questionering

3 0
2 years ago
How dependent are we on technology? ​
rusak2 [61]

very independent  : ) we use it for everything

3 0
4 years ago
Read 2 more answers
Emily has to create an audio-visual presentation on animated movies. Which input device will she be LEAST likely to use while cr
Slav-nsk [51]
A joystick is less likely to be used while creating this presentation. Obviously, If your intention is to create an audio-visual presentation on animated movies, a computer should be used. With a computer, comes a keyboard, a mouse and a microphone as well.

A Joystick is used to control video games and play simulator games. Therefore, I do not see the need of using a joystick in this situation.

6 0
3 years ago
2.5 code practice
Mamont248 [21]

Answer:

try declarimg smt before the int eg answer=int(input("your answer"))

7 0
3 years ago
Other questions:
  • You’re responsible for an always-on VPN connection for your company and have been told that it must utilize the most secure mode
    12·1 answer
  • Which business document is usually written in block style with the body tedt aligned along its left margin?
    9·1 answer
  • Write the C++ if statement that compares the contents of the quanity variable to the number 10. If the quantity variable contain
    12·1 answer
  • While these two approaches have similarities in terms of the topics they address, ________ will cover broad IT management topics
    7·1 answer
  • What is the systems development life cycle (SDLC)? Group of answer choices Involves establishing a high-level plan of the intend
    8·1 answer
  • How many passes will it take to find the five in this list?
    14·2 answers
  • 8. Cloud Storage is
    5·2 answers
  • For risk monitoring, what are some techniques or tools you can implement in each of the seven domains of a typical IT infrastruc
    7·1 answer
  • What is a worm?
    11·1 answer
  • #Question 4: #Use a variable to represent the name of a food. You are then going to print this variable four times. Before you d
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!