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
ElenaW [278]
3 years ago
5

2.4 Code Practice: Question 2

Computers and Technology
1 answer:
klasskru [66]3 years ago
8 0

num = float(input("Enter a number: "))

num1 = int(num)

print(num - num1)

I hope this helps!

You might be interested in
The repair order is a legal document because?
svp [43]
D. It’s signed by the customer
4 0
3 years ago
Read 2 more answers
Wat is a computer risk<br>​
klemol [59]

Answer:

Virus, cyber theft

Explanation:

A computer risk is something that can potentially harm your data on your computer or harm you through a computer by using theft tactics from real people to autonomous viruses making it to your computer and slowing your computer. With cybrrtheft thieves can get personal info through accounts to pictures and payment information.

4 0
4 years ago
Read 2 more answers
JAVA Write a program that first asks the user to type a letter grade and then translates the letter grade into a number grade. L
ale4655 [162]

Answer:

Follows are the code to this question:

import java.util.*;//import package for user input

class GradePrinter//defining class GradePrinter

{

double numericValue = 0;//defining double variable

String grade = "";//defining String variable

GradePrinter()//defining default constructor  

{

Scanner xb = new Scanner(System. in );//defining Scanner  class object

System.out.print("Enter Grade: ");//print message

grade = xb.nextLine();//input string value  

}

double getNumericGrade()//defining double method getNumericGrade

{

if (grade.equals("A+") || grade.equals("A"))//defining if block that check input is A+ or A

{

numericValue = 4.0;//using  numericValue variable that hold float value 4.0

}

else if (grade.equals("A-"))//defining else if that check grade equals to A-

{

numericValue = 3.7;//using  numericValue variable that hold float value 3.7

}

else if (grade.equals("B+"))//defining else if that check grade equals to B-

{

numericValue = 3.3;//using  numericValue variable that hold float value 3.3

}

else if (grade.equals("B"))//defining else if that check grade equals to B

{

numericValue = 3.0;//using  numericValue variable that hold float value 3.0

}

else if (grade.equals("B-"))//defining else if that check grade equals to B-  

{

numericValue = 2.7;//using  numericValue variable that hold float value 2.7

}

else if (grade.equals("C+"))//defining else if that check grade equals to C+  

{

numericValue = 2.3; //using  numericValue variable that hold float value 2.3

}

else if (grade.equals("C")) //defining else if that check grade equals to C  

{

numericValue = 2.0; //using numericValue variable that hold float value 2.0

}

else if (grade.equals("C-")) //defining else if that check grade equals to C-  

{

numericValue = 1.7;//using umericValue variable that hold float value 1.7

}

else if (grade.equals("D+"))//defining else if that check grade equals to D+  

{

numericValue = 1.3;//using umericValue variable that hold float value 1.3

}

else if (grade.equals("D"))//defining else if that check grade equals to D

{

numericValue = 1.0;//using umericValue variable that hold float value 1.0

}

else if (grade.equals("F"))//defining else if that check grade equals to F

{

numericValue = 0;//using umericValue variable that hold value 0

}

else//defining else block

{

System.out.println("Letter not in grading system");//print message

}

return numericValue;//return numericValue

}

}

class Main//defining a class main

{

public static void main(String[] args)//defining main method

{

GradePrinter ob = new GradePrinter();// creating class GradePrinter object

double numericGrade = ob.getNumericGrade();//defining double variable numericGrade that holds method Value

System.out.println("Numeric Value: "+numericGrade); //print Value numericgrade.

}

}

Output:

Enter Grade: B

Numeric Value: 3.0

Explanation:

In the above-given code, a class "GradePrinter" is defined inside the class a string, and double variable "grade and numericValue" is defined, in which the grade variable is used for input string value from the user end.

After input, the sting value a method getNumericGrade is defined, which uses multiple conditional statements is used, which holds double value in the which is defined in the question.

In the main class, the "GradePrinter" object is created and defines a double variable "numericGrade", that calling method and store its value, and also use print method to print its value.

4 0
3 years ago
What kind of error is there in this line of code: pritn(“Hello, world!”)?
ivolga24 [154]

Answer:

3.algorithm error

4 0
2 years ago
Read 2 more answers
Data refer to
Yanka [14]
D. Large sets of information that can be analyzed for patterns and trends
3 0
3 years ago
Other questions:
  • Pam wants to include a video from a website in an upcoming presentation. However, she knows she will not have access to an inter
    15·2 answers
  • Design an application for Bob's E-Z Loans. The application accepts a client's loan amount and monthly payment amount. Output the
    8·1 answer
  • Which of the following is typically not found in web page-authoring software
    9·1 answer
  • You are capturing packets with a network sniffer and notice a number of packets that are flagged by the sniffer and described as
    5·1 answer
  • Which technology was used in fourth generation of computer​
    13·2 answers
  • . what action does the following a default operator perform? int a, b, c; a = b + c;
    14·1 answer
  • At currents as low as
    5·1 answer
  • Look out for users with this photo.
    15·2 answers
  • How do you declare variables in c program
    14·1 answer
  • Recently, from around june through september 2022, a social engineering campaign, attributed to a nation-state group, has been u
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!