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]
4 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]4 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 a program that prints to the screen all the ASCII characters from 33 to 126. 33! 34''
leonid [27]

Answer:

#include <iostream>

using namespace std;

int main() {

   for(int i=33;i<=126;i++)//Using loop to print ASCII characters.

   {

         cout<<i<<char(i<<" ";//statement to print integer and it's ASCII characters with values.

   }

return 0;

}

Explanation:

Put a closing parenthesis i char(i after doing that code will run .Since the answer was not getting posted hence i have to come to this resort.

I have used for loop for values 33 to 126 and for printing the ascii characters I have used typecasting converting the integer to corresponding char forcefully.

6 0
3 years ago
Anna is making a presentation on the solar system. She wants to emphasize the planet names as they appear one by one on the pres
Svetach [21]

slide transition effect.

5 0
3 years ago
Use the provided MS-Excel template to note entries for each .pcap file in Wireshark that are of interest, as well as your assess
zhenek [66]

Answer:You should note entries for each PCAP file in Wireshark that are of interest as from ENCM 369 at ... file in Wireshark that are of interest, as well as your assessment of potential vulnerabilities. Such vulnerabilities might be due to plaintext data exchange between two machines, which might be exploitable by session hijacking, ...

Explanation:

4 0
3 years ago
Provide an example of a question that could NOT be answered with a binary message. Explain why this is the case, making referenc
solong [7]
This is a question with a much simpler answer given its open ended ness - a representation merely means, given binary data, we can determine what 'thing' that binary data corresponds to.

<span>That makes the question unanswerable, because words can all be represented in binary data, and the question cannot be answered without those. Thus, all answers we can convey have a binary representation of some form (that form being the translation of the words we used to communicate the answer into binary data).</span>
7 0
4 years ago
What is renewable energy
faust18 [17]

Answer:

Energy that can be used over again

Explanation:

Examples include biofuel,hydroelectric power,and wind.

8 0
4 years ago
Read 2 more answers
Other questions:
  • Write the pseudocode for linear search, which scans through the sequence, looking for ν. Using a loop invariant, prove that your
    14·1 answer
  • The phrase ____ refers to an organization of components that define and regulate the collection, storage, management and use of
    10·1 answer
  • Which of the following sets of data would be represented best in a histogram
    10·1 answer
  • Value or power of a network grows exponentially as a function of the number of network members. this is known as ________ law.
    8·1 answer
  • The four general functions of any application program are: data storage, data access logic, application logic and presentation l
    11·1 answer
  • What's ur favorite color and your dream car
    8·2 answers
  • Jim lost his job due to the replacement of robots in a manufacturing factory. As an ethical practice, what should the manufactur
    13·1 answer
  • Answer to this problem
    11·1 answer
  • Very few games have any sort of narrative, not even a simple one that involves setting the mood through color, sound, environmen
    12·1 answer
  • a domain name is assigned to you when you submit your website to a search engine. group of answer choices true false
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!