GL Command Prompt c:\exercise>java Exercise13_16 "3/4 + 1/5" 3/4 + 1/5 = 19/20 у-ахis 2 + 3i c:\exercise>java Exercise13_16 "3/4 - 1/5" 3/4 - 1/5 = 11/20 x-axis c:\exercise>java Exercise13_16 "3/4 x 1/5" 3/4 x 1/5 =: 3/20 3- 2i c:\exercise> (b)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter1: Creating Java Programs
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question

Write a program 
Calculator.java. Instead of using integers, use rationals, as shown in Figure .
You will need to use the split method in the String class, introduced in
Section
10.10.3, Replacing and Splitting Strings, to retrieve the numerator string
and denominator string, and convert strings into integers using the Integer
.parseInt
method.

GL Command Prompt
c:\exercise>java Exercise13_16 "3/4 + 1/5"
3/4 + 1/5 = 19/20
у-ахis
2 + 3i
c:\exercise>java Exercise13_16 "3/4 - 1/5"
3/4 - 1/5 = 11/20
x-axis
c:\exercise>java Exercise13_16 "3/4 x 1/5"
3/4 x 1/5 =: 3/20
3- 2i
c:\exercise>
(b)
Transcribed Image Text:GL Command Prompt c:\exercise>java Exercise13_16 "3/4 + 1/5" 3/4 + 1/5 = 19/20 у-ахis 2 + 3i c:\exercise>java Exercise13_16 "3/4 - 1/5" 3/4 - 1/5 = 11/20 x-axis c:\exercise>java Exercise13_16 "3/4 x 1/5" 3/4 x 1/5 =: 3/20 3- 2i c:\exercise> (b)
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT