It’s 1 or 2 pages explaining how the programs work you will find the Qion in the page 2 in the attachment
am Reports
Mohammed Aljohani
jven: 2/24/2016
ATM machine) Up
mulate an ATM ma
9, and initial balan
dis entered incorre
, the main menu is
Programming assignment 4
INF 2151 AB
-1 for viewing the
end 4 for exi
Given Mar 28 : due Apr 6
Dahlem 11.1, p. 445 for 100 points
1. Th
of 7
Research Problem Page 707
}
public String getColor()
{
return color;
}//
public void setSize(String sSize)
{
size = sSize;
}
public String getSize()
{
return size;
}
public void setVolume(String sVolume)
volume = sVolume;
}
public String getVolume()
{
return volume;
}
public String getDateCupMade()
dateCup Made = super.dateMade;
return dateCup Made;
}
public int getNumCups
{
return numCups;
}
//
}//end class
Programm
Page 14 of 15
INF 2151 A,B
Program
Name: Mohamm
Date given: 2/24/2016
(Game: ATM machine) Uşe
9.7 to simulate an ATM mac
Given Mar 28 :
Problem 113
0,1.9, and initial balan
Problems
ding the
id. If the id is entered incorres
– the main menu is
Research Problem Page 6 of 7
x
Add Name
public class Cup extends Container
{
//attributes
private String color;
private String size;
private String volume;
private String dateCupMade;
private int numCups;
//constructors
public Cup
Spare
mel
Add Ne
amed
{
//default constructor
super();
color = “white”;
size = “small”;
volume = “100z”;
numCups++;
}//end constructor
public Cup(String sColor, String sSize)
{
super();
color = sColor;
size = sSize;
if (sSize.equals(“small”))
{
volume = “100z”;
}
if (sSize.equals(“medium”))
{
volume = “160z”;
}
if (sSize.equals(“large”))
{
volume = “2002”;
}
numCups++;
}//end constructor
//methods
public void setColor(String sColor)
{
color = Color;
Report 3
Mohammed Aljohani
2/24/2016
nine)
Mmas
4 of 7
an
neramming assignment 4
Research Problem Page 5 of 7
public void printPaperCupo
{
//
System.out.println(“This object is of ” + getMaterial();
System.out.println(“This object’s size is ” + super.getSize();
System.out.println(“This object’s color is ” + super.getColor();
System.out.println(“This object’s volume is ” + super.getVolume());
System.out.println(“Date made this object made” + super.getDateCup Made();
System.out.println(“This is the object’s number” + getNumCups();
}//end print
}//end class
Pre
Name: MO
Page 14 of 15
Research Problem Page 4 of
public class PaperCup extends Cup
{
//attributes
private String color;
private String size;
private String material;
private String volume;
//constructors
public PaperCup
Add Name
Gridpane
{
super();
this.material = “paper”;
}//end constructor
public PaperCup(String sColor, String sSize)
{
super(sColor, sSize);
this.material = “paper”;
}//end constructor
t Name
:
ast Name
//methods
public void setColor(String sColor)
color = sColor;
}
public String getColor()
{
return color;
}//
public void setSize(String sSize)
{
size = sSize;
public String getSize()
{
return size;
}
public String getMaterial
{
return material;
Prog
Name: Mohammed Al
te given: 2/24/2016
ATM machine) Use the one
late an ATM mac
ch Problem Page 2 of 7
initial balanc
red incorrec
nying three Java
n menu is
Programming assignment 4
INF 2151 A,B
Given Mar 28 ; due Apr 6
Problem 11.1, p. 445 for 100 points
Problem 11.2, p. 445 for 125 points
11.3, p. 445 for 125 points
iewing the
Enrokit
Research Problem Page 3 of 7
import java.util.Scanner;
//public class TestCups
public class TestCups
{
public static void main(String[] args)
{
String color, size;
//
Scanner input = new Scanner(System.in);
System.out.println(“What is the cup’s color? “);
color = input.nextLine();
System.out.println(“What is the cup’s size? “);
size = input.nextLine();
//
PaperCup pcup1 = new PaperCup(color, size);
PaperCup pcup2 = new PaperCup();
System.out.println(“Ok, next\n”);
pcup1.printPaperCup();
System.out.println(“another object\n”);
pcup2.printPaperCup0;
System.out.println(“Afterwards\n”);
}//end main
}//end c;lass