Question

One kilogram is equivalent to 2.205 pounds and is 35.274 ounces. Create a program that displays...

One kilogram is equivalent to 2.205 pounds and is 35.274 ounces. Create a program that displays every kilogram value from 5 to 100, counting by five; for each value, display the equivalent value in pounds and in ounces. See below for sample output. Java homework.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
public class KgConversions {

    public static void main(String[] args) {
        System.out.println("Kg\t\tPounds\t\tOunces");
        for (int kg = 5; kg <= 100; kg += 5) {
            System.out.printf("%d\t\t%.3f\t\t%.3f\n", kg, kg * 2.205, kg * 35.274);
        }
    }
}

Add a comment
Know the answer?
Add Answer to:
One kilogram is equivalent to 2.205 pounds and is 35.274 ounces. Create a program that displays...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that displays the following pattern: Write a program that displays the following table:...

    Write a program that displays the following pattern: Write a program that displays the following table: Assume a runner runs 14 kilometers in 45 minutes and 30 seconds. Write a program that displays the average speed in miles per hour. (Note that 1 mile is 1.6 kilometers) The U.S. Census Bureau projects population based on the following assumptions: One birth every 7 seconds One death every 13 seconds One new immigrant every 45 seconds Write a program to display the...

  • Coding in C# please Develop the C# program for the following problems: 1. Create a new...

    Coding in C# please Develop the C# program for the following problems: 1. Create a new class and name it as Conversion. 2. In this class, provide the code that uses a for or while loop to display a table that lists values for some unit and the equivalent in two other units. . Enter a start value, and end value and a step value as a range of values for the unit to be converted, . Show three columns...

  • python Write a program that displays a table of Celsius temperatures and equivalent Fahrenheit temperatures. You...

    python Write a program that displays a table of Celsius temperatures and equivalent Fahrenheit temperatures. You can find the formula online if necessary. Your program should print both scales accurate to one decimal place in columns 8 characters wide (see page 71). Use Celsius temperatures ranging from -40C to 40C in 10 degree increments. See Required Output. Required Output CEL FAH === -40.0 -40.0 -30.0 -22.0 -20.0 -4.0 - 10.0 14.0 0.0 32.0 10.0 50.0 20.0 68.0 30.0 86.0 40.0...

  • java program: Write a program which displays the following list on the screen and asks the...

    java program: Write a program which displays the following list on the screen and asks the user to enter either 1 or 2 and perform one of the operations based on the user’s input. If the user enters any other character other than 1 or 2 then display “wrong choice”. LIST OF OPERATIONS 1. Buzz Number                      2. Consecutive Odd numbers Note: A BUZZ number is a number which either ends with 7 or is divisible by 7. Sample input 27...

  • How do you solve this assignment? Create a program that displays the ending balance in a...

    How do you solve this assignment? Create a program that displays the ending balance in a savings account, given the beginning balance, the deposit amounts, and the withdrawal amounts. Use two loops in the program: one to get the deposit amounts, and the other to get the withdrawal amounts. a. Create an IPO chart for the problem, and then desk-check the algorithm two times, using the data shown in Figure 7-52. xid-26481329_1 b. List the input, processing, and output items,...

  • write a c++ program: User enter in 5 numbers, stores  them in an array then displays them...

    write a c++ program: User enter in 5 numbers, stores  them in an array then displays them from least -> greatest. Then create a char array the user will enter some letters, it gives a count on every 'a' then it gets replaced by an uppercase 'A'. Display the result. Then display only the last letter.

  • Write a program in Java that performs the Counting Sort algorithm. a) Create the countingSort method....

    Write a program in Java that performs the Counting Sort algorithm. a) Create the countingSort method. Use the pseudocode shown in the lecture. b) Test your codes by writing a program that uses the following input array: int[] array_A = {6, 0, 2, 0, 1, 3, 4, 6, 1, 3, 2}; c) Your output should display the following versions of the arrays: I. The original input array A II. The counting array C after the counting (lines 4-5 in pseudocode)...

  • THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM...

    THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM FOR PYTHON THIS IS A PROGRAM FOR PYTHON This time, we will write a program that uses functions to parse through all those names in a List object (see below for the "us_counties" list) to count the number of occurrences each vowel (a, e, i, o, u) has in all the names. We want 5 separate answers, one for each vowel. Not looking for output here. All my solution will...

  • Write a Java program called Histogram.java that displays a list of distinct characters in an input...

    Write a Java program called Histogram.java that displays a list of distinct characters in an input tile and the occurrence of each eharacte. Your iogram should 1ead an input file name from a use. After that, your program should read characters in the file and display a list of distinct characters and their occurTeces. Finally, your program should draw a veril bafo the occuences For the assignment, your program has.to display the result exactly as the sample run. For instance,...

  • Using Java, please create the program for the following prompt. MUST CREATE BUTTONS IN A JFRAME,...

    Using Java, please create the program for the following prompt. MUST CREATE BUTTONS IN A JFRAME, as specified by the prompt! DO NOT use user input of 1, 2, 3 etc. User input must come from clicking the buttons. Please be sure to test your program. Thank you! Write a program that displays three buttons with the names or images of three candidates for public of office. Imagine that a person votes by clicking the button that shows the candidate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT