![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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
Java
Your job is to write a program called BasicIO that will perform simple input/output and math operations. Complete your program by following the steps below.
![Step 2
Once you have Step 1 working properly, extend your program's capability by adding several lines that prompt the user for a second number
and then prints the sum and product of the two numbers that were entered as shown in the sample below.
Sample run
Input:
4
6
Run:
Enter an integer: 4
The triple of 4 is 12
The square of 4 is 16
Voila!
Enter another integer: 6
is 10
(4 + 6)
(4 *
6) is .
That is all!
When you work in Develop mode, remember to place 4 and 6 in separate lines under Enter program input (optional).
Notes
Make sure to use a println Statement to print the last line of the output.](https://content.bartleby.com/qna-images/question/fba66248-862a-43fb-91b6-16cc301cecb0/b8b8de24-3918-4178-9fc1-ee6364577459/y9so7qh_thumbnail.png)
Transcribed Image Text:Step 2
Once you have Step 1 working properly, extend your program's capability by adding several lines that prompt the user for a second number
and then prints the sum and product of the two numbers that were entered as shown in the sample below.
Sample run
Input:
4
6
Run:
Enter an integer: 4
The triple of 4 is 12
The square of 4 is 16
Voila!
Enter another integer: 6
is 10
(4 + 6)
(4 *
6) is .
That is all!
When you work in Develop mode, remember to place 4 and 6 in separate lines under Enter program input (optional).
Notes
Make sure to use a println Statement to print the last line of the output.
![Step 1
First, prompt the user to enter an integer value as shown below. Be sure you clearly understand which part of the sample run below is
generated by the computer versus which is just input typed in the by the user. Your program should then print the value tripled as well as
the value squared as shown below. You can simply compute the square by multiplying the value input by itself.
Sample run
Input:
4
Run:
The triple of 4 is 12
The square of 4 is 16
Voila!
When you work in Develop mode, remember to place 4 under Enter program input (optional). Since the output will not contain the user
input part of the run (i.e., the user typing 4 and pressing the Enter key), the result of the execution of the program should look like the
following:
Enter an integer: The triple of 4 is 12
The square of 4 is 16
Voila!](https://content.bartleby.com/qna-images/question/fba66248-862a-43fb-91b6-16cc301cecb0/b8b8de24-3918-4178-9fc1-ee6364577459/bfd9w1_thumbnail.png)
Transcribed Image Text:Step 1
First, prompt the user to enter an integer value as shown below. Be sure you clearly understand which part of the sample run below is
generated by the computer versus which is just input typed in the by the user. Your program should then print the value tripled as well as
the value squared as shown below. You can simply compute the square by multiplying the value input by itself.
Sample run
Input:
4
Run:
The triple of 4 is 12
The square of 4 is 16
Voila!
When you work in Develop mode, remember to place 4 under Enter program input (optional). Since the output will not contain the user
input part of the run (i.e., the user typing 4 and pressing the Enter key), the result of the execution of the program should look like the
following:
Enter an integer: The triple of 4 is 12
The square of 4 is 16
Voila!
Expert Solution
![Check Mark](/static/check-mark.png)
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 2 steps with 1 images
![Blurred answer](/static/blurred-answer.jpg)
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
- Assignment-3 Java Programming: 1. Write a program to input a positive integer and print whether the number is a power of 3 or not.arrow_forwardpython multiple choice Code Example 4-1 def get_username(first, last): s = first + "." + last return s.lower() def main(): first_name = input("Enter your first name: ") last_name = input("Enter your last name: ") username = get_username(first_name, last_name) print("Your username is: " + username) main() 5. Refer to Code Example 4-1: What is the scope of the variable named s ?a. globalb. localc. global in main() but local in get_username()d. local in main() but global in get_username()arrow_forwardCSCI 140/L Java Project: Menu-Driven System Part A Write a menu-driven program that will give the user the three choices: 1) Wage calculator, 2) Coupon Calculator, and 3) Exit. Class Name: PartA Wage Calculator: For the wage calculator, prompt for the name and hourly pay rate of an employee. Here the hourly pay rate is a floating-point number, such as $9.25. Then ask how many hours the employee worked in the past week. Be sure to accept fractional hours. Compute the pay. Any overtime work (over 40 hours per week) is paid at 150 percent of the regular wage (1.5 the hourly pay rate). Print the employee's name, regular hours worked, regular hours pay, overtime hours worked (do not show overtime hours, if there are none), overtime hours pay (do not show overtime pay if there is none), and total pay. [Do not prompt for overtime hours] Coupon Calculator: For the coupon calculator, the total coupon amount is calculated based on the type of items purchased. Ask for the shopper's total purchase…arrow_forward
- Java - Smallest Numberarrow_forward// This program assigns values to two variables // and performs mathematical operations with them public class DebugFour1 { public static void main(String args[]) { int x = 5; int y = 8; int z = 19; System.out.println("adding " + x + y); System.out.println("subtracting " + y - z); System.out.println("dividing " + z / x); System.out.println("multiplying " + x / z); } }arrow_forwardPlease help me with this question below using javaarrow_forward
- Java Programming: The program will figure out a number chosen by a user. Ask user to think of a number from 1 to 100. The program will make guesses and the user will tell the program to guess higher (h) or lower (l). Sample run of the program might look like below : Guess a number from 1 to 100. (here, the user is thinking of 81) Is it 50? (h/l/c): h Is it 75? (h/l/c): h Is it 88? (h/l/c): l Is it 81? (h/l/c): c Great! Do you want to play again? (y/n): y Guess a number from 1 to 100. (here the user is thinking 37) Is it 50? (h/l/c): l Is it 25? (h/l/c): h Is it 37? (h/l/c): c Great! Do you want to play again? (y/n): n our program should implement the binary search algorithm. Every time the program makes a guess it should guess the midpoint of the remaining possible values. Consider the first example above, in which the user has chosen the number 81: On the first guess, the possible values are 1 to 100. The midpoint is 50. The user responds by saying “higher” On the second…arrow_forwardA company has 5 stores {1, 2, 3, 4, 5}. The sales for each store is as follows: {200, 300, 400, 500, 600}. The tax rate is 6% Write a java program that: 1) Calculates the sales tax for each store and the total sales tax for the company.arrow_forwardOne of the benefits of computers is that they can be programmed to do a specific task. Which of the following statements is correct?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
![Text book image](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education