Which expressions for YYY and ZZZ correctly output the indicated ranges? Assume int x's value will be 0 or greater. Choices are in the form YYY / ZZZ. if(YYY){ // Output "0-29" } else if (ZZZ) { // Output "30-39" } else { // Output "40+" } A. x < 29 / x >= 29 B. x < 30 / x >= 30 C. x < 30 / x < 40 D. x > 29 / x > 40
Q: This is in JAVA. If the input is 5, what is the output? intx; x = scnr.nextInt(); if (x < 10) {…
A: The correct output of the given java program is given below.
Q: Hello, I need a Java code (without using the if statement) that sum the rational numbers from the…
A: Here have to determine about java code for given problem sum rational numbers.
Q: I need help writing a Java Code. Write a program that prompts the user to enter an integer for…
A: As given, we need to write a Java code that prompts user to enter an integer for today's day of the…
Q: The volume of oil stored in an underground 200-foot-deep cylindrical tank is determined by measuring…
A: import java.util.Scanner;public class MyClass { public static void main(String args[]) {…
Q: In java (eclipse) write a program that inputs an integer. If the integer is greater than 100 or…
A: Required: write a program that inputs an integer. If the integer is greater than 100 or between 50…
Q: Write a program that calculates the estimated hours and minutes for a trip given the number of miles…
A: Given: Write a program that calculates the estimated hours and minutes for a trip given the number…
Q: An internet service provider has three different subscription packages for its customers:…
A: In this JAVA program, We have to calculate the total bill for number of hour watched and package…
Q: Write a program that keeps reading integers from the user until he enters a negative number. The…
A: import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new…
Q: The parity bit of a sequence of bits is 0 if the number of 1's in the sequence is even and 1…
A: The parity bit is an error-checking bit that is used to append to the string. For even parity, the…
Q: can you please write it in java.scanner.util form The Fast Freight Shipping Company charges the…
A: For every 500 miles the charges applies So, you can divide the distance by 500 and get the rate
Q: The equation of a straight line is written as y = mx + b where m is the slope of the line and b is…
A: The standard types of the situation of a line are: Incline catch structureBlock structureTypical…
Q: The program down below has a code for a program to play a guessing game with the user. The program…
A: Here as per your requirement of code i mentioned java code. for Random Guess create guessing game.
Q: When the program says How many integers do you have? (Max 20), ensure that only a number between 1…
A: Use an array to store the input numbers. Firstly store the elements into the array and then iterate…
Q: x is a double variable. Which of the below Java statements correctly print the integer powers of x…
A: Q1. Option (c) is correct option. To find power of x, we need to multiply with x . This makes…
Q: Write a program that declares a variable that represents the minutes worked on a and assign a value.…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: Write a program that prompts the user to enter an even integer in the twenties. Using logical…
A: The given problem is to create a program in Python language that will take on integer input from the…
Q: 1. Ask the user for two numbers,compare them and print out if the first one is greater than, less…
A: As per our company guidelines, we are supposed to answer only 3 subparts in a post and kindly…
Q: Suppose you want to deposit a certain amount of money into a savings account and then leave it alone…
A: PROGRAM: #include <bits/stdc++.h> #include <iostream> #include <stdio.h> using…
Q: Write a program that reads an integer indicating the day of the week from the user and on the next…
A: Please find the answer below :
Q: How many times will the output line be printed in the following code snippet? Please enter your…
A: How many times output line be printed. for(int j=1;j<4;j++) { for(int k=0;k<=3;k++)…
Q: We want to calculate the volume of a reservoir that has a cylindrical shape meters cube and in…
A: C++ Program for above : #include <bits/stdc++.h> using namespace std; int main() {…
Q: At a coffee shop , a coffee cost $1. Each coffee you purchase, earns one star. Seven stars earns a…
A:
Q: In this assignment, you are going to complete a program that compute gross and net payment based on…
A: code in java : ======================================================== import java.util.*;import…
Q: What is the output of the following code segment? int num= 20, y = 5, x; cin>>X; if (x >= 2*num)…
A: Code: #include <iostream>using namespace std;int main(){ int num= 20, y = 5, x;…
Q: Write a method named presentValue that performs this calculation. The method should accept the…
A: We know that the amount we get for a principal P after t years is P + PTR/100 So, according to the…
Q: Write a Java program that converts temperature from Fahrenheit to Celsius and vice versa. The…
A: The answer is as follows.
Q: Will the following boolean expression short circuit? int x = 5; int y = 6; (x ==6) || (x == 5)
A: First of all, let's know when a short circuit can happen. Where an expression is stopped when being…
Q: Output the classic (albeit slightly modified) drinking song. 99 bottles of Pepsi on the wall, 99…
A: Given: Output the classic (albeit slightly modified) drinking song. 99 bottles of Pepsi on the wall,…
Q: A patient suffering from asthma needs to keep a diary of their “peak flow" breathing readings. This…
A: Given:
Q: The areas of the following figures are computed as follows: 1. trapezoid: (h/2) (b1+b2) 2. ellipse:…
A: The different area values can be calculated using mathematical expressions. The following Math…
Q: a. What is the output of executing the following Java statements: {5 int x = 10, y = 20; boolean bl…
A: The output for the program is given below Output - The value of b3 is false The value of b4 is…
Q: Write a Python console application that prompts the user for a number. The application should return…
A: The asked code for the python program is given in the next step with explanatory comments.
Q: Write a program whose input is two integers. Output the first integer and subsequent increments of 5…
A: Please Indent the code as shown in the picture below :
Q: python code
A: Prompt the user to input a starting balance and an interest rate. Compute the balance after 10…
Q: Objective: BN booksellers has a book club that awards points to its customers based on the number of…
A: Here I have taken input from the user and then stored it in a variable. Next, I have used a switch…
Q: Write a program that keeps reading integers from the user until he enters a negative number. The…
A: According to the Question below the Solution: Output:
Q: Write a program that inputs three different integers from the keyboard, then prints the sum, the…
A: here is your code
Q: In this lab, you use the flowchart and pseudocode found in the figure below to add code to a…
A: Required Java code is provided below :
Q: Suppose that the input is 0 5 6 4 9 8 –1. What is the output of the following code? (2, 3) Submit…
A: while loop in C++ A while loop statement is used to execute a statement repeatedly as long as the…
Q: we have the java programe that calculate x,y,vy,vx every 10ms assume velocity and angle is input by…
A: time= time+ 0.01 icreases the time by 10 milliseconds And the System.out.print statements gets…
Q: The areas of the following figures are computed as follows: 1. trapezoid: (h/2) (b1+b2) 2. ellipse:…
A: Write the java program as follows: Create an int variable for choice. Create a double variable for…
Q: Write a Java program using switch case which assigns tax of 5%, 10% and 15% depending on the cost of…
A: As per the requirement program is completed. Algorithm: Step 1: Write the main() method Step 2:…
Q: int x, y, z; x-3; int a, b, z; a=l; b-4; y=7; z=9; if(x>y) if(x-y4) while (acb) { a=2*a; b=b+l;…
A: given code on c++ we need to provide the output of the codes, please see the answer in step 2. note:…
Q: Suppose that the input is 20 -16 -5 15 6 0. What is the output of the following code? int num;int…
A: PROGRAM EXPLANATION: - Initially variable num is declared, and temp variable is declared and…
Q: Your little sister asks you to help her with her multiplication, and you decide to write a Java…
A: ANSWER:-
Q: In an eye-glass shop, a customer can buy either a pair Ol Sngle prescription sunglasses. On each…
A: Since no programming language was mentioned in the question, I have solved in C language.
Q: Suppose you put $10,000 into a CDwith an annual percentage yield of 6.15%. After one month, the CD…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of the main function.…
Q: Write a JAVA program that determines the alert level for the COVID-19 based on the percentage of new…
A: Algorithm: Start Read number of new cases nCases Read number of PCR cases pcrCases Calculate…
Q: How many times will the output line be printed in the following code snippet? Please enter your…
A: For every outer loop execution inner loop executes 4 times(since k=0 to k<=3)
Q: You need to implement the Babylonian Method for computing square roots. Based on that core…
A: C++ code for Babylonian Square root method #include <iostream>using namespace std;class…
This is in JAVA.
Which expressions for YYY and ZZZ correctly output the indicated ranges? Assume int x's value will be 0 or greater. Choices are in the form YYY / ZZZ.
// Output "0-29"
}
else if (ZZZ) {
// Output "30-39"
}
else {
// Output "40+"
}
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- THIS IS IN JAVA Given x = 1, y = 2, and z = 3, how is the expression evaluated? In the choices, items in parentheses are evaluated first. <pre><code>(x == 5) || (y == 2) && (z == 5)</code></pre> A. false OR (true AND false) --> false OR false --> false B. false OR (true AND false) --> false OR true --> true C. (false OR true) AND false --> true AND false --> false D. (false OR true) AND false --> true AND false --> truejava You must print the number declared double x; on the screen. With which of the following options do you know that a number in the range -9999.99999 to 9999.99999 is printed with exactly 4 decimals and that all numbers in the number are displayed? Choose an alternative: a.System.out.format ("%. 4f", x); b.System.out.format ("% 4.1f", x); c.System.out.format ("% b", x); d.System.out.format ("% s", x); e.System.out.format ("% d", x);Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even number, display the message “Good job!” and then ask for another input. When the user types an odd number, display an error message, "x is not an even number", and then ask for another input. When the user types the sentinel value 999, end the program.
- The volume of oil stored in an underground 200-foot-deep cylindrical tank is determined by measuring thedistance from the top of the tank to the surface of the oil. Knowing this distance and the radius of the tank thevolume of oil in the tank can be determined using the formula:volume = π × radius2 × (200 − distance)Using this formula, write a JAVA program that accepts the radius and the distance measures, calculates thevolume of the oil in the tank, and displays the two input values and calculates the volume.Write a Java code that gets student exam scores from the user. Each exam score will be an integer in the range 0 to 100. Input will end when the user enters -1 as the input value. After all scores have been read, display the number of students who took the exam, the minimum score, the maximum score, the average score, and the number of As where an A is a score in the range 90-100. Make sure your average a decimal point. Only count A’s, not other grades. Note that you do not need to do any error checking on the input for this problem. This should be done as a standard sentinel-controlled while loop.Given two numbers that represent the lengths of a right triangle's legs (sides adjacent to the right angle), output the length of the third side (i.e. hypotenuse) with two digits after the decimal point. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements. Ex: If the input is: 3.0 4.0 the output is: Hypotenuse: 5.00
- USE JAVA Question/Prompt is in the picture attached, and use example outputs as a guide. second picture is the inventory used in prompt Please be precise. EXAMPLE OUTPUT 1 Welcome to the 1331 Giveaway! Would you like to take an item? [Y]es, [N]o, or [E]xitY |x|x|StuffedPython|x|CSalt||hAIrspray|x|x|x|x||x|x|x|JavaBeans|x||x|RustedMetal|SwiftShoes|x|x||FuRniture|x|x|GroovyGear|RadiantRuby| What item are you interested in taking?0 5 Location does not exist. What item are you interested in taking?0 4 You successfully took the CSalt! |x|x|StuffedPython|x|x||hAIrspray|x|x|x|x||x|x|x|JavaBeans|x||x|RustedMetal|SwiftShoes|x|x||FuRniture|x|x|GroovyGear|RadiantRuby| Would you like to take an item? [Y]es, [N]o, or [E]xitZ Please input ‘Y’, ‘N’, or ‘E’. Would you like to take an item? [Y]es, [N]o, or [E]xitEHave a good day! EXAMPLE OUTPUT 2 Welcome to the 1331 Giveaway! Would you like to take an item? [Y]es, [N]o, or [E]xitY…Do a Java program that asks the user to enter three (3) first names then display the following: All the possible two-name combinations (Ask the user to select a name by entering 1 to 6.) The initials of the chosen combined name (Ex. John Ryan = JR)Write a program that calculates the estimated hours and minutes for a trip given the number of miles traveled and the speed in miles per hour. Specifically, write a program that Welcomes the user to the Travel Time Calculator. Asks user for number of miles traveled(allow user to enter fractional values) Asks user for the speed in miles per hour (allow user to enter fractional values) Calculates the number of hours and minutes for the trip to the nearest integer value. Hint: You can use the built-in function round that rounds a given number to the rounded integer value. e.g. round(4) will return 4, round(4.125) will return 4, round(4.5) will return 4 and round (4.75) will return 5. Prints the number of hours and minutes for the trip. Here are some sample runs:
- Ask the user for a number of seconds. Display the number of minutes , seconds, and hours accordingly. 60 seconds in 1 minute 3,600 seconds in 1 hour 86,400 seconds in 1 day Please write a code in Java that results like test case examples.This is in JAVA. If the input is 5, what is the output? intx;x = scnr.nextInt();if (x < 10) {System.out.print("Live "); }else if (x < 20) {System.out.print("long ");}else if (x < 30) {System.out.print("and ");}System.out.print("prosper!"); A. Live B. Live long C. Live prosper! D. Error: The compiler will complain about a missing else statementwe have the java programe that calculate x,y,vy,vx every 10ms assume velocity and angle is input by user. -make this progrome calculate every 10ms and display output every 500ms !! final double g = 9.81;double time=0,maxHeight=0,maxTime=0 ,x,vx,y,vy;while (time >= 0){x = velocity * Math.cos((theta * Math.PI) /180) * time;vx = velocity * Math.cos((theta * Math.PI) /180);y = (velocity *Math.sin(theta * Math.PI /180) * time) - (0.5 * g * Math.pow(time, 2));vy = (velocity * Math.sin((theta * Math.PI) /180)) - (g * time);if (y < 0){break;}System.out.printf("%-10.3f %-10.2f %-10.2f %-10.2f %-10.2f",time, x, vx, y , vy);System.out.println();time =time +0.01;}