Database System Concepts
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
Bartleby Related Questions Icon
Related questions
bartleby
Concept explainers
Question
********** JAVA **********
with OUTPUT
Transcribed Image Text:Exercise 2
• Write a recursive method that displays an int value
reversely on the console using the following header:
public static void reverseDisplay(int value)
For example, reverseDisplay(12345) displays 54321. Write
a test program that prompts the user to enter an integer
and displays its reversal.
• Write the code in a single .java file named Ex2Lab07.java
which should also contain the main method for testing.
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
bartleby
Step by stepSolved in 2 steps
Knowledge Booster
Background pattern image
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
- PYTHON without def function iven a file with the name textfile.txt, count and print out 1) the number of letters 2) the number of digits 3) the number of punctuations Sample Input of a quote from Harry Potter (file textfile.txt) Just because it's taken you 3 years to notice, Ron, doesn't mean no one else has spotted I'm a girl! Sample Output There are 74 letter(s), 1 digit(s), and 6 punctuation(s) in the file.arrow_forward**CODE IS IN JAVA** Modify the BarChart program from Chapter 6 Exercise 13 to accept the number of points scored by each player in a season. The bar chart displays one asterisk for each 10 points scored by a player. For example, if a player has scored 48 points, then display 4 asterisks. An example of the program is shown below: Enter points earned for the season by Art >> 10 by Bob >> 20 by Cal >> 30 by Dan >> 40 by Eli >> 50 Points for Season (each asterisk represents 10 points) Art * Bob ** Cal *** Dan **** Eli ***** The code to modify: Scanner input = new Scanner(System.in); int artPoints; int bobPoints; int calPoints; int danPoints; int eliPoints; final int AMT_EACH_ASTERISK = 10; System.out.println("Enter points earned for the season"); System.out.print(" by Art >> "); artPoints = input.nextInt(); System.out.print(" by Bob >> "); bobPoints =...arrow_forward1. Write an Algorithm, numbers using third variables.(i.e. exchange the values of two variables with each other using a third variable) to Swap two 2. Hint: The output screen should be as follow: CAUsersifaiz u hmeDocumentsicout.ee Enter value of a: 90 Enter value of bị 78 b: 90 Process exited after 5.549 seconds with return value e Press any key to continue.arrow_forward
- ; ************************************************************************************ ; Things in parentheses are explanations, NOT additional steps. ;------------------------------------------------------------------------------------- ; START YOUR CODE HERE ; The stack pointer will initially point to xFDFE ; Try drawing the below as a picture of a stack using the addresses provided. ; The steps for the main GETSP subroutine are similar to the GETS subroutine in Part 1 GETSP ; Decrement R6 by #-1 (to allocate a word to store a return value) (R6: xFDFD) ; Decrement R6 by #-1 (this moves to push R7, our return address, onto the stack) (R6: xFDFC) ; Store contents of R7 at the address of R6 + #0 (to save a copy of the return address) ; Decrement R6 by #-1 again (this action allocates space to push R5, the previous functions's frame pointer, onto the stack) (R6: xFDFB) ; Store contents of R5 at the address of R6 + #0 (store previous frame pointer)...arrow_forwarduse ibm is400 series to answer the following question (the output should shown in screenshot) 1 - develop a new Library called MnnLIB1 (NN is your student login id number) using the command CRTLIB 2 - develop a new Jobq MnnJOBQ1 and Outq MnnOUTQ1 in the Library MnnLIB1 using the command crtjobq and crtoutq 3 - Grant *PUBLIC *USE Authority to your MnnLIB1 library using the command wrkobj MnnLIB1 and then option 2 4 - Submit 3 jobs using sbmjob in your MnnJOBQ1, these jobs will not run, since they are not attached to any sub-system. Check it out by using wrkjobq command 5 - Change the 3 jobs submitted in step #4 to run in sub-system QINTER and change the out to MnnOUTQ1. These jobs will run, and the results will be in MnnOUTQ1. Check it out by using wrkoutq command 6 - develop a new Source File called MnnSRC in your library MnnLIB1 using command crtsrcpf 7 - develop a new Save File called MnnSAVF in your library MnnLIB1 using command crtsavf 8 - Run DSPJOBLOG command and save the...arrow_forward***Using Python A report could be produced by a program like this: Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 0h 1.5h 3.25h 3.0h 6.0h 1.0h 5.5h 2.25h 0.75h 2.25h 3.0h 3.0h 5.75h 2.25h 0h ---------------------------------------0.00h | 0.00h5.25h | 1.50h 3.25h 0.50h10.00h | 3.00h 6.00h 1.00h8.50h | 5.50h 2.25h 0.75h8.25h | 2.25h 3.00h 3.00h8.00h | 5.75h 2.25h0.00h | 0.00h---------------------------------------Weekly Total: 40.00h Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data types, and string formatting. For your assignment, create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a...arrow_forward
- Hospital Employee //******************************************************************** // HospitalEmployee.java Authors: Lewis/Loftus // // Solution to Programming Project 9.2 //******************************************************************** public class HospitalEmployee { protected String name; protected int number; //----------------------------------------------------------------- // Sets up this hospital employee with the specified information. //----------------------------------------------------------------- public HospitalEmployee(String empName, int empNumber) { name = empName; number = empNumber; } //----------------------------------------------------------------- // Sets the name for this employee. //----------------------------------------------------------------- public void setName(String empName) { name = empName; } //-----------------------------------------------------------------...arrow_forwardCollapse Problem #2 Complete the class Problem2, the program does the following: • The program prompts the user to enter an integer. • The program continues to prompt the user for more integers as long as the sum of all values entered is between 1 and 50. • If the sum of all values entered is NOT between 1 and 50, Java the program stops taking integers, then display the value of sum. Here are two sample outputs, your output should look exactly the same as follows: Enter an integer: 23 Enter an integer: 1 I Enter an integer: -2 Enter an integer: 19 Enter an integer: -25 Enter an integer: 4 Enter an integer: 9 Enter an integer: -20 Enter an integer: -5 Enter an integer: -12 AK -8 lacBook Airarrow_forwardForLoops.java 1 /** * Given two integers, the second larger than the first, this program: 1) prints the even numbers between the first and second number inclusive 2) prints the sum of those even numbers 3) prints the odd numbers between the first and second number inclusive 4) prints the sum of those odd numbers 3 4 6. 7 * * Example: Enter an integer: 10 Enter one larger than the first: 20 8. 9. * 10 * 11 Even numbers: 10 12 14 16 18 20 12 Sum of even numbers 90 13 Odd numbers: 11 13 15 17 19 14 Sum of odd numbers 75 %D 15 16 * This version uses FOR loops. 17 * 18 */ 19 import java.util.Scanner; public class ForLoops 21 { 20 public static void main(String[] args) { 22 23 24 Scanner in new Scanner(System.in); 25 26 System.out.print("Enter an integer: "); int firstNum = in.nextInt(); System.out. print("Enter one larger than the first: "); int secondNum = in.nextInt(); 27 28 29 30 // Complete the program } 31 32 33arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education