Computers and Technology

Add dividemethod to take another Fraction as the parameter and return a new Fraction that is the division of current Fraction and the Fraction in the parameter. (public Fraction divide(Fraction f)).-Add scaleup and scaledownmethods to the Fraction class. The scaleupmethod will take afactor as the parameter and multiply the numerator by the factor. The scaledownmethodwill take a factor as the parameter and multiply the denominator by the factor. -Add a scalemethod which will have two parameters: factorand flag. The flagis boolean. Ifflagis true, then scale up the fraction; otherwise scale down the fraction. -Both scaledownand scalemethods must check if the factor is 0. If it is 0, a warningmessage is printed out and no scaling is operated.-Add two more constructors. One of the constructors will have no parameters; it initializesthe fraction to 0/1. The other constructor will have one parameter, representing thenumerator of the fraction; the denominator of the fraction will be 1. -Write a program named FractionScalethat prompts the user of a fraction and a scalefactor. Here is what the user will see on the screen: This program performs the scaling operations on a fraction. Enter a fraction:3/7Scale up or down (1: up, 0: down):1Enter a scale factor:2Scaled fraction is: 6/7You can assume that the user always enters two integers separated by a slash (/) for thefaction. However, the user may enter any number of spaces before and after each integer.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, kikilax
What is linux? an open source operating system a version of ms dos the first version of unix the newest technology available
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, mesposito
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, addisonrausch
What season was better from fortnite?
Answers: 2
image
Computers and Technology, 23.06.2019 00:00, eguzmandpandoracom
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
Do you know the correct answer?
Add dividemethod to take another Fraction as the parameter and return a new Fraction that is the div...

Questions in other subjects:

Konu
Mathematics, 12.02.2022 23:40
Konu
Mathematics, 12.02.2022 23:40
Konu
Biology, 12.02.2022 23:50