
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
Write a simple programming solution that will get a value from the user and will return a result that is based on user input.
Get some integer (whole number) value from the user.
Ask them for the amount of US Dollars they want to exchange for Euros.
For simplicity, use a conversion formula of 1 US Dollar is 0.96 Euros.
So: euros = dollars * 0.96
Write an "if" statement that will give one of two different outputs.
If it is greater than or equal to 1,000 dollars, tell the user that "____ dollars is a lot of money to exchange. $____ US will be € ____ ."
If it is less than 1000 dollars tell the user: " $____ US is € ____. Have a nice day."
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 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
- Write a program using integers userNum and x as input, and output userNum divided by x four times. Ex: If the input is: 2000 2 the output is: 1000 500 250 125 Note: In Coral, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discarded). 333666.1636490.qx3zqy7arrow_forwardWrite a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. End with a newline. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.arrow_forwardWrite a program that prompts for an odd integer that is between 50 and 100, inclusive. Use just one if expression with logical operators to test the input. Reply positively or negatively as appropriate.arrow_forward
- Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. For division, if the denominator is zero, output an appropriate message. Limit the supported operations to + -/ *and write an error message if the operator is not one of the supported operations. Here is some example output: 3 + 4 = 7 13 * 5 = 65 C++arrow_forwardThis is the formula for the standard normal deviate, z, used in statistical applications: z = (X- H)lo X is a single value. p refers to an average value. oOrefers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X = 85.3, µ = 80, and o0= 4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items.arrow_forwardWrite a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Additionally, output the distance between the starting and ending numbers (ex: 93 - 88 = 5) Note: End with a newline. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 5 Ex: If the input is: 11 the output is: 11 0 Ex: If the input is: 9 or any value not between 11 and 100 (inclusive), the output is: Input must be 11-100 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, …, 99), as that approach would be cumbersome for larger ranges. Hint: To practice incremental development, start by writing code that just outputs the countdown until matching digits and submit to get most of the points. Then, update your code to output the distance.arrow_forward
- Write a program that outputs all the integers between 100 and 1000 (inclusive), that are divisible by 5 and also 6. (This means start at 100 and go up to 1000, but only output integers that are divisible by both 5 and 6.) Remember what "divisible" means - if a number is divisible by 5, there is no remainder when you divide it by 5. If a number is divisible by 6, there is no remainder when you divide it by 6. In javaarrow_forwardWrite a simple programming solution that will get a value from the user and will return a result that is based on user input. Get some integer (whole number) value from the user. Ask them for the amount of US Dollars they want to exchange for Euros. For simplicity, use a conversion formula of 1 US Dollar is 0.96 Euros. So: euros = dollars * 0.96 Write an "if" statement that will give one of two different outputs. If it is greater than or equal to 1,000 dollars, tell the user that "____ dollars is a lot of money to exchange. $____ US will be € ____ ." If it is less than 1000 dollars tell the user: " $____ US is € ____. Have a nice day."arrow_forwardWrite a program that will prompt the user for a lengh in inches and convert the input into a readable output in feet and inches. This lab is split into parts. Students must do them in order, otherwise the answer will not be correct. Use an integer variable to save the number of inches entered by the user. Part I: Enter the input and do the simple conversion. Enter the number of inches: Example: If the input is: 55 the output should be: 4'7 Part II: Let's add something else to the output to make it even more readable. After the user enters the number of inches and the program converts it to feet and inches add a second line with the more formal information: Ex: If the input is: 55 the output should be: 4'7 4 feet and 7 inchesarrow_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