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
Which of the following statements is not true about proper tire care? a.If you see a wear bar across the width of the tread whil
lara31 [8.8K]
I'd say <span>c.Tire tread depth can only be checked by a properly-trained tire expert.
</span>

This option is not true. Anyone with a tread depth gauge can check tire tread depth. A coin in your pocket can also work. You can insert the coin with the head showing. The head should always be pointing towards the tire.



5 0
3 years ago
Read 2 more answers
The basics of color theory assume what central tenets
fomenos
Color has important psychological and visual effects on the audience
5 0
3 years ago
Question 1 of 10
Basile [38]

Answer:

A, C, and D I believe.

Explanation:

I'm in the same class as you lol

6 0
2 years ago
Read the following code:
sergejj [24]

Answer:

0

1

2

3

4

5

Explanation:

The loop first prints when n is still 0, so 0 is in the list.

The loop still executes when n = 5, so 5 must also be in the list.

6 0
3 years ago
Select the correct answer. Steve wants to change shooting and exposure settings while on his photo shoot. Which camera part will
wel

B. eyepiece

will help you to do that

5 0
3 years ago
Read 2 more answers
Other questions:
  • What's the best option if you can't show your PowerPoint presentation at all?
    9·2 answers
  • Customer A with a Bronze service level package calls in a Critical System Failure at 9:00 AM. Customer B with a Silver service l
    15·1 answer
  • Use the drop-down menus to complete statements about the quick steps function
    12·1 answer
  • Right click on a spot of your desktop that is not covered by an icon, window, or menu. when the menu comes up, play with the opt
    7·1 answer
  • Select the term used to describe the process, within the context of Active Directory, that allows a person with higher security
    5·1 answer
  • Explain briefly the purpose of the Computer Management Console in Microsoft Windows.
    12·1 answer
  • Peyton is taking a part-time job to earn some extra money. Every week the manager will provide a list of tasks and the number of
    11·1 answer
  • PLS ANSWER. MARKING CORRECT ANSWER AS BRAINLIEST
    11·1 answer
  • (Correct Answer Recieves Brainliest)
    8·2 answers
  • You are building a game that needs to do the following:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!