What is the output of the following program? 1 public class Weird { public static void main
Question:
What is the output of the following program?
Transcribed Image Text:
1 public class Weird { public static void main (String [] args) { int number 8; %3D 4 halfTheFun (11); halfTheFun (2 - 3 + 2 * 8); halfTheFun (number); 7 System.out.println ("number = " + number); 8. 9. 10 public static void halfTheFun (int number) { 11 number = number / 2; 12 for (int count = 1; count <= number; count++) { System.out.print (count + " "); 13 14 } 15 System.out.println (); 16 17 3.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 64% (17 reviews)
Output of Wei...View the full answer
Answered By
Utsab mitra
I have the expertise to deliver these subjects to college and higher-level students. The services would involve only solving assignments, homework help, and others.
I have experience in delivering these subjects for the last 6 years on a freelancing basis in different companies around the globe. I am CMA certified and CGMA UK. I have professional experience of 18 years in the industry involved in the manufacturing company and IT implementation experience of over 12 years.
I have delivered this help to students effortlessly, which is essential to give the students a good grade in their studies.
3.50+
2+ Reviews
10+ Question Solved
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted:
Students also viewed these Computer science questions
-
What is the output of the following code segment? t = 10; if(t > 7) { System.out.print("AAA"); System.out.print("BBB"); } a. AAA b. BBB c. AAABBB d. Nothing
-
What is the output of the following code segment? t = 0; if(t > 7) System.out.print("AAA"); System.out.print("BBB"); a. AAA b. BBB c. AAABBB d. Nothing
-
What is the output of the following code? b = 1; while(b < 4) System.out.print(b + " "); a. 1 b. 1 2 3 c. 1 2 3 4 d. 1 1 1 1 1 1...
-
Find the deflection y(x) of a cantilever beam embedded at its left end and free at its right end when the load is as given in Example 10.
-
A steady-flow compressor is used to compress helium from 15 psia and 70F at the inlet to 200 psia and 600F at the outlet. The outlet area and velocity are 0.01 ft2 and 100 ft/s, respectively, and the...
-
Write a function to set the red, green, and blue values to 255. What is the result?
-
Assume that the pump performance characteristics shown in Fig. P7.78 are for a pump running at \(1200 \mathrm{rpm}\). Assuming that the pump head, \(h_{p}\), the pump impeller diameter, \(D\), and...
-
The operations manager of a firm that produces frozen dinners had received numerous complaints from supermarkets about the firms Chick-n-Gravy dinners. The manager then asked her assistant, Ann, to...
-
Three years ago, you purchased a bond for $974.69. The bond had three years to maturity, a coupon rate of 8%, paid annually, and a face value of $1,000. Each year, you reinvested all coupon interest...
-
Which forecasting technique would be best for each of the following scenarios: 1. The demand for Valentines Day greeting cards? 2. The demand for ice cream during a year? 3. The demand for a new...
-
What sort of figure will be drawn by the following program? Can you draw a picture that will approximately match its appearance without running it first? 1 import java.awt.*; 3 public class Draw7 {...
-
Write a program that computes the spherical distance between two points on the surface of the Earth, given their latitudes and longitudes. This is a useful operation because it tells you how far...
-
Cindy Bagnal, the manager of Cayce Printing Service, has provided you with the following aging schedule for Cayces accounts receivable: align="center"> Cindy indicates that the $126,700 of accounts...
-
What sorts of legal risks are sharing economy firms exposed to? Conduct research online and identify examples of incidents that have put firms, customers, or suppliers at risk. Do you think these...
-
It has been suggested that there would be less of an expectation gap if there were to be a note to the accounts giving in relation to those assets and liabilities which involved estimates, the range...
-
Provide an example of the SARA model in your line of work. Make sure to define how the problem was discovered and analyzed, how you or your team responded to the problem, and how the methods results...
-
An investor enters into a short forward contract to sell 100,000 British pounds for US dollars at an exchange rate of 1.4000 US dollars per pound. How much does the investor gain or lose if the...
-
A US Treasury bond pays a \(7 \%\) coupon on January 7 and July 7 . How much interest accrues per \(\$ 100\) of principal to the bondholder between July 7, 2011, and August 9, 2011? How would your...
-
A surface completely surrounds a +2.0 10-6C charge. Find the electric flux through this surface when the surface is (a) a sphere with a radius of 0.50 m, (b) a sphere with a radius of 0.25 m, and...
-
Reduction in sales All of the above 29. Belt of an electric motor is broken, it needs a. Corrective maintenance b. Scheduled maintenance c. Preventive maintenance d. Timely maintenance. 30. The...
-
How many IP addresses and how many link-layer addresses should a router have when it is connected to five links?
-
Figure 9.7 shows a system as either a host or a router. What would be the actual entity (host or router) of system A and B in each of the following cases: Figure 9.7 a. If the link is the first one...
-
Define framing and give the reason it is needed.
-
Provide a numerical example to illustrate how carry trade works?
-
If there are 3 6 0 million people living in the U . S , and 2 7 0 million are eligible workers while 1 5 0 million are in the labor force with 3 . 6 % unemployed, what is the number of unemployed...
-
Refer to the information provided in Figure 8.8 bele to answer the questis that MC Coper 12 ATC P-MR 200 700 1000 1400 Bushels of soybeans 283 Figure 8.8 26) Refer to Figure 8.8. This farmer's...
Study smarter with the SolutionInn App