What will the following program display? public class CheckPoint { public static void main(String[] args) { int
Question:
What will the following program display?
public class CheckPoint
{
public static void main(String[] args)
{
int funny = 7, serious = 15;
funny = serious % 2;
if (funny != 1)
{
funny = 0;
serious = 0;
}
else if (funny == 2)
{
funny = 10;
serious = 10;
}
else
{
funny = 1;
serious = 1;
}
System.out.println(funny + " " + serious);
}
}
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 75% (8 reviews)
Solution The following program will display 0 0 Explanation The value of funny is set to the ...View the full answer
Answered By
Labindao Antoque
I graduated in 2018 with a Bachelor of Science degree in Psychology from Dalubhasaan ng Lungsod ng San Pablo. I tutored students in classes and out of classes. I use a variety of strategies to tutor students that include: lecture, discussions about the subject matter, problem solving examples using the principles of the subject matter being discussed in class , homework assignments that are directed towards reinforcing what we learn in class , and detailed practice problems help students to master a concept. I also do thorough research on Internet resources or textbooks so that I know what students need to learn in order to master what is being taught in class .
0.00
0 Reviews
10+ Question Solved
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Question Posted:
Students also viewed these Computer science questions
-
What will the following program display? #include using namespace std; void other(); namespace n1 { int x = 1; } namespace n2 { int x = 2; } int main() { using namespace n1; cout < < x < < endl; {...
-
What will the following program segments display? a) x = 2; y = x++; System.out.println(y); b) x = 2; System.out.println(x++); c) x = 2; System.out.println(--x); d) x = 8; y = x--;...
-
What will the following code display in message boxes? Dim intX As Integer = 1 Do MessageBox.Show(intX.ToString) intX = intX + 1 Loop Until intX > 5
-
August 8, 2019, was a grim day at the San Francisco headquarters of Uber, the global leader in ride-hailing companies. That day it announced a staggering loss of $5.2 billion in just the previous 3...
-
Customers arrive at teller windows at a bank at the rate of 12 per hour. A teller is able to process 15 customers per hour on average. If the bank has a goal that customer wait time should be no more...
-
Show how depth-first search works on the graph of Figure 22.6. Assume that the? for? loop of lines 5-7 of the DFS procedure considers the vertices in alphabetical order, and assume that each...
-
Match the measures of worth in the first column with the appropriate unit of measure that results from the analysis. Measure of Worth (a) Annual Worth (b) External Rate of Return (c) Future Worth (d)...
-
The Sports Equipment Division of Harrington Company is operated as a profit center. Sales for the division were budgeted for 2014 at $900,000. The only variable costs budgeted for the divisions were...
-
Problem 1: JIT Setup Cost and Time Suppose that Roger, a production manager, is trying to run JIT. The product Annual Demand is 300,000 units, with 250 working days in a year, which means daily...
-
Kaleidoscope Cutlery manufactures kitchen knives. One of the employees, whose job is to cut out wooden knife handles worked 49 hours during a week in January. The employee earns $14 per hour for a...
-
This section of a switch statement is branched to if none of the case expressions match the switch expression. a. Else b. Default c. Case d. Otherwise
-
Assume the double variable number contains the value 12345.6789. Write a statement that uses System.out.printf to display the number as 12,345.68.
-
Praveen Co. manufactures and markets a number of rope products. Management is considering the future of Product XT, a special rope for hang gliding that has not been as profitable as planned. Since...
-
Jean and John Inc had the following balance sheets on August 31, 2022, just before acquisition: Jean Inc. John Inc. (carrying value) (carrying value) Cash $1,200,000 $300,000 Accounts Receivable $...
-
Which earnings management technique involves setting aside excess reserves during profitable periods to be used in future periods when earnings need a boost?
-
Which type of financial statement shows how every category of expense is allocated?
-
Pick an event or political action in Alaska's history (other than the discovery of oil at Prudhoe Bay) that had an important influence on shaping the pattern of economic development and population...
-
A helicopter has a rotor diameter of 40 feet and it is being operated in a hover at 307.95 rpm. Calculate the tip speed in fps (V t ) of the rotor.
-
In Fig. 8-27, the third and fourth layers are labeled Middleware and Application on all four machines. In what sense are they all the same across platforms, and in what sense are they different?
-
Identify the source of funds within Micro Credit? How does this differ from traditional sources of financing? What internal and external governance mechanisms are in place in Micro Credit?
-
When a CPU executes the instructions in a program, it is engaged in what process?
-
Computers can only execute programs that are written in __________. a. Java b. Assembly language c. Machine language d. Python
-
Computers can only execute programs that are written in __________. a. Java b. Assembly language c. Machine language d. Python
-
2. In the following table we have cash flows for two mutually exclusive projects under consideration by your firm. You are asked to evaluate the two projects using both the NPV and IRR rules (applied...
-
Sylvia is married and has four teenage children. She has a detailed retirement plan in place. She is 43 years old and she hopes to retire in 17 years from now when she is 60 by which time her...
-
Jack transferred his RRSP to a RRIF at the end of last year. At the beginning of the year, he was 71 years of age and the fair market value of the RRIF was $300,000. The prescribed RRIF factor for a...
Study smarter with the SolutionInn App