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
What are the 3 biggest advancements in computers?
Georgia [21]

Answer:

abacus . Mesopotamia or China, possibly several thousand years BCE. ...

binary math . Pingala, India, 3rd century BCE. ...

punched card . Basile Bouchon, France, 1725. ...

Explanation:

:)

6 0
2 years ago
A website sells illegal and counterfeited materials. According to which law can the US Attorney General seek a court order to re
RideAnS [48]
The answer is SOPA or Stop Online Piracy Act. This bill was introduced by Lamar Smith a representative in US. Lamar passed this bill in the United states to enforce the law to combat online copyright, online trafficking, and other cyber crimes. There are many provisions on this bill including the court orders to request ISP (Internet Service Provided) to block access to that website.
3 0
3 years ago
Read 2 more answers
Absolute time would be most similar to :
mr Goodwill [35]
The absolute time would be most similar to a fact. It was theorised and in fact, approved by scientists as a scientific law which governs, according to Wikipedia, as a "<span>true and mathematical </span>time<span>, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common </span><span>time."</span>
6 0
3 years ago
Frank discovers a keylogger hidden on the laptop of his company’s chief executive officer. What information security principle i
pochemuha
Frank discovers a keylogger hidden on the laptop of his company’s chief executive officer. What information security principle is the keylogger most likely designed to disrupt?
3 0
3 years ago
I NEED THIS ASAP!!
koban [17]

Answer:

Explanation:if a open world game / rpg had humanoids that had lore behind them then the player will feel guilt about killing them from allah

4 0
3 years ago
Read 2 more answers
Other questions:
  • How fast can the winds blow in a tornado?
    8·2 answers
  • _________ are represented using diamonds linked withparticipant ETs
    6·1 answer
  • If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
    6·2 answers
  • Which of the following technologies is the best choice to convey urgent and highly sensitive information? telephone fax letter e
    14·1 answer
  • At the beginning of a chapter in a book, the first letter often appears larger than the other text on the page. This
    15·1 answer
  • The terms Apps and Applications can be used interchangeably about software installed
    8·1 answer
  • What can a user modify on a business card using the Edit Business Card dialog box? Check all that apply.
    6·1 answer
  • MR. Tom asked her students could they plant a flower and bring it to class. Sarah brought his flower and said it was a rose. Jam
    6·1 answer
  • How to assign some object key values to other name react const.
    7·1 answer
  • Hey! I was recommended a site “9anime” the other day. All’s been going well but I accidentally taped on a new dub settingZ somet
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!