Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
IS THERE AN IMPORT.JAVA."SOMETHING" for /= or /+ ++ that works for java besides math for math, like would random work?
Like import.java.util.Random
or someting?
thank you
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- I got another question. What would you do for this?arrow_forwardWrite the code in java and dont use AI please and dont copy from other soures and write it in simple and follow what in the question saysarrow_forwardInstead of receiving references, Java's method parameters get values as their input. In what specific ways does this manifest itself?arrow_forward
- Please write a Java program with at least two classes. Use a circle to represent it! The class should have at least one non-static setter method and one non-static getter. Implement at least one method test that invokes the setter method and the corresponding getter method so that the value out == the value in!arrow_forwardPlease, I want to complete the requirements in this code according to the question import java.util.Random; import java.util.Scanner;public class Hangman { static String generateAsteriskString(int n) { String s = ""; for (int i = 0; i < n; i++) { s += "*"; } return s; } static String replace(String secret, String hidden, char c) { String s = ""; for (int i = 0; i < secret.length(); i++) { if (secret.charAt(i) == c) { s += c; } else { s += hidden.charAt(i); } } return s;} public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String[] words = { "write", "that", "program", "java", "friend", "cool" }; Random random = new Random(); int MAX_ATTEMPTS = 8; String ch = "y"; while (ch.equalsIgnoreCase("y")) { String secretword =…arrow_forwardWhats the diff between return & system.out.print in java?arrow_forward
- Implement the Board class. Make sure to read through those comments so that you know what is required. import java.util.Arrays; import java.util.Random; public class Board { // You don't have to use these constants, but they do make your code easier to read public static final byte UR = 0; public static final byte R = 1; public static final byte DR = 2; public static final byte DL = 3; public static final byte L = 4; public static final byte UL = 5; // You need a random number generator in order to make random moves. Use rand below private static final Random rand = new Random(); private byte[][] board; /** * Construct a puzzle board by beginning with a solved board and then * making a number of random moves. Note that making random moves * could result in the board being solved. * * @param moves the number of moves to make when generating the board. */ public Board(int moves) { // TODO } /** * Construct a puzzle board using a 2D array of bytes to indicate the contents *…arrow_forwardTHIS IS MEANT TO BE IN JAVA. What we've learned so far is variables, loops, and we just started learning some array today. The assignment is to get an integer from input, and output that integer squared, ending with newline. But i've been given some instructions that are kind of confusing to me. Please explain why and please show what the end result is. Here are some extra things i've been told to do with the small amount of code i've already written... Type 2 in the input box, then run the program so I can note that the answer is 4 Type 3 in the input box instead, run, and note the output is 6. Change the output statement to output a newline: System.out.println(userNumSquared);. Type 2 in the input box Change the program to use * rather than +, and try running with input 2 (output is 4) and 3 (output is now 9, not 6 as before). This is what I have so far... import java.util.Scanner; public class NumSquared {public static void main(String[] args) {Scanner scnr = new…arrow_forwardWhat are some of the benefits of using an ADT bag in Java? Provide an example that illustrates when using a bag would be useful. In your answer, specifically think of and give a real-life scenario where: The Bag ADT can be useful Using Bag ADT is better than the alternatives Please and thank youarrow_forward
- Why does the Number Class from this slide need to be abstract?arrow_forwardThis is my program. I need help with the math. import java.util.*;import javax.swing.JOptionPane;public class Craps { public static void main(String[] args) { int Bet, Die; int WinC = 0, LossC = 0, GameC = 0, GameN = 1; double startingBal = 0, curBal = 0; double balD, balDe, balDec, balI, balIn, balInc; char Answer = '\0'; Scanner crapsGame = new Scanner(System.in); System.out.println("Welcome to the Craps Game"); curBal = StartingBal(startingBal); System.out.println("Your starting balance is: $" + curBal); do { System.out.println("Please input your bet for the game>> "); Bet = crapsGame.nextInt(); System.out.println("Game #" + GameN + " Starting with bet of: $" + Bet ); if (Bet < 1 || Bet > curBal) { System.out.println("Invalid bet – Your balance is only: $" + curBal); while (Bet < 1 || Bet > curBal)…arrow_forwardhint for the java assignment below: First line of your program: import java.util.Scanner; To use math symbols: π : Math.PI en : Math.pow(Math.E,n) To read input from the keyboard: Scanner userInput = new Scanner(System.in); x = userInput.nextInt(); To write to the console: System.out.println(x); System.out.println(“something to print”);arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education