2.4.6: Add Fractions 1 public class AddFractions extends ConsoleProgram 2- { 3 4 }


use java


2.4.6: Add Fractions<br>1 public class AddFractions extends ConsoleProgram<br>2- {<br>3<br>4 }<br>

Extracted text: 2.4.6: Add Fractions 1 public class AddFractions extends ConsoleProgram 2- { 3 4 }
In this program you will ask the user for 4 integers that represent two<br>fractions.<br>First ask for the numerator of the first and then the denominator.<br>Then ask for the numerator and denominator of the second.<br>Your program should add the two fractions and print out<br>the result.<br>For example, a sample program run might look like this<br>What is the numerator of the first fraction? 1<br>What is the denominator of the first fraction? 2<br>What is the numerator of the second fraction? 2<br>What is the denominator of the second fraction? 5<br>The sum of 1/2 + 2/5 = 9/10<br>Note: you do not need to reduce these fractions.<br>Remember, if you have two fractions you add them with:<br>ad + bc<br>-<br>b.<br>d.<br>bd<br>

Extracted text: In this program you will ask the user for 4 integers that represent two fractions. First ask for the numerator of the first and then the denominator. Then ask for the numerator and denominator of the second. Your program should add the two fractions and print out the result. For example, a sample program run might look like this What is the numerator of the first fraction? 1 What is the denominator of the first fraction? 2 What is the numerator of the second fraction? 2 What is the denominator of the second fraction? 5 The sum of 1/2 + 2/5 = 9/10 Note: you do not need to reduce these fractions. Remember, if you have two fractions you add them with: ad + bc - b. d. bd

Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here