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
Write the function evens which takes in a queue by reference and changes it to only contain the even elements. That is, if the q
kvv77 [185]

Answer:

Explanation:

The following code is written in Java it goes through the queue that was passed as an argument, loops through it and removes all the odd numbers, leaving only the even numbers in the queue. It does not add any more data structures and finally returns the modified queue when its done.

  public static Queue<Integer> evens(Queue<Integer> queue) {

       int size = queue.size();

       for(int x = 1; x < size+1; x++) {

           if ((queue.peek() % 2) == 0) {

               queue.add(queue.peek());

               queue.remove();

           } else queue.remove();

       }

       return queue;

   }

3 0
2 years ago
Prove each statement using a proof by exhaustion. For every integer n such that 0 lessthanorequalto n &lt; 3, (n + 1)^2 &gt; n^3
yawa3891 [41]

Answer:

See attachment below

Explanation:

5 0
2 years ago
I need the full code for 6.1.3 code hs circles and squares please answer please help
Sloan [31]

In this exercise we have to use the knowledge in computational language in python  to write a code with circles and squares.

<h3>how to draw geometric figures in python?</h3>

<em>inputs = 100</em>

<em>radius</em>

<em>    draw_circle(radius);</em>

<em>    pendown()</em>

<em>    begin_fill()</em>

<em>    circle(radius)</em>

<em>    end_fill()</em>

<em>    penup()</em>

<em>left(90)</em>

<em>forward(radius*2)</em>

<em>right(90)  </em>

<em>penup()</em>

<em>setposition(0,-200)</em>

<em>color("gray")</em>

<em>bottom_radius = int(input("What should the radius of the bottom circle be?: "))</em>

<em>draw_circle(bottom_radius)</em>

<em>draw_circle(bottom_radius)</em>

See more about python at brainly.com/question/18502436

7 0
2 years ago
Using e-mail has decreased the number of hand-written letters that people send to their friends and relatives. this is a ____ fu
k0ka [10]
Hello <span>Alexkalhor5415

</span>Answer: Using e-mail has made it easy, fast, and inexpensive for family members who live in different parts of the united states to keep in touch. this is a positive  function of e-mail.
Hope this helps-Chris
6 0
3 years ago
Matthew is running a study on the effects of room temperature on performance on an algebra test. One group takes the test in a r
qaws [65]

Answer:

Independent variable is temperature

Explanation:

An equation has this form:    Y= f(x), where Y is dependent variable andX is independent variable.

In this case Y ( Dependent variable) is Perfomance in test, an it depends on x(Independent variable) wich is temperature.

7 0
3 years ago
Other questions:
  • Prompt the user for a string that contains two strings separated by a comma. (1 pt)Examples of strings that can be accepted:Jill
    5·1 answer
  • A Trojan horse is a program that copies itself repeatedly using up resources and potentially shutting down a network. true or fa
    11·1 answer
  • You can access various sites on the WWW by using hyperlinks or by
    14·1 answer
  • How do you do this question
    11·1 answer
  • Write an SQL statement to list the Name of employees who have worked on a property in New York .
    7·1 answer
  • Ali is in the hospital about to undergo a brain-imaging process that involves taking many x-rays from different angles aided by
    9·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • Robert works in a call center and receives a call from Kathy. Kathy says she can no longer access the online reporting applicati
    13·1 answer
  • Choose and explain, step by step, one method of backing up student files either manually or using a cloud service.
    10·1 answer
  • Where would you go to access frequently used icons?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!