JAVA What will be the values of x and y after the following code is executed? int x = 10, y = 20; while (y < 100) { x += y; y += 20; } x = _____________________ y = _______________________
Q: #include int main() float Bread = 1.09, Water = 2.18, Banana = 1.00, Meat = 7.99; // Unit for bread…
A: Solution: These two line are: //line-1 printf("You have %d loaves of bread, %d bottles of…
Q: Problem 2 Solvo by Jsva not python A number in base 2 (binary) is a number such that each of its…
A: import java.lang.*; import java.util.Scanner; public class Main{ public static void main(String[]…
Q: Modify the supplied program template to make an infinite loop that // display a barcode on the VGA…
A: Include the necessary header files: stdlib.h and stdio.h.Define the prototypes for the functions…
Q: Java Program
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT…
Q: Write a Java program that will accept the amount of US Dollar and convert to Philippine Peso. The…
A: The given is a java program which converts American currency i.e. USD to Philippine currency peso…
Q: PLEASE FIX AND MODIFY THIS JAVA PROGRAM SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES…
A: Algorithm: Retail Price Calculator1. Create a class named RetailPriceCalculator.2. Define a static…
Q: . Actions taken by the computer when a function is called, such as allocating memory for parameters…
A: Given: . Actions taken by the computer when a function is called, such as allocating memoryfor…
Q: If the following code, what will be the variable "value" equal to when y=2 is being executed: def…
A: The question has been answered in step2
Q: // Example countLetters("hello") // returns 1 // Exercise 2 //…
A: Excercise1 Letter count function in Javascript…
Q: JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National…
A: Algorithm: Start Read height and weight Calculate bmi=703*(weight / (height * height)) Print bmi If…
Q: Repetition Blocks //define constants #define TRUE ____________ #define FALSE ____________ #define…
A: #define TRUE FALSE #define FALSE 5 The #define in c++ creates a macro, which is the association of…
Q: //Program 4.6 #include 1 2 3 #include 4 int main (){ char c1, с2, с3, с4; cl=65; c2='A'; c3=0x41;…
A: In this code we get error.
Q: Functionality Write Java program to convert numbers in one number system to others. Requirement…
A: Your java program is given below as you required with an output .
Q: In java, float takes _________ bytes in memory.
A: Java is a high-level, class-based and object-oriented programming language that is designed to have…
Q: JAVA CODE PLEASE Functions With No Parameters but With Return Values Practice II by CodeChum Admin…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT--------------
Q: For the C++ program show on the next page, answer the questions that follow. The names g, j, x, and…
A: in line 12,13 ,14 variable f and x is in local scope and variable g is in global scope. in point A…
Q: #@*^gH# is a type of _______ data.
A: Numeric data contains only digits. Alphanumerics data contains alphabets plus digits plus special…
Q: Input operations are supported by class__________________
A: C and C++ provides basic input and operation function predefined in some class.
Q: For a lot of the scoring in this game, it is necessary to know the number of times that each number…
A: The ask is to construct two functions - a) for frequency count to determine the number of…
Q: Python Programming Print "Cat" if x is equal to y, print "Dog" if x is greater than y, otherwise…
A: Given: To write python program
Q: Could you make these into one function? private ClassName function1(ClassName n) { boolean boolVar…
A: Sorry to say but, the above 2 functions cannot be merged into one. I will explain the reason in the…
Q: JAVA CODE a vending machine that accepts n number of products entered by the user and n number of…
A: Vending machine that accepts n number of products entered by the user and n number of coins of any…
Q: manipulate can the _____, we can manipulate the memory.
A: Here have to determine about manipulate memory.
Q: If you build and run the code shown below. The value of b is .. ........ #include #include int…
A: Find your answer below
Q: JAVA PROGRAM Chapter 5. PC #2. Retail Price Calculator (page 312) Write a program that asks the…
A: The Java program is designed to calculate the retail price of an item given its wholesale price and…
Q: Please explain what kind of syntax errors or problems the following statements might have. 1 = x;…
A: Given: As per our policy, "Since you have asked multiple questions, we will solve the first question…
Q: int x1 = 66; int y1 = 39; int d; _asm { } mov EAX, x1; mov EBX, y1; push EAX; push EBX; pop ECX mov…
A: Here we have given a code fragment in assembly language, our task is to find the value of d in…
Q: Write a Java program with the main method and a multiplication method (must be created, not the…
A: The matrix multiplication is each and every element is sum of product of values in same row in first…
Q: ava Validation Programming Android [User Name] User can input value (a~z) (A~Z). User cannot…
A: Answer: I have modify your code to add some
Q: C++ Programming The expression (6-2)*(5+3)/3 evaluates to ___________. Write a c++ expression for .…
A: 1. The expression (6-2)*(5+3)/3 evaluates to 8. 2. Write a c++ expression for adding 2 to a variable…
Q: HELP NEEDED ASAP! Language: JAVA The following code sequence is supposed to compare a float and a…
A: Program Approach : Include necessary libraries. Define main class main. Define main method main.…
Q: Output operations are supported by class_________________
A: Answer of the given question: Output operations are supported by class print stream class. The…
Q: Java Program Mall Parking System Westfield Shopping Mall is having a common…
A: According to the information given:- We have to define the mall parking system in java on the basis…
Q: AVA Programming Language: According to the American Heart Association, as you exercise you should…
A: The code used: import java.util.Scanner; public class HeartRate { public static void…
Q: Instructions: Input one number (integer or decimal), an operator (+, -, *, /), and another number…
A: Java printf statement to print the value up to two decimal values. For a float or double decimal…
Q: while (*psz_2 != 0) { ;u8_c = *psz_2; ;if (u8_c > 0x2F) { ;*psz_1 = u8_c | 0x20; ;} else { ;*psz_1 =…
A: ASSEMBLY LANGUAGE: Assembly language is basically the low level language which is used for various…
JAVA
What will be the values of x and y after the following code is executed?
int x = 10, y = 20;
while (y < 100)
{
x += y;
y += 20;
}
x = _____________________ y = _______________________
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- 1. above? #include int c = 2; int f1(int a, int b); int f2(int a, int b); int main() { } int { int a = 3; int b; b = f1(c, a); printf("%d", b); return 0; f1(int a, int b) int d = f2(b,a); return d; } int f2(int a, int b) { } int d = a*b + c*b; return d; ) What is the output of the program shownInteger userValue is read from input. Assume userValue is greater than 10000 and less than 99999. Assign ten Thousands Digit with userValue's ten thousands place value. Ex: If the input is 17598, then the output is: The value in the ten thousands place is: 1 1 import java.util.Scanner; 2 3 public class ValueFinder { 4 5 6 7 8 9 10 11 12 13 14 15} public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int userValue; int tenThousandsDigit; } userValue = scnr.nextInt(); *Your code goes here */ System.out.println("The value in the ten thousands place is: " + tenThousands Digit);Java Validation Programming Android [User Name] User can input value (a~z) (A~Z). User cannot input value number between 0 and 9. Show an error if user input it. User cannot input value contains symbol (ex: !@#$). Show an error if user input it. User must fill the form to proceed, Show an error if fill form is empty. User only able to input value less than 30 characters. Show an error if exceed. With the validation described above. By using xml layout below, use Android Studio and the Java programming language to solve this question. How to solve this in MainActivity.java? =============================== activity_main.xml <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity" android:layout_width="match_parent"…
- • 5. Given the corner points of a triangle (x1, y1), (x2, Y2), (x3, y3), compute the area. Hint: The area of the triangle with corner points (0, 0), (x1, yı), and (x2, y2) is |¤1· Y2 – 2 · Yı| Geometry.java 1 public class Geometry 2 { 3 /** Computes the area of a triangle @param x1 the x-coordinate of the first corner @param yl the y-coordinate of the first corner @param x2 the x-coordinate of the second corner @param y2 the y-coordinate of the second corner @param x3 the x-coordinate of the third corner @param y3 the y-coordinate of the third corner @return the area of the triangle */ public static double triangleArea (double x1, double y1, double x2, double y2, double x3, double y3) { double area = (Math.abs (x1*y2 - x2*yl))/2; return area; 4. 6. 10 11 12 13 14 15 16 17 18 19 } CodeCheck ResetJAVA:The Body Mass Index – BMI is a parameter used to measure the health status of an individual. Various BMI values depicts how healthy or otherwise a person is. Mathematically BMI = WEIGHT/ HIEGHT * HEIGHT Write a java program using either JOptionPane or Scanner to collect the following values of an individual: 1.a. Namea b. Weight c. Height 2. Compute the BMI of that individual 3. Make the following decisions if: a. BMI < 18.5 is under weight b. BMI >=18.5 but <25 considerably healthy c. BMI >=25 but <30 overweight d. BMI >= 30 but <40 Obesity e. BMI >= 40 Morbid Obesity 4. Display the results of the individual 5. Explain your answer
- 7 public static int test1(int x1, int x2){ 8 9 if(x1==0){ 10 x1=10; 11 } 12 if(x2==0){ 13 x2=10 14 } 15 16 return x1*x2; 17 } 18 19 public static int test2(int x2, int x1){ 20 return x2-x1; 21 } 22 public static int input(){ //Don’t need to trace through //this method to show how it works. Just assume it pulls //the value for the user. 23 Scanner keyboard = new Scanner(new BufferedReader(new InputStreamReader(System.in))); 24 int counter=0; 25 System.out.print("Please enter an integer: "); 26 while(counter<3 && !keyboard.hasNextInt()) 27 { 28 System.out.println(); 29 String temp=keyboard.next(); 30 System.out.println(temp+" is not an integer. Please reenter an integer."); 31 counter++; 32 33 } 34 return keyboard.nextInt(); 35 } 36 37 38…Help code in Java 21. Compound InterestWhen a bank account pays compound interest, it pays interest not only on the principal amount thatwas deposited into the account, but also on the interest that has accumulated over time. Suppose youwant to deposit some money into a savings account, and let the account earn compound interest for acertain number of years. The formula for calculating the balance of the account after a specifiednumber of years is:A = P ( 1 + r n ) n tThe terms in the formula are:A is the amount of money in the account after the specified number of years.P is the principal amount that was originally deposited into the account.r is the annual interest rate.n is the number of times per year that the interest is compounded.t is the specified number of years.Write a program that makes the calculation for you. The program should ask the user to input thefollowing:The amount of principal originally deposited into the accountThe annual interest rate paid by the accountThe…Using Java (JOptionPane) Calculate Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase: • The number of shares that Joe purchased was 1,000. • When Joe purchased the stock, he paid $32.87 per share. • Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock. Two weeks later Joe sold the stock. Here are the details of the sale: • The number of shares that Joe sold was 1,000. • He sold the stock for $33.92 per share. • He paid his stockbroker another commission that amounted to 2% of the amount he received for the stock. Write a program that displays the following information: • The amount of money Joe paid for the stock. • The amount of commission Joe paid his broker when he bought the stock. • The amount that Joe sold the stock for. • The amount of commission Joe paid his broker when he sold the stock. • Display the amount of profit that Joe made after selling his stock and paying the two commissions to…
- mport java.util.Scanner; public class ParkingCharges { // function to calculate the basic charge using the asked hours static double getBasicCharge(int hours) { if (hours >= 7 && hours <= 8) return 5.50; else if (hours >= 5 && hours <= 6) return 4.50; else if (hours >= 2 && hours <= 4) return 4.00; return 3.00; } // function to return the amount to subtract based on local living and OAP static double getDiscount(String isLocal, String isOAP) { if (isOAP.equals("Yes") && isLocal.equals("Yes")) return 2.0 + 1.0; else if (isOAP.equals("Yes")) return 2.0; else if (isLocal.equals("Yes")) return 1.0; return 0; } public static void main(String[] args) { // create a new Scanner object Scanner sc = new Scanner(System.in); // prompt the user to ask if they are disabled…In JAVA. Any and all help is appreciated, please also show the results with your code. Please see the attached image.Project Name: ActivitiesClass name: Dollar_Conversion Write a Java program that will accept theamount of US Dollar and convert to PhilippinePeso. The current exchange rate is 1 dollar is to 49.75pesos. Convert 50 dollars to peso. Display the converted value using three (3)decimal places. Using blueJ
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)