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: 4. A downtown apartment charges $650 for rent per month. Write Java code that outputs the total cost…
A: - We have to code for the rent of the apartment. - We are coding in java.
Q: Given the temperature T (in degrees Fahrenheit) and the wind speed v (in miles per hour), the…
A: The programming methodology for the given program is given as under: import packages Main class…
Q: In a Java Language codes Last month Joe purchased some stock in Acme Software, Inc. Here are the…
A: Java program: //Main class public class Main { //main class public static void…
Q: use java to answer the following question This task is required to create Craps, which is a popular…
A: We have to create a game in java where 2 dice are rolled and if the sum is either Case 1: 2,3 or 12…
Q: Trace of the following Java code and show what is printed (the values of the variable 'c' )…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Given the following declaration: String s="Apples and bananas are yummy."; Evaluate the expressions:…
A: The below program is solved using Java Programming Language
Q: error
A: the following code has a syntax error Figure out the error and correct it ? class access…
Q: Assume a random number generator object named randGen exists. Which expression is most appropriate…
A: Here have to determine about python for random generator problem statement.
Q: powers of the variable. The Maclaurin series expansion for sin(x) is given by the following formula…
A: import java.util.Scanner; public class Introduction{ //Factorial function to find factorial of…
Q: QUESTION 2 ( java programming) Complete the following code fragments to display the number of zero,…
A: Tip: In code if there are multiple if statements for same condition then you can use…
Q: Problem: Assume that you have been hired at Oman Investment and Finance Co. SAOG (OIFC) to write a…
A: Your required code is given below: Letting, 1 OMR = 1000 Baisa
Q: After lockdown, the government decided to support customers by halving the customer’s electricity…
A: Your Java program is given below as you required with an output. Algorithm :- Start Prompt user to…
Q: (1) Write a Java program named SphereVolume. (2) The program should read and store Sphere's radius.…
A: PROGRAM CODE: import java.util.*; // import the java utility packageclass…
Q: Write a program whose inputs are three integers, and whose output is the smallest of the three…
A: import java.util.*;class Test167 { public static void main(String args[]) { Scanner sc = new…
Q: Note: Please answer the question in Java only: Each Byteland gold coin has a whole number written on…
A: The above question is solved in step 2 :-
Q: Red Sands University (RSU) is a popular brand of education in Bidiya. RSU offers business degree for…
A: PROGRAM: //Header File import java.util.Scanner; //Defining the class class Main { //Defining the…
Q: rite a program that takes an integer as a command line argument and calculates its factorial. This…
A: Required: Write a program that takes an integer as a command line argument and calculates its…
Q: Supposing you have set up a business that is carrying out a commercial activity and making profits,…
A: ANSWER:-
Q: Write a program called TimeConvertor.java that converts times expressed in 24-hour clock to 12-hour…
A: Here are five examples of what the program should look like when it runs: i. Enter a time ([h]h:mm…
Q: In Java A variable like userNum can store a value like an integer. Extend the given program to…
A: Program Explanation – Import the essential java libraries. Declare the class named as Main.…
Q: All coding is done is JAVA. I am using IntelliJ Idea if it helps. 13. Mobile Service Provider: A…
A: I provide the code in Java along with output and code screenshot
Q: In the written exam held at the end of the driving license course, 50 questions from Traffic, 40…
A: Answer in step2
Q: Ask the user for a number of seconds. Display the number of minutes, seconds, and hours accordingly.…
A: Here, Code instruction is given.
Q: Red Sands University (RSU) is a popular brand of education in Bidiya. RSU offers business degree for…
A: PROGRAM: //Header File import java.util.Scanner; //Defining the class class Main { //Defining the…
Q: Please explain how the Java code is done File IO Application A shop collects the following…
A: Answer
Q: Create a java class named Shipment a. The program must ask for two separate packages to ship b.…
A: a. The program must ask for two separate packages to ship b. The program must calculate the cost…
Q: Please help there's an error in my code but I can't figure it out.
A: As cost is declared as string, we need to parse to get its double value and there is lot of unused…
Q: Fatima wants to lose weight, but the process takes a lot of efforts and commitments. Write a JAVA…
A: Approach: Take input from the user the value of starting and current weight using the object of…
Q: Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south,…
A: Actually, given information is: Primary U.S. interstate highways are numbered 1-99. Odd numbers…
Q: 2. The equation for the position of equivalent-speed kinetic objects is as follows. 1 ¤(t) = at +…
A: Objective: The position of a kinetic object should be calculated after a given time when the…
Q: Write a program that takes an integer as a command line argument and calculates its factorial. This…
A: Create a class called NegativeInputException and assign some message property describing the error…
Q: e (greater than 40 hours) is paid at 1.5 times the hourly rate. Calculate total pay before…
A: Solution - In the given question, we have to provide a java code that calculates the pay of an…
Q: how can you help Sunita Sharma ( for 65 plus ) years old to live a healthy and better life.…
A: We can help the elderly people in many ways like we can make an application which will connect the…
Q: Where is the problem in the following code sequence? The code is intended to generate random numbers…
A: Program : import java.util.Random;public class Main{ public static void main(String[] args) {…
Q: Code in Java only Elon musk has three potato fields. Harvest x potatoes in the first field, y…
A: Here, in this question we are asked to develop a Java code. It is stated that the amount of potatoes…
Q: Supposing you have set up a business that is carrying out a commercial activity and making profits,…
A: Answer : a) Name of the Business : Chocolate Desires and Location : Ghana b) Manfucturing of…
Q: 1. Write a program in Java that should do the following: a. Prompt the user to enter 3 grades…
A: logic:- multiply any of integer by 1.0 so that average method returns double value . read a, b…
Q: The initial value of the radius of a circle is equal to one unit and each succeeding radius is one…
A: Algorithm: Step.1- Start Step.2- Take a double variable R for radius and initialize with 1.0 Step.3-…
Q: 2. Based on Figure below: a) What is the output for the following segment of code in Figure 1?…
A: Java is an object Oriented programming language.
Q: Supposing you have set up a business that is carrying out a commercial activity and making profits,…
A: I have implemented the given requirements in Java as per the specification. The code is as follows:…
Q: (Java) In which of these cases would it be good to use an enum ? Group of answer choices 1. You…
A: You should always use enums when a variable (especially a method parameter) can only take one out of…
Q: Program below repeatedly accept real numbers until zero is entered. The output of the program is the…
A: Here is the complete java code of above problem. See below step.
Q: powers of the variable. The Maclaurin series expansion for sin(x) is given by the following formula…
A: import java.util.Scanner; public class Introduction{ //Factorial function to find factorial of…
Q: ram Năme ge.java Voltage.dat er asked you to write a program that will solve Voltage problems, using…
A: Code: import java.io.File;import java.io.IOException;import java.util.Scanner; public class…
Q: Create a java class named Shipment a. The program must ask for two separate packages to ship b.…
A: Java: Java is a high level, object oriented programming language. It was developed by James Gosling…
Q: This assignment requires FIVE separate Java programs in ONE project. Use descriptive variable names…
A: SOURCE CODE public class Program1{ public static void main(String[] args) { // Numbers without…
Q: Please help me write a tic tac toe game using java. Please put graphics, a 8x8 grid, a score board,…
A: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import…
Q: Q1: Can you read this question carefully rebug and type the answers Debug Problem 1: As an intern…
A: Dear learner, Hope you are doing well !, I will try my best to answer this question. Thank You!!
Q: (JAVA)Determine the output of the following code. You must show the values of the variables as you…
A: The initial value of result is 0. The for loop will run from x=0 to 8. That is, it will run for 9…
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 = _______________________
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- JAVA CODE PLEASE Functions With No Parameters but With Return Values Practice II by CodeChum Admin Create a function named askInput that asks the user an integer input if called. The function will return the string “Even” if the integer is even, and “Odd” if otherwise. In the main function, call the askInput function and store the returned value in a variable then print it in a newline. Input 1. One line containing an integer Output Enter·a·number:·10 EvenJava 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 Reset
- Apply the Java concepts that you learned (OOP, polymorphism, interfaces, packaging, …), SOLID design principles as well as Design Patterns to design/extend a Parking Garage applicationand implement it using the java programming language. This application manages a parking spacefor a configurable maximum number of vehicles. The designed application must handle the following functions: ● Each garage slot has a width and depth that describes the slot dimensions as well as slot hourly cost.● The garage consists of a configurable maximum number of slots as well as a global slot selection algorithm i.e. First Fit or Best Fit where○ First Fit selection where the first slot with big enough dimension to host the vehicle will be selected○ Best Fit selection where the slot with the best dimension match should be used where the wasting area of the slot is minimized. ● Each vehicle shall be identified by a model name, unique identification number, owner mobile number, Model year and vehicle…while (*psz_2 != 0) {;u8_c = *psz_2;;if (u8_c > 0x2F) {;*psz_1 = u8_c | 0x20;;} else {;*psz_1 = u8_c;;}// java // book is starting out with java //chapter 12 (5)Theater RevenueA movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie company. Create a GUI application that allows the user to enterthe following data into text fields:• Price per adult ticket• Number of adult tickets sold• Price per child ticket• Number of child tickets soldThe application should calculate and display the following data for one night’s box officebusiness at a theater:• Gross revenue for adult tickets sold. This is the amount of money taken in for all adulttickets sold.• Net revenue for adult tickets sold. This is the amount of money from adult ticket salesleft over after the payment to the movie company has been deducted.• Gross revenue for child tickets sold. This is the amount of money taken in for all childtickets sold.• Net revenue for child tickets sold. This is the amount of money from child ticket salesleft over after the payment to the movie…
- f on ㄱ Write a Java class called PyramidVolume that reads from the user 2 integers represent area of the base (B) and the height of a pyramid (h). Then calculates and prints the volume of this pyramid (rounded to 1 decimal place) according to the following formula: volume = (1/3) h B Note: If the user enters any non-positive value (i.e. less than or equal to zero), an error message should be displayed and nothing should be calculated. EFEE Paragraph O B I ][ 101°F 4 4:00 PM 4/28/2022Java Program Mall Parking System Westfield Shopping Mall is having a common two-wheeler parking stand in its basement. This parking facility is utilized by many of their customers regularly and they charge it for 10 Rupees per hour as parking fee. To make this facility more comfortable, they wish to automate the parking fee calculation based on the In-time and Out-time of a vehicle. For each vehicle entry, they will give a token which has the current date and time printed as In-time. The Out-time of each vehicle will the greater than the In-time. Help them to calculate the total Parking Fee by getting the In-time and Out-time as inputs. Note: The input In-time, must be in dd/MM/yyyy HH:mm format and must be lesser than the current system time for at-least 1 Minute. Otherwise, print “<In-Time> is an Invalid In-Time” and terminate. The input Out-time, must be in dd/MM/yyyy HH:mm format and must be greater than the In-time for at-least 1 Minute. Otherwise, print…JAVA CODE a vending machine that accepts n number of products entered by the user and n number of coins of any type. The vending machine will return change and say how much balance the user has, it should show the available products and ask the user if they want to insert more money or not, if they want to buy another product or not and if they want to leave or continue shopping
- If int a=5, b=10; (a). what is the value of c= a+++b--; Ans: _____________________ (b). what are the values of a and b respectively after the statement in (a) is executed? Ans: _____________________JAVA PROGRAM Chapter 5. PC #2. Retail Price Calculator (page 312) Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It should then display the item’s retail price. For example: • If an item’s wholesale cost is 5.00 and its markup percentage is 100 percent, then the item’s retail price is 10.00. • If an item’s wholesale cost is 5.00 and its markup percentage is 50 percent, then the item’s retail price is 7.50. The program should have a method named calculateRetail that receives the wholesale cost and the markup percentage as arguments, and returns the retail price of the item. Class name: RetailPriceCalculator PLEASE MODIFY THIS JAVA PROGRAM SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASE. RIGHT NOW IT SAYS 0 OUT 5 PASSED. THE PROGRAM IS NOT WORKING IN HYPERGRADE FIX IT SO IT WILL WORK IN HYPERGRADE. THANK YOU. import java.util.Scanner;public class Main { public static double calculateRetail(double…Java Program Chapter 5. PC #2. Retail Price Calculator (page 312) Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It should then display the item’s retail price. For example: • If an item’s wholesale cost is 5.00 and its markup percentage is 100 percent, then the item’s retail price is 10.00. • If an item’s wholesale cost is 5.00 and its markup percentage is 50 percent, then the item’s retail price is 7.50. The program should have a method named calculateRetail that receives the wholesale cost and the markup percentage as arguments, and returns the retail price of the item. Class name: RetailPriceCalculator