
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
Concept explainers
Question
thumb_up100%
please give me code and output with following direction. thanks!
![Here you need to use the Random class (you can get it from java.util.Random)
Generate a class called SquareRoot and create a main method in this class. Inside
the main method follows these steps:
1.Generate a Random variable named rande
2. Generates a random whole number between 1_000_000_000_000_000 (15 zeros;
inclusive) and 1_000_000_000_000_300 (inclusive) using the Random object
passed into the method and we store it in a variable called bigRandNum. Tip: think
what data type you need Store a value of this size.
3. print out "The value is : [value]". Where replace the [value] with bigRandNum
here.
4. Use a while loop to print out the square root of bigRandNum and then the square
root of its result. The result continues as follows until the result reaches the value of
1.e
5. Determine the number of iterations of the while loop to reduce this number to 1.“
When the while loop is finished executing, it print out "Count: [count]" (including
the actual count by replacing the bracketed section).](https://content.bartleby.com/qna-images/question/806afc34-6e3d-4cbd-ab4a-52a9727966de/9abb82b7-c4d2-4de7-b701-246e0a0edabf/e2je1j1_thumbnail.png)
Transcribed Image Text:Here you need to use the Random class (you can get it from java.util.Random)
Generate a class called SquareRoot and create a main method in this class. Inside
the main method follows these steps:
1.Generate a Random variable named rande
2. Generates a random whole number between 1_000_000_000_000_000 (15 zeros;
inclusive) and 1_000_000_000_000_300 (inclusive) using the Random object
passed into the method and we store it in a variable called bigRandNum. Tip: think
what data type you need Store a value of this size.
3. print out "The value is : [value]". Where replace the [value] with bigRandNum
here.
4. Use a while loop to print out the square root of bigRandNum and then the square
root of its result. The result continues as follows until the result reaches the value of
1.e
5. Determine the number of iterations of the while loop to reduce this number to 1.“
When the while loop is finished executing, it print out "Count: [count]" (including
the actual count by replacing the bracketed section).
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

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 have most of the code done just need help in that one area that says ":::::: Need help here". Thank you!Please complete the following function printBox, which accepts three parameters (i.e., char c, int length, int width), and must print a box (using the char c received) of length by width. For example, the output of printBox('&', 4, 6) ; will be as follows: &&&&&& &&&&&& &&&&&& &&&&&& void printBox(char c, int length, int width) // parameter 1: char c ( '&' for example) the char for the box // parameter 2: int length ( 4 for example) like # of rows // parameter 3: int width ( 6 for example) like # of columns // Example: c = '&' ; length = 4 ; width = 6 ; { // begin printBox( ) :::::::: Enter your code here:::::::::::::::::::: } // end printBox( ) void main( ) // To test function printBox( ) { printBox( '&', 4 , 6 ) ; } // end main( ) The…arrow_forwardHow do you do this? Make sure each step is clear and have functions. PYTHONarrow_forwardUse the text prompt below and store it in a variable (use triple quotes at the start and at the end. Replace the blanks with placeholders (variables) that you will replace with user input. Finally, ask the user one-by-one to input the value for these blanks with appropriate word. The Case of the Missing ____________ (Noun) There once was a detective named ___________ (Noun). One day, the detective's neighbor knocked on the door. "I am so ___________ (adjective), "said the neighbor. "I can't find my ___________ (noun) anywhere. I saw it before I went to club, but later it was gone!" The detective grabbed a pencil and a ___________ (noun) and asked, "Will you describe it?" "Certainly," said the neighbor. "It is ___________ (color), ___________ (adjective), and it never ___________ (verb)." The detective searched ___________(adverb) around every ___________(noun) and behind every ___________ (noun). " ___________! (Exclamation)" said the detective, "I found it! It was right here…arrow_forward
- Hello! Can you please answer the following questions? The example output is attached and the program is in Pyhton. Thank you! program5_2.pyThis program requires a main function and two custom functions about spheres. Both functions take the radius of a sphere as an argument. One function returns the surface area of the sphere. The other void function prints the volume of a sphere to three decimal places. The main function should prompt the user for the radius (as a float) and execute the custom functions. The value returned by the surface area function should be printed accurate to four decimal places. Use the math module to get the value of pi. Formulas for both the surface area and the volume of a sphere are available through an internet search. Input prompts and output should be formatted as in the example output. program5_3.pyThis program should import program5_2 as a module. The main function of program5_3 should prompt the user for the radius (as a float) and execute the…arrow_forwardWrite a function called Strange with two parameters A and B, where B has the default value of 100. The value returned from the function is A-B if A is bigger than B, but returns B-A otherwise. (Note that there will be no print statements in this function, and you will be penalized if you use them.)write this function with only the def and return statements, but no other lines of code. Do not use: value1 if condition else value2arrow_forwardHelp please.arrow_forward
- I ran the code and still got the same error. The code still needs the value head. Please fix the code and show screenshots of the correct code with the output. Make sure to use various test cases to test the code to make sure it works. Attached are images of the directions.arrow_forwardCould you please help me with this program? It has to be written in python. Please follow the instructions in the picture.arrow_forward<!--------- hi i'm having a difficult time with the challenge assignment. I'm trying to remove in the script the second and third prompts, and replace them with the first prompt that starts when the button is clicked. Programming Challenge On Your Own: 5.7 Description: Prompts user to enter as many integers as desired. The program will keep track of how many are odd and how many are even. At the end the sum and averages of all odds and evens are displayed. ------------><html> <head> <title>Odds and Evens</title> </head> <body> <div style="width: 700px; margin: auto; margin-top: 100px; border: 1px solid black; padding: 5px; background-color: #E7E7E7;"> <p style="font-weight: bold;">Lab 4b</p> <p>This program will keep track of odd and even integers entered by the user. At the end, the sum and average of the…arrow_forward
arrow_back_ios
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