Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a module and define a structure t _ fraction with integer type members numerator and denominator. ( File name: p 1 5

Create a module and define a structure "t_fraction" with integer type members
numerator and denominator. (File name: "p15_mod_fraction.f90")
Create the following calculation function of t fraction type in the module.
-Addition functions : frac_plus_frac, frac_plus_int, int_plus_frac
-Subtraction functions : frac_minus_frac, frac_minus_int, int_minus_frac
-Multiplication functions : frac_mult_frac, frac_mult_int, int_mult_frac
-Division functions : frac_divi_frac, frac_divi_int, int_divi_frac
Also define the "interface operator" statement.
Also, create a function "fracset" that sets an integer to a variable of t fraction type,
and a subroutine "dispfrac" to display.
In addition, add a subroutine "euclidean" that performs Eucledean algorithm, and use
it in each function as necessary.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions