View the step-by-step solution to:

# Pentadeca class that encapsulates a Pentadeca number value. THE USE OF ARRAYS IS NOT PERMITTED A Pentadeca number is one with 15 digits: 0, 1, 2, 3,...

Pentadeca class that encapsulates a Pentadeca number value. THE USE OF ARRAYS IS NOT PERMITTED A Pentadeca number is one with 15 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E. The methods the class has are: public void read(), public void set(String), public void set(int),  public void set(Pentadeca),public Pentadeca get(),  public Pentadeca add(Pentadeca), public Pentadeca subtract(Pentadeca), public Pentadeca multiply(Pentadeca), public Pentadeca divide(Pentadeca), public Pentadeca add(int), public Pentadeca subtract(int), public Pentadeca multiply(int), public Pentadeca divide(int),  public Pentadeca add(String), public Pentadeca subtract(String), public Pentadeca multiply(String), public Pentadeca divide(String), public boolean equals(Pentadeca), and public String toString(). Write private methods to check for valid character input, remove the base p character and set the sign. Your class must consider both positive and negative values. Your class should have at least 3 constructors: a default constructor, an explicit constructor with an integer argument and an explicit constructor with a String argument. I will provide a main program as the demo. Recall the nature of numbers and their construction. 13710 is 1 * 102 + 3 * 101 + 7 * 100. In the same way 1A915 would be 1 * 152 + 10* 151 + 9 * 150. Given the decimal number 13710 the digits can be determined using the integer operators / and %. 137 % 10 gives the 7, 137/10 gives 13. 13%10 gives 3 and 13/10 gives 1. 1%10 gives 1 and 1/10 gives 0. The digits base 10 of 137 are 1, 3, 7. The number 13710 converted to base 5 would be 137%5 that gives 2, 137/5 gives 27. 27%5 gives 2, 27/5 gives 5. 5%5 gives 0, 5/5 gives 1. 1%5 gives 1 and 1/5 gives 0. This gives the base 5 number 10225. 13710 converted to base 15 would be 137%15 gives 2, 137/15 gives 9. 9%15 gives 9 and 9/15 gives 0. The number 13710 is therefore 9215.

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents
• ### -

Question & Answers

Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

Ask a Question