Question: Declare double variables num 1 , den 1 , num 2 , and den 2 , and read each variable from input in that order.

Declare double variables num1, den1, num2, and den2, and read each variable from input in that order. Find the sum of the fractions num1/den1 and num2/den2 and assign the result to fractionTotal.
The calculation is: sum num1/den1+ num2/den2 import java.util.Scanner;
public class SumCalculator {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
double fractionTotal;
/* Additional variable declarations go here */
/* Your code goes here */
System.out.printf("%.2f", fractionTotal);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!