What is printed by this code? int x = 120; int y = 9; if(false){ x = 20; } else if (x>100 || y <= 0){ y=+1; if(y<=9){ x=x-10; } else if (x>90) { y = x; x=100; } else if(x==100){ y = 50; } else { y=0; } } else if (y<100 && (y >150 || x == 10)) { y = -90; } else if (y > 0) { x = 5; } else { y = x; } System.print.out("X is: "+x+" and y is: "+y); What would it print if X started as 10 instead? Use color or position of pixels to process images Write a method to remove all red from the pixels in the bottom left quarter of a picture.
Added by Jennifer S.
Close
Step 1
int x = 120; int y = 9; - x is assigned the value 120 and y is assigned the value 9. Show more…
Show all steps
Your feedback will help us improve your experience
Kevin Corkran-Itagaki and 58 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Run the app displayed for the av. Exercise 2-3 100 Enter subtotal: 10.0 Discount amount: 90.0 Invoice total: Continue? (y/n): y 500 Enter subtotal: Discount amount: 125.0 Invoice total: 375.0 Continue? (y/n): n Number of invoices: 2 Average invoice: 232.5 Average discount: 67.5 Open the project named ch02_ex3_Invoice that's in the ex_starts directory. Then, open the file named InvoiceApp.java. 2. Modify the code so the application ends only when the user enters "n" or "N". As it is now, the application ends when the user enters anything other than "y" or "Y". To do this, you need to use a not operator (!) with the equalsIgnoreCase() method. Then, test this change. 3. Modify the code so it provides a discount of 25 percent when the subtotal is greater than or equal to 500. Then, test this change. 4. Modify the code so it displays the number of invoices, the average invoice amount, and the average discount amount when the user ends the program. Then, test this change. Code: Change any comments that are no longer accurate.
Supreeta N.
Write a program with four methods for calculating the cost of a yearly auto service visit. The methods will be titled yearlyService. - yearlyService(no parameters) - Will return the standard service charge. - yearlyService(one parameter) - Will return the standard service charge with an added oil change fee. - yearlyService(two parameters) - Will return the standard service charge with an added oil change fee and a tire rotation charge. - yearlyService(three parameters) - Will return the standard service charge with an added oil change fee, a tire rotation charge, along with a coupon amount that will be deducted from the total cost. Write a main method that will test each of these methods two times.
Aarya B.
Write a program to find and print area of square (Java)
Willis J.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD