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]
4 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]4 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
Consider two decision problems X and Y. If X reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Y. Whic
tekilochka [14]

Answer:

X is in NP and Y is in NP-HARD ( A )

Explanation:

X is in NP and Y is in NP-HARD can be inferred from the previous statement made in the problem above because  problem decision X  can be in NP if it can BE reducible to a 3-SAT polynomial real time, if that can be achieved then  3SAT will be in NP since SAT is in NP as well.

also problem decision Y  can be in NP-HARD if 3SAT can be reducible to it in polynomial time as well hence option A is the correct option

8 0
3 years ago
Several of the items below indicate the steps required to add a slide to a presentation. Select those steps and indicate the ord
ss7ja [257]

Answer:

Click on the New Slide icon.  2.

Enter the slide position desired. N/A

Click where you want to add the slide.  1.

Select New Slide from the Tools menu.  3.

Switch to the Normal or Slide Sorter view. 4.

Switch to the Notes or Outline view. 5.

Explanation:

You can never enter the slide position desired, and you need to click on the slide after which you want the new slide to be placed.  Thus, enter the slide position desired is not applicable, and you need to click where you want to add the slide, and more accurately after which. Hence, this is the 1st. Now you need to click on the new slide icon. Then you need to select the new slides from the tools menu. The slide will appear in Normal view, and you can design the slide now as well as add the notes. You can then move to slide sorter view to arrange the slides, or you can arrange from the slide tab as well. Finally to check(edit) the notes and outline you can change the view to notes or Outline view. Hence, the above answer.

Keep in mind that through presenter view, you can make the slide show where you can see the slides and your notes, and the listeners can see the slides only.

7 0
3 years ago
mips Write a program that asks the user for an integer between 0 and 100 that represents a number of cents. Convert that number
Mumz [18]

Answer:

Explanation:

The following code is written in python and divides the amount of cents enterred in as an input into the correct amount of quarters, dimes, nickels and pennies. Finally, printing out all the values.

import math

#First we need to define the value of each coin

penny = 1

nickel = 5

dime = 10

quarter = 25

#Here we define the variables to hold the max number of each coin

quarters = 0

dimes = 0

nickels = 0

pennys = 0

cents = int(input("Please enter an amount of money you have in cents: "))

if cents > 0 and cents <= 100:

   if cents >= 25:

       quarters = cents / quarter

       cents = cents % quarter

   if cents >= 10:

       dimes = cents/dime

       cents = cents % dime

   if cents >= 5:

       nickels = cents /nickel

       cents = cents % nickel

   if cents > 0:

       pennys = cents / penny

       cents = 0

   print("The coins are: "

       "\nQuarters", math.floor(quarters),

       "\nDimes", math.floor(dimes), "\nNickels", math.floor(nickels), "\nPennies", math.floor(pennys))

else:

   print("wrong value")

8 0
3 years ago
Instructions: Insert functions in the Pet Deposit column of the Summary worksheet to calculate the required pet deposit for each
8090 [49]
The problem ask to insert a function in the Pet Deposit column of the summary worksheet to calculate the required pet deposit for each unit and if the unit has to or more bedroom and has a deposit $125 if not $75 so the function would  =IF(AND(E7="no",F7<2005),"Need to remodel","No change")<span> I hope you are satisfied with my answer 

</span>
6 0
3 years ago
During which step of the problem-solving process would group members combine and elaborate on ideas? Define the problem. Analyze
slava [35]

In a problem-solving process occurring inside a group, (C) develop creative solutions would be where the members combine and elaborate on ideas.

Brainstorming would be a prominent feature during this process since group members would be encouraged to state her or his opinion and solutions about the problem that the group needs to solve.

5 0
4 years ago
Other questions:
  • How many times does the following loop execute? double d; Random generator = new Random(); double x = generator.nextDouble() * 1
    14·1 answer
  • Task manager is showing an application as “not responding.” what can you do?
    11·1 answer
  • Transcription in a virus that has an rna genome is complex because __________.
    11·1 answer
  • Which of the following allowed Temple Grandin to design more humane means of slaughtering cattle? she treated the cattle as inca
    5·2 answers
  • Write a program whose input is two integers and whose output is the two integers swapped.
    11·1 answer
  • When a style set has been inserted in a document, the spacing of the style set can be easily changed.?
    8·1 answer
  • All systems have ___________.
    9·2 answers
  • T.L.E
    6·1 answer
  • What are the best ways to conduct research for a presentation? Check all that apply.
    7·2 answers
  • How many parts does status bar consist ?​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!