2. A stack can be used to print numbers in other bases (multibase output). Examples: a) (Base;) 2810 b) (Base4) 7210 = 1* 43 + 0 * 42 + 2 * 41 + 0 * 4 = 10204 c) (Base 2) 5310 = 1 * 25 + 1*24 + 0* 23 + 1* 22 +0* 2! + 1* 20 = 1101012 = 3* 81 + 4 * 8º = 348 %3D %3D Write a java program using stacks that takes 3 non-negative (base 10) long integer numbers and a base B (B is in the range 2-9) and writes the number to the screen as a base B number. The program prompts the user for 3 numbers and bases, and then outputs them. Use as input: a) 7210 b) 5310 c) 355310 Base 4 Base 2 Base 8

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 13RQ: How is an array stored in main memory? How is a linked list stored in main memory? What are their...
icon
Related questions
Question
100%

Java

Dont use others answers please!!

follow the directions on the photo

complete all of them please!!

will leave you feedback!!

Thank you!

1. Show the ListStackADT<T> interface


2. Create a ListStackDataStrucClass<T> with the following methods: default constructor, overloaded constructor, copy constructor, getTop, setTop, isEmpty, ifEmpty (if empty throw the exception), push, peek, pop, toString.


3. Create a private inner class of ListStack<T> called StackNode<T> with the following methods: default constructor, overloaded constructor, copy
constructor, getValue, getNext, setValue, setNext


4. Create a BaseConverter class (non-generic) with the following methods: default
constructor, inputPrompt, convert [converts a BaseNumber to a converted
String], convertAll [instantiate a String object] , toString, processAndPrint

5. Create a private inner class BaseNumber. The inner class has the following methods: default constructor, overloaded constructor, getNumber, getBase, setNumber, setBase. [Make your private instance variables in the inner class Long type].


6. Create a BaseConverterDemo class that only has 2 statements: Create a
BaseConverter object and then have it invoke processAndPrint.


7. Exception classes: StackException, EmptyStackException, FullStackExceptio

2. A stack can be used to print numbers in other bases (multibase output).
Examples:
a) (Bases) 2810
b) (Base4) 7210o = 1 * 43
c) (Base 2) 5310 = 1 * 25
= 3 * 81 + 4 * 8º =
348
+ 0 * 42 + 2 * 41 + 0 * 4 = 10204
+ 1*24 + 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 = 1101012
Write a java program using stacks that takes 3 non-negative (base 10) long integer
numbers and a base B (B is in the range 2-9) and writes the number to the screen
as a base B number. The program prompts the user for 3 numbers and bases, and
then outputs them.
Use as input:
a) 7210
b) 5310
c) 355310
Base 4
Base 2
Base 8
Transcribed Image Text:2. A stack can be used to print numbers in other bases (multibase output). Examples: a) (Bases) 2810 b) (Base4) 7210o = 1 * 43 c) (Base 2) 5310 = 1 * 25 = 3 * 81 + 4 * 8º = 348 + 0 * 42 + 2 * 41 + 0 * 4 = 10204 + 1*24 + 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 = 1101012 Write a java program using stacks that takes 3 non-negative (base 10) long integer numbers and a base B (B is in the range 2-9) and writes the number to the screen as a base B number. The program prompts the user for 3 numbers and bases, and then outputs them. Use as input: a) 7210 b) 5310 c) 355310 Base 4 Base 2 Base 8
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Perception
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
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning