# Many gas pumps have display that spin digits (either analog or dig...

## Question

Many gas pumps have display that spin digits (either analog or digital ) while the gas is being pumped into your car's tank. The display's digits change to indicate the amount of gas in the tank and the current price.
Write a program that displays the spinning of the digits. Your GaspumpDisplay class will allow you to create a "gas pump" display with a specified number of display places and will allow specify the highest digit in use . You will simplify a gas pump display by using smaller display of only three digits where the digits are in the limited range of 0-4 inclusive

public class GasPumpDisplay {
publicGasPumpDisplay(int numbeOfPostion){
}
public BooleanhasMoreElement(){
}
private int digit;
private GasPumpDisplay tail;
private int currentDigite;
private static final MAX_DIGIT=4 ;
}

Public class GasPumpTester{
Public static void main (String [] args){
GasPumpDisplay d= new GasPumpDisplay (3);
Output:
000 001 002 003 004 010 011 012 013 014 020 021 022 023 024 030 031 032 033 034 040 041 042 043 044 100 101 102 103 104 110 111 112 113 114 120 121 122 123 124 130 131 132 133 134 140 141 142 143 144 200 201 202 203 204 210 211 212 213 214 220 221 222 223 224 230 231 232 233 234 240 241 242 243 244 300 301 302 303 304 310 311 312 313 314 320 321 322 323 324 330 331 332 333 334 400 401 402 403 404 410 411 412 413 414 420 421 422 423 424 430 431 432 433 434 444

## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class GasPumpDisplay {
public GasPumpDisplay(int numberOfPositions){
if(numberOfPositions > 1)
{
tail = new GasPumpDisplay(numberOfPositions-1);
}
position = numberOfPositions;
currentDigit = 0;
}
public boolean hasMoreElement(){
if(currentDigit == MAX_DIGIT && position > 1 && !tail.hasMoreElement())
{
return false;
}
else if(currentDigit == MAX_DIGIT && position == 1)
{
return false;...

By purchasing this solution you'll be able to access the following files:
Solution.java and Solution1.java.

# 50% discount

Hours
Minutes
Seconds
\$16.00 \$8.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.