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
_______ allows you to specify how a photo is positioned in the text of your document.
Lisa [10]
<span>The answer your looking for is Wrap text!!</span>
5 0
3 years ago
ANs and WANs can be set up in several different shapes, also known as peripherals.
nika2105 [10]

Answer:

The Answer Is False Because They Aren't Called Peripherals

8 0
2 years ago
Enterprise application integration (eai) software enables users to model the business processes and interactions that should occ
Tanya [424]
Sorry i need 50 points

6 0
3 years ago
Declare an array named tax rates of five elements of type double and initialize the elements (starting with the first) to the va
inysia [295]

Answer:

"double tax_rates[5]= {0.10, 0.15, 0.21, 0.28, 0.31};" is the correct answer for the above question.

Explanation:

  • An array is a user-defined data type that is used to define the multiple variables of a single type in a continuous storage location.
  • In the C-programming language, When the user wants to declare an array he needs to define with the help of data type and size of the array with the help of the following syntax-- "Data_type variable_name [size_of_the_array];".
  • When the user wants to initialize the static value in the array then he can do that by the help of following syntax: "Data_type variable_name [size_of_the_array]={first_value,second_value,....,last_value};
  • The above question asked to defined the array of tax_rates name of type double with the above-defined value then he can do that with the help of above-defined syntax (which is defined in the answer part).
4 0
3 years ago
All of the following are methods of communication
NNADVOKAT [17]

Answer:

Extremal hard drive is not form of communication.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Browsing the web is one of the most common activities performed by individuals who use computers.
    12·1 answer
  • All users on the network have antivirus software; however, several users report that they have what an administrator described a
    10·1 answer
  • What term best describes the way the dns name space is organized?
    9·1 answer
  • A user calls the help line and ask for some help installing a new keyboard. He isn't sure how to plug the keyboard into the comp
    15·1 answer
  • Mobile computing has two major characteristics that differentiate it from other forms of computing. What are these two character
    8·1 answer
  • You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
    8·1 answer
  • Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grade
    10·1 answer
  • Why is yo utu be down?<br> (You restrict talking about yo utu be, really)
    11·2 answers
  • What were the social, political, cultural, or economic context in which the was invention made?
    14·1 answer
  • • Do you think documentaries are best delivered in media such as films or documentary?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!