subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Terri needs to insert a cover page into her document. where should she go to access the commands to do so? o insert tab, objects group o insert tab, illustrations group o insert tab, pages group o insert tab, media group submit
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Need asap write a short paper describing the history and differences between six sigma, waterfall, agile, and scrum models. understanding these models can give you a good idea of how diverse and interesting it development projects can be. describe what the rationale for them is and describe their key features. describe the history behind their development. at least 400 words
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 24.06.2019 21:00
Which device has the most limited computing functionality?
Answers: 1
You know the right answer?
Add dividemethod to take another Fraction as the parameter and return a new Fraction that is the div...
Questions