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
algol [13]
3 years ago
5

Scientists measure an object’s mass in kilograms and its weight in newtons. If you knowthe amount of mass of an object in kilogr

ams, you can calculate its weight in newtons withthe following formula: weight 5 mass 3 9.8
Write a program that asks the user to enter an object’s mass, and then calculates its weight.If the object weighs more than 500 newtons, display a message indicating that it is tooheavy. If the object weighs less than 100 newtons, display a message indicating that it istoo light
Computers and Technology
1 answer:
Phoenix [80]3 years ago
7 0

Answer:

public class WeightCalculator {

   

   private static DecimalFormat df2 = new DecimalFormat("#.##");

   

   public static void main(String args[]){

       //create scanner to receive user input

       Scanner in = new Scanner(System.in);

       //alert user to input mass

       System.out. println("Enter the Mass in Kg");

       //collect the input as a string

       String s = in. nextLine();

       //convert string to double and multiply by 9.8

       Double weight = Double.valueOf(s)* 9.8;

       

       //Print out answer formatted to 2 decimal place

       System.out. println("The Weight is " + df2.format(weight) + "N");

       

       //conditional statement to check if weight is less than 100

       if (weight < 100){

           System.out. println("Oops, it is too light");

       }

       //conditional statement to check if weight is more than 500

       if (weight > 500){

           System.out. println("Oops, it is too heavy");

       }            

   }

}

You might be interested in
What is the output of:<br><br> print (8 % 4)
elena-s [515]

Answer:

0

Explanation:

The statement, print(8 % 4) will produce the output 0 ;

The print statement is an inbuilt function which is used to output a typed string or display result of a Mathematical calculation and so on.

The expression in the print statement gives 0;

8%4 means, the remainder when 8!is divided by 4 ; 8 /4 gives 2 without a remainder. Meaning that :

8%4 = 0

Hence, print(8 % 4) = 0

5 0
3 years ago
Jack has a fear of getting up in front of a group of people and giving a presentation. When he gave his last presentation, he ta
dezoksy [38]

Answer:

Jack has to be very calm and try his best to present himself in an outward way and think about the fact that by the end of the night no one will remember that he messed up, I feel like he'll be okay :)

7 0
2 years ago
Read 2 more answers
What is one way to improve the upward flow of information?
kobusy [5.1K]

Answer:

b.Encourage managers to have regular meetings with staff.

Explanation:

Upward flow of information is when the information is flown from the lower level of hierarchy to upper level of hierarchy in an organization. for example:- the flow of information from employees to the managers.

The upward flow of information can be improved by encouraging the managers to have meeting with the staff at regular interval of time.

4 0
3 years ago
While you are working on your computer, it shuts down unexpectedly, and you detect a burning smell. When you remove the case cov
kumpel [21]

Answer:

fire

Explanation:

hydrant

6 0
2 years ago
U
beks73 [17]
8wmX si2 jkkajmid di e2 2i2
3 0
3 years ago
Other questions:
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • How do you change the slide layout?
    6·2 answers
  • Which phrase is a comparison operator for inserting a not equal to argument in an IF, COUNTIF or SUMIF function? &lt;= &lt;&gt;
    9·1 answer
  • "When you can control devices and appliances by apps installed on your smartphone or tablet, you are said to have"
    6·1 answer
  • Microsoft’s SharePoint server product dramatically altered the content and records management (RM) markets. Crocker (2015), edit
    6·1 answer
  • What is the name of the newer communication protocol that is supported by Window 10's version of TCP/IP?
    11·1 answer
  • Match the ernerging technologies to their descriptions.
    14·1 answer
  • What do you think Amazon should fix?
    13·2 answers
  • Large and fast disks should be used for as doing so will ensure work is done as quickly as possible?
    8·1 answer
  • Task 2
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!