Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that accepts two four-digit octal numbers, converts them to decimal, adds them together, and prints both the decimal and octal result of

Write a program that accepts two four-digit octal numbers, converts them to decimal, adds them together, and prints both the decimal and octal result of that addition. You may assume the user will only give numbers that will add up to 7777, so do not worry about doing checks above that. Also built in Java methods that does this conversion automatically (such as Integer.parseInt(String,8)) WILL NOT be accepted. However, you may still use Integer.parseInt(String) to convert from a String to an integer.

Example Dialog:

Enter a 4 digit octal number

0477

Enter another 4 digit octal number

0022

The first number is 319

The second number is 18

Added together is 337

Which is 0521 in octal

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

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

Recommended Textbook for

More Books

Students also viewed these Databases questions