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
ANEK [815]
3 years ago
15

What will you see on the next line? >>>int(12.8) ___

Computers and Technology
1 answer:
FrozenT [24]3 years ago
8 0

Answer:

12

Explanation:

When you use the int() function on a float, it only cuts off everything past the decimal. Literally all it does. Also, the int() function doesn't round the number. Thus, proving the answer is 12.

hope i helped :D

You might be interested in
Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, then the denominator. Make su
Anton [14]
<h2>Answer:</h2>

import java.util.Scanner;

public class FractionToDecimal {

   public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       

       System.out.println("Please enter the numerator");

       double numerator = input.nextDouble();

       System.out.println("Please enter the denominator");

       double denominator = input.nextDouble();

       

       if(denominator == 0){

           System.err.println("ERROR - Cannot divide by zero.");

       }

       else {

           System.out.println("The result is " + (numerator/denominator));

       }

       

   }

   

}

<h2>Explanation:</h2>

// import the Scanner class to allow for user input

import java.util.Scanner;

// 1. Declare a class

public class FractionToDecimal {

   // 2. Write the main method

   public static void main(String[] args) {

       

       // 3. Create an object of the Scanner class called <em>input</em>

       Scanner input = new Scanner(System.in);

       

       // 4. Prompt the user to supply the numerator

       System.out.println("Please enter the numerator");

       

       // 5. Declare and initialize a variable <em>numerator </em>to hold the numerator

       // supplied by the user.

       // The numerator is of type double since the program does not

       // specify any. With a double both integer and floating point numbers

       // will be supported.

       double numerator = input.nextDouble();

       

       // 6. Prompt the user to enter the denominator

       System.out.println("Please enter the denominator");

       // 7. Declare and initialize a variable <em>denominator </em>to hold the

       // denominator supplied by the user.

       // The denominator is also of type double since the program does not

       // specify any. With a double, both integer and floating point numbers

       // will be supported.

       double denominator = input.nextDouble();

       // 8. Check if the denominator is or is not zero.

       // if it is zero, display an error message        

       if(denominator == 0){

           System.err.println("ERROR - Cannot divide by zero.");

       }

       // if it is not zero, then print out the result of the division

       else {

           System.out.println("The result is " + (numerator/denominator));

       }

       

   }                       // end of main method

   

}                            // end of class declaration

Please Note:

The code above has been written in Java.

The explanation segment contains comments to explain every line of the code.

But a few things are still worth noting;

i. Dividing the numerator by the denominator will convert a fraction to decimal.

ii. The object of the Scanner class <em>input </em> is used to get the inputs (numerator and denominator) from the user. Since the inputs are going to be integers or doubles, the nextDouble() method of the the Scanner class is used.

iii. If the denominator is zero, an error message will be displayed. I have used the System.err.println() method for that rather than the regular System.out.println() method. The difference is that the former will print out the error text in red color.

iv. Notice also that the else statement in the code will perform the division and also print out the result of the division along side with some text.

<em>Hope this helps!</em>

3 0
3 years ago
Elan inserted shapes into a slide in his presentation. What is the quickest way to format those shapes?
Jlenok [28]

Answer:

c. Shape Styles gallery

Explanation: is correct. post protected

4 0
3 years ago
The area of a square is stored in a double variable named area. write an expression whose value is length of the diagonal of the
ale4655 [162]
You should specify what language you're using in these types of questions; here's an example in C++.

#include <iostream>
#include <math>

int main()
{
// example area
double area = 25;

// square root the area to find the length
// then apply basic pythagoras
double diagonal = sqrt(pow(sqrt(area), 2) + pow(sqrt(area), 2));

return 0;
}
8 0
3 years ago
Database accessibility DBA writes subschema to decide the accessibility of database.
Crank
The answer would be true
8 0
3 years ago
Read 2 more answers
Which of the following statements about take home pay is TRUE?
Licemer1 [7]
Banks and other lenders share the credit history of their borrowers with each other and are likely to know of any loan payments that you have missed. Does this answer your question? Plz tell me. If not I am sorry...
8 0
3 years ago
Other questions:
  • What Windows Server 2016 feature leverages the storage contained on a network of servers and adds a new level of fault tolerance
    14·1 answer
  • Why is the keyboard arranged in the QWERTY style?
    6·2 answers
  • Which of the following is the main consideration when choosing an appropriate outlet box?
    7·2 answers
  • Describe how mendeleev organized the elements into rows and columns in his periodic table.
    12·1 answer
  • If you need to define a connection request policy to apply to an 802.1x authenticating switch or a wireless access point, which
    12·1 answer
  • What is the simplest way to permanently get rid of an unwanted file?
    9·1 answer
  • ____ is the process of drawing a series of increasingly detailed DFDs, until all functional primitives are identified.
    7·1 answer
  • Good ways to increase sales on phone accesories?
    10·2 answers
  • Please help ASAP! will mark brianliest! 30 points!
    14·1 answer
  • Why is technology bad for you
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!