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...
-
You have gathered this information on JJ Enterprises: 2017 2018 Sales $6,318 $7,202 COGS 3,945 4,460 Interest 303 277 Depreciation 1,204 1,196 Cash 672 418 Accounts receivables 601 578 Current...
-
The chance that a randomly selected person in the United States is between 15 and 29 years old is about 21%. (Source: U.S. Census Bureau) In Exercises 13 and 14, the table shows the approximate...
-
Assume that the following balance sheets are stated at book value. The fair market value of James fixed assets is equal to the book value. Jurion pays $15,000 for James and raises the needed funds...
-
ABC In. issued 20-year bonds seven years ago at a coupon rate of 7.4%. The bonds make semiannual payments. If the YTM on these bonds is 5.7%, what is the current bond price? (Do not round...
-
As someone who came of age in the "post e-mail" world of blogs, wikis, social networks, and other Web 2.0 technologies, you were rather disappointed to find your new employer solidly stuck in the age...
-
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...
-
At i = 8% per year, the annual worth for years 1 through 6 of the cash flows shown is closest to: (a) $302 (b) $421 (c) $572 (d) $824 Years 1 2 4 5 300 400 500 600 700 800 3.
-
Consider the expression timing is everything in relation to the building of the TOMS brand. Besides the influence of recovering economic conditions and the increased affluence of potential customers,...
-
What is corporate strategy and why is it important? Choose a company with which you are familiar, and evaluate its corporate strategy, especially in regards to financial strategies. What are some...
-
Assignment Tasks: Review the following situations and for each pay period determine the employee's net pay by calculating what earnings & benefits are subject to Income Tax, Canada / Quebec Pension...
-
sample letter for signature change on bank accounts for principals of school
-
Use Excelshowing all work and formulasto complete the following: Prepare a flexible budget. Compute the sales volume variance and the variable cost volume variances based on a comparison between...
-
In Problems, rewrite each radical with a fractional exponent and then approximate the value with a calculator. 12 (4.96)
-
Explain the operation of the dividends received deduction.
-
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.
-
Arnold inc. is considering a proposal to manufacture high end protein bars used as food supplements by body builders. The project requires an upfront investment into equipment of $1.4 million. This...
-
Billy Bob bank has three assets. It has $83 million invested in consumer loans with a 3-year duration, $46 million invested in T-Bonds with a 12-year duration, and $69 million in 6-month (0.5 years)...
-
Ventaz Corp manufactures small windows for back yard sheds. Historically, its demand has ranged from 30 to 50 windows per day with an average of 4646. Alex is one of the production workers and he...
Study smarter with the SolutionInn App