Write a program that asks the user to enter two doubles and prints the sum, difference,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user to enter two doubles and prints the sum, difference, product, and division of these numbers. If the second number that is entered by the user is zero, the program should print out a message that the Division can not be calculated. However, it prints the results for the other operations. Here are two examples of the execution of the program: Enter the first number: 15 Enter the second number: 4 The results are: Sum: Difference: Product: Division: ******* 19 The results are: 11 60 3.75 Enter the first number: 10 Enter the second number: 0 Sum: Difference: Product: 0 Division: can not be calculated because of the value 0 of the second number 10 10 Write a program that asks the user to enter two doubles and prints the sum, difference, product, and division of these numbers. If the second number that is entered by the user is zero, the program should print out a message that the Division can not be calculated. However, it prints the results for the other operations. Here are two examples of the execution of the program: Enter the first number: 15 Enter the second number: 4 The results are: Sum: Difference: Product: Division: ******* 19 The results are: 11 60 3.75 Enter the first number: 10 Enter the second number: 0 Sum: Difference: Product: 0 Division: can not be calculated because of the value 0 of the second number 10 10 Write a program that asks the user to enter two doubles and prints the sum, difference, product, and division of these numbers. If the second number that is entered by the user is zero, the program should print out a message that the Division can not be calculated. However, it prints the results for the other operations. Here are two examples of the execution of the program: Enter the first number: 15 Enter the second number: 4 The results are: Sum: Difference: Product: Division: ******* 19 The results are: 11 60 3.75 Enter the first number: 10 Enter the second number: 0 Sum: Difference: Product: 0 Division: can not be calculated because of the value 0 of the second number 10 10
Expert Answer:
Answer rating: 100% (QA)
It looks like youre asking for a program that allows the user to input two numbers and then calculat... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Ivanhoe Company incurred research and development costs of $ 9 0 0 0 0 to develop a patent, and legal fees of $ 3 0 0 0 0 to register the patent. The patent has a legal life of 2 0 years and a useful...
-
4. An ice hockey puck travels with a speed of 15 m/s straight towards the extended goal line when it receives a quick blow from a hockey stick. The puck weighs 160 g and receives an impulse from the...
-
Jackson Corporation has borrowed $2 million from a local bank under a long-term debt agreement whereby the loan has to be repaid in two years' time. The agreement was violated and the debt became...
-
A projectile is launched with an initial speed of v 0 at an angle above the horizontal. It lands at the same level from which it was launched. What was its average velocity between launch and...
-
Find all of the solutions in the interval 0 x < 360 of 2 tan 2 x 4 = 5 tan x giving each solution, in degrees, to one decimal place.
-
Derive the equations for the stress-strain relationship, the creep compliance, and the relaxation modulus for the Kelvin-Voigt model.
-
1. Does Steve need additional information from Iverstine and Walker? 2. What would you recommend? In 1979, Steve Blake founded Blake Electronics in Long Beach, California, to manufacture resistors,...
-
1. Mr. Alvis, the director of Match Lighting, has found himself with sorts of emails including customer complaints about incorrect order deliveries, periodic reports on products, stock, and sales,...
-
Since the Covid pandemic, UK travel agencies have experienced a huge loss of profits. For the past three years holiday makers have chosen to travel within the UK or not at all. Now that regulations...
-
Suppose a patient in a hospital was given an overdose of Ca +2 via intravenous injection: a. What would be the effect on the heart? b. Construct a treatment plan (based on the experiment) as to what...
-
Loyal customers offer multiple benefits to a healthcare organization. What are some of these benefits? How can loyalty be measured from a marketing approach? Find one example of a loyalty program in...
-
code: # -*- coding: utf-8 -*- """ Created on Fri Nov 27 18:27:23 2020 @author: willi """ import numpy as np import matplotlib.pyplot as plt from matplotlib import cm L1=4.0;L2=5.0;a=1.0; # def...
-
The number one sales and marketing problem in a "new-new" business, once its product/service is "shipping", is:* 1 point Explaining it, its value proposition, and its use cases to prospects ...
-
3. Consider the following information on a 4-sector ("private-public-open") economy, where Y stands for the GDP and Ca, lg, and Xn are respectively consumption after tax, autonomous investment and...
-
I am focusing on Henkel implemented supplier requirements . Specifically, Henkel knives & cutlery. How successful have they been implementing these requirements across its supply chain? Labor and...
-
In a simple regression model Y = 0 + 1X + , Y represents the ________ A) slope of the regression line B) independent variable C) intercept D) dependent variable
-
If 2 5 9 - k 5 8 = 2 5 8 , what is the value of k?
-
In the ice cream cone shown, L = 4 in. and e = 35°. The cone is filled with ice cream such that the portion above the cone is a hemisphere. Determine the volume of the ice cream. L
-
The vander Waals equation gives a relationship between the pressure p (atm), volume V, (L), and temperature T (K) for a real gas: p = nRT/V n2a/V2 where n is the number of moles, R = 0.08206 (L...
-
The following are formulas for calculating the training heart rate (THR) for men and women: For men (Karvonen formula): THR = [ (220-AGE)-RHR] x INTEN + RHR For women: THR = [(206-0.88xAGE)-RHR] ...
-
What is the concept behind constructing analysis pattern using analogy approach?
-
Analogy approach makes people end up building templates rather than building patterns. Explain.
-
Explain the concept behind constructing analysis pattern by using stability approach.
Study smarter with the SolutionInn App