Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in Java and run it in BlueJ according to the following specifications The user enters two fractions each one specified as two

image text in transcribed
Write a program in Java and run it in BlueJ according to the following specifications The user enters two fractions each one specified as two integers: a numerator and a denominator . Then the program adds, subtracts, multiplies and divides the fractions (without simplification) and prints the result as a fraction, a mixed number, and as a decimal (floating point) number Example: If the fractions entered are 1/2 and 3/4 the program input and output should look exactly as the following (user input is shown in bold): Enter numerator: 1 Enter denominator: 2 Enter numerator: 3 Enter denominator:4 Result as fraction and mixed number 1/2 +3/4 -10/81 2/8 /2 3/4-2/8 0-2/ 1/2 3/4 -3/80 3/8 112 3/4-4/6-0 4/6 Result as floating point number 0.5 0.75 1.25 0.5 0.750.25 0.5 * 0.75-0.375 0.5 0.75- 0.6666667 Requirements and restrictions (each of the items below will be graded): 1. Use the scanner class for input 2. Use proper names for the variables suggesting their purpose. 3. Use float type for the floating point variables 4. Format your code accordingly using proper indentation, alignment and spacing 5. Use multiple I ne nment in the beginning of the code and write your name, e-mail address, class, and section 6. For each statement in the code add a comment to explain its meaning in the program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago

Question

2. Are you varying your pitch (to avoid being monotonous)?

Answered: 1 week ago

Question

3. Are you varying your speaking rate and volume?

Answered: 1 week ago