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
- Athough third multiple choice is longer but still it is a single question 1.) How many times will the following code print "Welcome to Java"? int count = 0; while (count < 10) { System.out.println("Welcome to Java"); Count--; } a. 8 b. 9 c. 10 d. infinity 2.) What will be displayed when the following code is executed? int number = 6; while (number > 0) { number -= 3; System.out.print(number + " "); } a. 6 3 0 b. 6 3 c. 3 0 d. 3 0 -3 e. 0 -3 3.) Which of the following loops correctly computes 1/2 + 2/3 + 3/4 + ... + 99/100? A: double sum = 0; for (int i = 1; i <= 99; i++) { sum = i / (i + 1); } System.out.println("Sum is " + sum); B: double sum = 0; for (int i = 1; i < 99; i++) { sum += i / (i + 1); } System.out.println("Sum is " + sum); C: double sum = 0; for (int i = 1; i <= 99; i++) { sum += 1.0 * i / (i + 1); } System.out.println("Sum is " + sum); D: double sum = 0; for (int i = 1; i <= 99; i++) { sum += i / (i + 1.0); }…Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you Part 1. Given the following code. What will the output be? Date dt = new Date();long c = dt.getTime(); A. The word NULLB. Current date and timeC. Seconds since 1/1/1970D. Current dateE. Milliseconds since 1/1/1970 Part 2. Which is an acceptable instantiation of the java.util.Calendar class? A. Calendar cal = new Calendar();B. Calendar cal = new getInstance();C. Calendar cal = Calendar.getInstance();D. Calendar cal = Calendar.Calendar();E. Calendar cal = new Calendar.Calendar();Im trying to write a JAVA program that will allow me to input movies.csv and ouput "Wonders of the World | G | 16:40 20:00 End of the Universe | NC-17 | 19:00 Buffalo Bill And The Indians or Sitting Bull | PG | 12:45 15:00 19:30 Adventure of Lewis and Clark | PG-13 | 10:00 14:30 Halloween | R | 19:00". I need help with my code, this is what it looks like now, please let me know how to fix it. import java.io.File;import java.io.FileNotFoundException;import java.util.LinkedHashSet;import java.util.LinkedList;import java.util.Scanner; public class LabProgram { public static void main(String[] args) {// Create LinkedListLinkedList<String> movies = new LinkedList<>();// Create HashSetLinkedHashSet<String> moviesTitle = new LinkedHashSet<>();// read file name from userScanner input = new Scanner(System.in);String fileName = input.next();try {// create an object of ScannerScanner file = new Scanner(new File("movies.csv"));// iterate each line in the filewhile…
- Please code in java and follow the instructions as it is.. Dont use very advanced methods. refer the images provided Hired by the popular nightclub, 'Club B-day' to automate the job of their bouncers. ClubB-day has a novel criterion for entering, where it must be that person's birthday. Additionallystate law stipulates that a patron must also be aged 21 or over to enter the premises since alcoholis served. Your robot must determine whether a person can enter the club given the followingconditions:● Is today their birthday?● Are they 21 years or older?InputYour solution must take in a total of six numerical inputs with each input separated by a space.The first three inputs represent the current month, current day, current year as integers. Theother three inputs represent the birth month, birthday, birth year as integers.OutputThe output should display as a boolean result whether the patron can enter or not.Please explain how the Java code is done File IO ApplicationA shop collects the following information from its customers:1. Full name (first name, last name, and optional middle initial) 2. Address (street name and number, city, zip code, and state)3. Phone number 4. Email 5. First visit/service date6. Most recent visit/service date7. Total amount charged8. Current balance and description of the last service You are to write a program that allow the shop to manage their customers. The shop needs the following functionalities:1. Search for a customer by:a. Nameb. Phone numberc. Email (The result of the search would have similar option as in the “List all customers” option below)2. List all customersa. Select and edit a customer b. Delete a customer3. Add a new customera. Prompt for appropriate data fields4. Get account consolidation sheet that shows total charges and total balance of all customers5. Get the records of the biggest 5 spenders (spend the most)6. Exit and save all changes…Java jframe 6 Cell Phone PackagesCell Solutions, a cell phone provider, sells the following packages:300 minutes per month: $45.00 per month800 minutes per month: $65.00 per month1500 minutes per month: $99.00 per monthThe provider sells the following phones (a 6 percent sales tax applies to the sale of a phone):Model 100: $29.95Model 110: $49.95Model 200: $99.95Customers may also select the following options:Voice mail: $5.00 per monthText messaging: $10.00 per monthWrite an application that displays a menu system. The menu system should allow the userto select one package, one phone, and any of the options desired. As the user selects itemsfrom the menu, the application should show the prices of the items selected
- Hello, I need to make an original code that's completely new but I don’t understand this Java Question may someone help me out, may you also submit the completed code typed out the code in text form please instead of a screenshot of a screenshot ?Create a JAVA program that will compute the following: a. Area of square = side2 0 b. Area of a rectangle = length x breadth c. Diameter of a circle = radius x The menu should be similar to this: Calculate the area of: ---------------------------- 1. Square 2. Rectangle 3. Circle • Each computation must be inside a method. Please provide a screenshot of code and output. ASAP Thanks!!Write a Java® application, using NetBeans IDE, that calculates the total annual compensation of a salesperson. Consider the following: A salesperson will earn a fixed salary of $30,000. A salesperson will also receive a commission as a sales incentive. The commission is a percentage of the salesperson's annual sales. The current commission is 7% of total sales. The total annual compensation is the fixed salary plus the commission earned. The Java® application should meet the following technical requirements: The application should have at least one class, in addition to the application's controlling class. (A controlling class is where the main function resides). A file needs to be created to contain the output. There should be proper documentation in the source code. The application should ask the user to enter annual sales, and it should display the total annual compensation.
- using jgrasp please write the following JAVA code with the following directions, there's an example for your reference as well The total number of apples grown in the last 8 years is 68,700.0The average number of apples grown in the last8 years is 8,587.5The year with the largest number of apples grown is 2019 with 11, 000.0 applesgrown.The year with the smallest number of apples grown in 2015 with 5,300.0 applesgrown.Mark Daniels is a carpenter who creates personalized house signs. He wants an application to compute the price of any sign a customer orders, based on the following factors: The minimum charge for all signs is R30. The first six letters or numbers are included in the minimum charge; there is a R7 charge for each additional character. White characters are included in the minimum charge. A sign with “black” characters; an additional R10 is included and an additional R12 charge for “gold” characters.APM11A1 - Advanced ProgrammingThe program must prompt the user for the characters or digits and the color of the characters. The house sign may consist of two or more words. Display the final price of the design as shown in Figure 1. The program must iterate until the user enter END. the question shoulb be answered in c++JAVA PROGRAM ASAP This program down below once uploaded to hypergrade keeps failing the test cases over and over again. Please modify this program even more please ASAP BECAUSE the program down below does not pass all the test cases when I upload it to hypergrade. *****************The program must pass the test case when uploaded to Hypergrade.********************** Chapter 9. PC #16. Morse Code Converter Morse code is a code where each letter of the English alphabet, each digit, and various punctuation characters are represented by a series of dots and dashes. Write a program that asks the user to enter a string, and then converts that string to Morse code and prints on the screen. Use hyphens for dashes and periods for dots. The Morse code table is given in a text file morse.txt. When printing morse code, display eight codes on each line except the last line. Codes should be separated from each other with one space. There should be no extra spaces at the beginning and at the…