subject

Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, then the denominator. Make sure to check if the denominator is zero. If it is, print out "Error - cannot divide by zero." Hint: Since this lesson uses if-else statements, remember to use at least one if-else statement in each of your answers to receive full credit.

Sample Run 1
Numerator: 10
Denominator: 0
Sample Output 1
Error - cannot divide by zero.
Sample Run 2
Numerator: 12
Denominator: 15
Sample Output 2
Decimal: 0.8

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
Advantages and disadvantages of binary system
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
You know the right answer?
Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, t...
Questions
question
Arts, 04.03.2021 18:50
question
Mathematics, 04.03.2021 18:50