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
in java eclipse ide
- Read from console a 3-digit integer Write code to sum digits in this number. For example, if the input is 345, the sum will be 12 (=3 + 4 + 5), display the original number and the sum value.
(Clue: extract 3 digits from this number, add these digits to get sum)
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 3 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
- Java Programming: Write a command line game that plays a simple version of blackjack. The program should generate random numbers between 1 and 10 each time the player gets a card. It should keep a running total of the players cards, and ask the player whether or not it should deal another card. Sample output for the game is written below. Your program should produce the same output. The players get two cards to start with. Then they are asked if they want more cards. Players can continue to take as many cards as they like. The goal is to get close to 21 without going over. If the total is greater than 21 we say the player "busted".arrow_forwardJava Programming: Write a program that reads five integer values from the user, then analyzes them as if they were a hand of cards. When your program runs it might look like this (user input is in orange for clarity): Enter five numeric cards, no face cards. Use 2 - 9. Card 1: 8 Card 2: 7 Card 3: 8 Card 4: 2 Card 5: 9 Pair! (This is a pair, since there are two eights). You are only required to find the hands Pair and Straight.arrow_forwardIn PYTHON use a Monte Carlo Simulation to write a code that gives the probability that in a classroom of x people, at least 2 will be born on the same day of the year, ignoring leap year? The number of people in the class is given by the user as variable x. Here is the code outline that is needed to answer this question. Please use it in your answer: import mathimport random # create and initialize frequency table:ft = []k = 0while(k < 365) : ft.append(0) k = k+1 # Allow the user to determine class size:print("Please type in how many people are in the class: ")x= int(input()) success = 0 # Simulate:c = 0while(c < 10000) : # Step 1: re-initialize birthday frequency table (it must be re-initialized for each play-through (why?): k = 0 while(k < 365) : ft[k] = 0 k = k+1 # Step 2: randomly get x birthdays and update frequency table: k = 0 while(k < x): # your code goes here ########################## k = k+1 # Step 3: Check to see if this…arrow_forward
- PrimeAA.java Write a program that will tell a user if their number is prime or not. Your code will need to run in a loop (possibly many loops) so that the user can continue to check numbers. A prime is a number that is only divisible by itself and the number 1. This means your code should loop through each value between 1 and the number entered to see if it’s a divisor. If you only check for a small handful of numbers (such as 2, 3, and 5), you will lose most of the credit for this project. Include a try/catch to catch input mismatches and include a custom exception to catch negative values. If the user enters 0, the program should end. Not only will you tell the user if their number is prime or not, you must also print the divisors to the screen (if they exist) on the same line as shown below AND give a count of how many divisors there are. See examples below. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output…arrow_forwardX609: Magic Date A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures out if a user entered date is a magic date. The dates must be between 1 - 31, inclusive and the months between 1 - 12, inclusive. Let the user know whether they entered a magic date. If the input parameters are not valid, return false. Examples: magicDate(6, 10, 60) -> true magicDate(50, 12, 600) –> falsearrow_forwardA dual-tone multi-frequency (DTMF) system is used to produce signals that represent the dialed digits in a telephone system. A combination of a horizontal frequency and a vertical frequency is produced whenever a button is pressed on the keypad. The figure below shows a telephone keypad and the different frequencies used. 697 Hz 770 Hz 852 Hz 941 Hz 1209 Hz 1 4 7 1336 Hz 2 1477 Hz 3 5 6 8 9 # 0 * Generate the DTMF tone decoder that will take an audio file the DTMF signal of your student number. The student number must be presented as one complete string (e.g. 2020123456)arrow_forward
- In C# code: Write a program that will help an elementary schoolstudent learn multiplication. Use a Random object to produce two positive one-digitintegers. The program should then prompt the user with a question, such asHow much is 6 times 7 The student then inputs the answer. Next, the program checks the student’s answer. Ifit’s correct, display the message "Very good!" and ask another multiplication question.If the answer is wrong, display the message "No. Please try again." and let the studenttry the same question repeatedly until the student gets it right. A separate methodshould be used to generate each new question. This method should be called oncewhen the app begins execution and each time the user answers the question correctly.Program will stop any time students enter -1. One problem in CAI environments is student fatigue. This can be reduced by varyingthe computer’s responses to hold the student’s attention. The program should usevarious comments to be displayed for each…arrow_forwardYou have been hired by a local organic sod company to write coverage calculator for their website. Organic sod is cut into rectangles 9 square foot in area for lawn installation. Your program will prompt the customer for the length and the width of a rectangular area being covered with sod. Implement the following "pseudocode" to obtain the number of pieces to order. • Compute the area of the rectangle to be covered • Divide the area by 9 • Convert the result to an integer and then add 1 Below is a sample run with Python output in blue and user input in black. Enter length:200 Enter width:40 You should order 889 pieces.arrow_forwardWhile Loop (PLEASE COMPLETE IN JAVA)Instructions Write a program that finds out the perimeter of a multi-sided shape. Perimeter of a multi-sided shape can be found by adding all of the sides together.The user should enter each number at the command prompt. The user will indicate that he or she isfinished entering the number by entering the number -1.Example:This program will sum a series of numbers.Enter the next number (enter -1 when finished)> 2Enter the next number (enter -1 when finished)> 2Enter the next number (enter -1 when finished)> 1Enter the next number (enter -1 when finished)> 1Enter the next number (enter -1 when finished)> -1The sum of your numbers is 6arrow_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