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: 70% (10 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...
-
Joyous Julius, Inc., is a large retail chain that has grown quickly thanks to its successful leveraging of homemade-style orange julius. The company would like to narrow down the number of flavors it...
-
Describe how an investor would hold an arbitrage position in an asset, in terms of full-hedge arbitrage.
-
At the beginning of the summer, Jack Wells was looking for a way to earn money to pay for his college tuition in the fall. He decided to start a lawn service business in his neighborhood. To get the...
-
Determine Due Date and Interest on Notes Determine the due date and the amount of interest due at maturity on the following notes: Date of Note Face Amount Interest Rate Term of Note $90,000 6% a....
-
A firm that sells software services has been piloting a new product and has records of 500 customers who have either bought the services or decided not to. The target value is the estimated profit...
-
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.
-
East Hill Home Healthcare Services was organized five years ago by four friends who each invested $10,000 in the company and, in turn, were issued in total 8,000 shares of $1.00 par value common...
-
Hackett Produce Supply is preparing its cash budget for April. The following information is available: Estimated credit sales for April Actual credit sales for March Estimated collections in April...
-
006 10.0 points A pendulum clock was moved from a location where g = 9.8168 m/s to another location where 9 9.806 m/s. During the move, g = the length of the clock's pendulum did not change;...
-
6-3x 2 Problem 6. (a) Find L So 6-3x-2y 3 2 dz dy dx. (b) Find the limits of integration. No need to find the integral. dx dz dy. Hint: The plane in the image is given by 3x + 2y + 3z = 6. 2.0 1.5...
-
Question Under what scale of measurement(s) can we say that : Jim weighs 4X as much as Edie? Sam is heavier than Sue? Jim and Sam don't weigh the same? Jim is much heavier than Sam, but Mary is only...
-
Lender Company provides postretirement health care benefits to employees who provide at least 10 years of service and reach the age of 65 while in service. On January 1 of the current calendar year,...
-
Danuta Swinton was unhappy with a very large maple tree in her front yard. She therefore contacted West End Tree Service (WETS) to discuss the problem. At the end of their discussion, WETS's manager...
-
A 6-lb shell moving with a velocity ?? v0k explodes at point D into three fragments which hit the vertical wall at the points indicated. Fragments A, B, and C hit the wall 0.010 s, 0.018 s, and 0.012...
-
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
-
Deacon Company is a merchandising company that is preparing a budget for the three - month period ended June 3 0 th . The following information is available Deacon Company Balance Sheet March 3 1...
-
Mango Company applies overhead based on direct labor costs. For the current year, Mango Company estimated total overhead costs to be $460,000, and direct labor costs to be $230,000. Actual overhead...
-
Which of the following do we expect to be the horizon growth rate for a company (long term growth rate- say 30-50 years)? A) Inflation B) Industry Average C) Zero D) Market Beta
Study smarter with the SolutionInn App