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]
3 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]3 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
ProcessName2
RoseWind [281]

Explanation:

This is easily solvable with a for loop. Something like:

(I assume c++)

#include <iostream>

#include <string>

int main() {

take_input: //tag

std::string input;

cin >> input; //take the input

int spaceCount = 0;

char checking;

for(unsigned int i = 0; i == input.length(); ++i) {

checking = spaceCount[i];

if(checking == ' ')

spaceCount++;

}

if(spaceCount >= 1 && input.length >= 5)

std::cout << "Your name is " + input;

else

goto take_input; // reasks for input if the conditions are not met

return 0;

};

**remove all spaces before using the code, the if statements are messed up

5 0
3 years ago
Which of the following is not an operating system
mrs_skeptik [129]

Answer:

C

Explanation:

I hope this helped.

3 0
3 years ago
Read 2 more answers
Data is removed at the back of the queue.a) trueb) false
alexdok [17]

Answer:

true

Explanation:

4 0
3 years ago
What type of hardware enables users to interact with a computer? Check all that apply. the CPU the hard disk drive the keyboard
valentina_108 [34]

Answer:

the keyboard

the monitor

the mouse

Explanation:

just took test

6 0
3 years ago
Read 2 more answers
Create and test an HTML document that describes nested ordered lists of cars. The outer list must have three entries: compact, m
melomori [17]

Answer:

Check the explanation

Explanation:

All website around the world/internet is a collection of different web pages, HTML can be referred to as the single most essential standard when it comes to web design, as well as it being the only one that’s enormously required or needed if you plan to create a web page.

to answer the question above, we will be creating an HTML document that describes nested ordered lists of cars, kindly check the attached images below to see the written codes to solve the question.

8 0
3 years ago
Other questions:
  • What are two examples of management information systems?
    12·1 answer
  • A document format is
    11·2 answers
  • The physical parts of the computer that you can see and touch are called______.
    5·1 answer
  • Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
    6·2 answers
  • Jack used primarily web sources for his informative speech about gun control. however, his over-reliance on the web site sponsor
    11·1 answer
  • when files on storage are scattered throughout different disks or different parts of a disk, what is it called
    10·1 answer
  • Who do you guys ship lol bit with?
    14·2 answers
  • You are sending Secret information to a colleague located at another office. You want to give him some background information an
    15·1 answer
  • Cual
    5·1 answer
  • What form of contacts can be shared in Outlook 2016?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!