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
Eddi Din [679]
3 years ago
5

Write a program that asks the user to enter an object’s mass, then calls a // function to return the object's weigh in newtown.

If the object weighs // more than 500 newtons, the function also displays a message indicating that // it is too heavy. If the object weighs less than 100 newtons, the function // also displays a message indicating that it is too light.
Computers and Technology
1 answer:
lisov135 [29]3 years ago
4 0

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter the mass");

       double mass = in.nextDouble();

       double weight = calWeight(mass);

       System.out.println("The weigth is "+weight);

   }

   static double calWeight(double mass){

       double weight = mass*9.80665; // assume a = accelation due to gravity = 9.80665N

       if(weight>500){

           System.out.println("Too Heavy");

       }

       else if(weight<100){

           System.out.println("Too Light");

       }

       return weight;

   }

}

Explanation:

  • Using Java programming language
  • The main method is created to request and store a variable, mass in kilogram. The main method call calWeight() and passes the value for mass
  • A method calWeight() is created that calculates the weight in newtons (mass * 9.8).
  • The method checks if the weight is greater than 500 (prints too heavy) if less than 100(prints to light)
  • Returns the weight  

You might be interested in
Need to know? Anyone feel like helping me not fail
8_murik_8 [283]
I’m not sure but i think it might be design
4 0
3 years ago
Which best describes Sayid’s error?
Sonja [21]
<span>Change "move only through matter" to "move through space and matter."</span>
8 0
3 years ago
What are the six command groups in powerpoint
DiKsa [7]

Answer:

Clipboard, Slides, Font, Paragraph, Drawing, and Editing

3 0
3 years ago
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
2 years ago
How to access Tor Browser on Android which is not rooted?
Mekhanik [1.2K]
An app you can look up on Google chrome called Aptoide has it on there for you to install.
7 0
3 years ago
Other questions:
  • Need help with this please and thanks
    7·1 answer
  • Many of the special staff teams require leadership training, which is offered to staff with more than 1 year of service at Camp
    15·1 answer
  • What is cpu????????????????????????????
    12·2 answers
  • ________ is a process in which computer software that uses statistical analysis, database technology, and artificial intelligenc
    13·1 answer
  • This is a tableware use to serve the main dish
    11·1 answer
  • You want a cable that could be used as a bus segment for your office network. The cable should also be able to support up to 100
    5·1 answer
  • The recipient list cannot be edited.<br> Group of answer choices<br><br> True<br><br> False
    5·1 answer
  • What does it mean to clear a setting in a dialog box?
    14·1 answer
  • Many people are scared of the rise of Artificial Intelligence (AI). Do you think computers that are controlled by an AI are some
    11·2 answers
  • a data analyst is working with a spreadsheet that has very long text strings. rather than counting the characters themselves to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!