Question

Write a Java program with Counter-Controlled Loop to output the following: N     10*N     100*N     1000*N 1     ...

Write a Java program with Counter-Controlled Loop to output the following:

N     10*N     100*N     1000*N
1      10           100            1000
2       20           200            2000
3       30           300            3000
4       40           400            4000
5       50           500            5000

The output should look as shown above. The columns should be properly aligned.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

//main class definition
public class Main
{
//main function definition
   public static void main(String[] args) {
  
   //print the header line
       System.out.println("N\t10*N\t100*N\t1000*N");
      
       //for loop to traverse from 1 to 5
       for (int i=1; i<=5; i++) {
       //calculate each expression and print the corressponding value
       System.out.println(i + "\t" + 10*i + "\t" + 100*i + "\t" + 1000*i);
       }
   }
}

//main class definition public class Main { //main function definition public static void main(String[] args) { //print the h

Add a comment
Know the answer?
Add Answer to:
Write a Java program with Counter-Controlled Loop to output the following: N     10*N     100*N     1000*N 1     ...
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
  • Table 9-1 Output Consumption Investment Net Exports 1000 800 500 100 1500 1200 500 100 2000...

    Table 9-1 Output Consumption Investment Net Exports 1000 800 500 100 1500 1200 500 100 2000 1600 500 100 2500 2000 500 100 3000 2400 500 100 3500 2800 500 100 4000 3200 500 100 ____   12.   In Table 9-1, the equilibrium level of output is a. 2,500. b. 3,000. c. 3,500. d. 4,000. ____   13.   In Table 9-1, at output of 4,000, inventories are a. decreasing by 200. b. increasing by 200. c. increasing by 300. d. decreasing by...

  • Question 2 The market for barley has the following demand and supply schedule. Price (RM) 100...

    Question 2 The market for barley has the following demand and supply schedule. Price (RM) 100 200 300 400 500 600 Quantity demanded (tonnes) 7000 6000 5000 4000 3000 2000 (tonnes) 1000 2000 3000 4000 5000 6000 (a) State the price, quantity and revenue received at equilibrium. 18 marks] Study shows that barley is good for diabetics. The quantity demanded is increased by 2000 tonnes. Determine the new quantity demanded, price (i) and quantity. 6 marks] (b) Calculate the new...

  • Select two data values from your raw data – one that is inside of the confidence interval and one that is outside – one must be at the high end of the data and one at the low end – and construct two h...

    Select two data values from your raw data – one that is inside of the confidence interval and one that is outside – one must be at the high end of the data and one at the low end – and construct two hypothesis tests, one for each value. One of the tests should be a “less than”, the other should be a “greater than”, depending on the value being tested. Use a 95% level of confidence, and showcase Ho...

  • Identify the following ir spectrum 100 Transmittance *T D 0 4000 3000 1300 1000 100 2000...

    Identify the following ir spectrum 100 Transmittance *T D 0 4000 3000 1300 1000 100 2000 wavenumber om ethyl vinyl ether 2-butanone 2-methylpropanal 2-methyl-2-propen-1-ol Identify the following ir spectrum Transmittance T E 4000 1000 1500 1000 300 1000 wavenumber cm 2-methylpropanal 2-methyl-2-propen-1-ol ethyl vinyl ether 2-butanone Identify the following ir spectrum 100 mm Transmittance ** ly B 500 1000 1100 1000 1000 1000 wavenumber em: O2-methyl-2-propen-1-ol 2-methylpropanal 2-butanone ethyl vinyl ether Identify the following ir spectrum 100 พา Transmittance NT...

  • Question #1 (10 Marks) 500 1000 1500 2000 2500 3000 3500 200 650 1100 1550 2000...

    Question #1 (10 Marks) 500 1000 1500 2000 2500 3000 3500 200 650 1100 1550 2000 2450 2900 3350 100 100 100 100 100 100 100 1005001600 250 500 500 500 500 500 500 500 1400 50 200 1000 400 125 600 S0 8001O 1000 2000 1200 8SD 400 400 400 Complete the Total Planned Expenditure (AE) column for all levels of income (Y) on the above table. a) What is the consumption function? Complete the equation. C- 200 b)...

  • 1. Write a Java program to implement Counting Sort and write a driver to test it....

    1. Write a Java program to implement Counting Sort and write a driver to test it. Note: use random number generator to generate your input with n = 10, 50, and 100. Verify that the running time is O(n). 2. Write a Java program to implement Bucket Sort and write a driver to test it. Note: use random number generator to generate your input with n = 10, 50, and 100. Verify that the running time is O(n). 3. In...

  • use java thanks 1.Given the following arrays, write a Java program to generate the output below....

    use java thanks 1.Given the following arrays, write a Java program to generate the output below.    String [] item = {"milo", "water", "coke", "tea", "coffee"};    double [] price = {3.00, 1.00, 5.00, 2.00, 3.50};    int [] quantity = {200, 500, 350, 100, 700}; Re-write Question 1 using array list and display the sale of the day report. Re-write Question 1 using 2-dimensional array and display the sale of the day report. Write a segment program to replace...

  • several possible correlations: −1.2,   −0.980,   −0.23,   0,   0.299,   0.767,   1,   12 Below are three scatterplots. For...

    several possible correlations: −1.2,   −0.980,   −0.23,   0,   0.299,   0.767,   1,   12 Below are three scatterplots. For each scatterplot, select the correct correlation from the list. (Not all will be matched.) Briefly explain answer. (A) 500 (B) (C) 100 400 5 95 300 90 200 85 100 1 80 20 30 1 40 1 50 60 70 500 1000 1500 2000 2500 3000 3500 Area (square feet) 0 500 1000 1500 2000 2500 3000 3500 Area (square feet) Mean Age

  • Write a java program that display the following series using for loop: 0 10 30 40...

    Write a java program that display the following series using for loop: 0 10 30 40 60 70 80

  • 6.6 See Figure 6.71. Determine the measurements shown, on the civil engineer's scales. oe V س...

    6.6 See Figure 6.71. Determine the measurements shown, on the civil engineer's scales. oe V س لسليس مسلسل سلسلسسلسسلسلسليس مسلسل السلسبيست س لسلس ] lululululululululululululululululululululululululululululululululululului + 6.6: Civil engineer's scales Number Ratio 1"=1" 1"=1' 1: 1 0 .1" 0.1' 1"=10' 1' 1"-100' 1"=1000 10' 100' 1"=5" 1"=5' 1"=50' 1"=500' 1"=5000' 1”=2" 1”=2° 1"=20° 1"=200° 1"=2000" 1”=4” 1”=4' 1"=40' 1"=400' 1"-4000' 1: 3 1 "=3" 1"=3' 1"=30' 1"=300' 1"=3000' 1:6 1"=6" 1"=6' 1"=60' 1"=600' 1"=6000'

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