SlideShare uma empresa Scribd logo
1 de 23
Alcohol Awareness Special Lecture Reflection
Alcohol is among the most commonly used and abused
substances in today's society, and is of particular interest in the
college aged population as there are many habits and tendencies
of college students in regards to alcohol use that do not extend
past those 4 years (i.e. pre-gaming, drinking games, drinking to
get "blacked out", etc.).
Miami University Peer Hawks is an amazing group of YOUR
PEERS who are dedicated to increasing awareness about safe
alcohol use, as well as many other health behaviors (see
the Peer Hawks Website (Links to an external site.)Links to an
external site. for more information, and check out their video
below). Specifically, they have created an Alcohol Skills
Training Program that is specialized for YOU.
For this assignment, I'd like you to review the Alcohol Skills
Training Program (ASTP) PowerPoint, and write a 2 page
reflection. In this reflection, you may discuss anything that
you'd like in regards to the ASTP lecture. In addition, I'd like
you to consider the following questions:
1. What information, if any, was new to you? If so, were you
surprised by any of the information presented? Explain.
2. How have you seen the impact of alcohol use in your life?
Either personally, or generally (i.e. on campus, in your
hometown, etc.)?
3. What is your major take away point from this special lecture?
Why?
**NOTES**
· Your paper must be in 12 point Times New Roman font,
double spaced, with 1 inch margins on all sides.
· At the top of page 1, please use only your name in the header
at the top of the page (i.e. do not put the date, my name, the
class name, the assignment name, etc.)
· This ASTP PowerPoint can also be found in the Modules Tab.
Framework/.DS_Store
__MACOSX/Framework/._.DS_Store
Framework/Main.javaFramework/Main.javapackage test;
import calculation.*;
publicclassMain{
publicstaticvoid main(String[] args)
{
MyStack[] stacks =newMyStack[5];
for(int i =0; i <5; i++){
stacks[i]=newMyStack();
}
//testing stacks[2]
System.out.println("***************** Case 1 ************
**********");
stacks[2].addItem("1");
System.out.println("stacks[2] has "+ stacks[2].getSize()+" item(
s)");
stacks[2].showItems();
//testing s2
System.out.println("***************** Case 2 ************
**********");
MyStack s2 =newMyStack("5 + 2 + 32 * 10");
System.out.println("s2 has "+ s2.getSize()+" item(s)");
s2.showItems();
ProcessStack.parseMyStack(s2);
//testing s3
System.out.println("****************** Case 3 ***********
**********");
MyStack s3 =newMyStack("5+2+32*10");
System.out.println("s3 has "+ s3.getSize()+" item(s)");
s3.showItems();
//testing s4
System.out.println("******************* Case 4 **********
**********");
MyStack s4 =newMyStack("d5 ~c+ 2$+a32*10b");
System.out.println("s4 has "+ s4.getSize()+" item(s)");
s4.showItems();
ProcessStack.parseMyStack(s4);
//testing s5
System.out.println("******************* Case 5 **********
**********");
MyStack s5 =newMyStack("d5.3. c+ 22.5^+a31.2*10b");
System.out.println("s5 has "+ s5.getSize()+" item(s)");
s5.showItems();
ProcessStack.parseMyStack(s5);
//testing s6
System.out.println("******************* Case 6 **********
**********");
MyStack s6 =newMyStack();
s6.addItem("d5.3.6 c/0.215+ 22.5+a31.2*1%21b");
System.out.println("s6 has "+ s6.getSize()+" item(s)");
s6.showItems();
ProcessStack.parseMyStack(s6);
//testing s7
System.out.println("******************* Case 7 **********
**********");
MyStack s7 =newMyStack();
s7.addItem("d5.3.6 c/0.2 15+ 22. 5+a31.2 *10b +./8");
System.out.println("s6 has "+ s7.getSize()+" item(s)");
s7.showItems();
s7.addItem("502 + 123 -- *0.5ba.5.7-");
s7.showItems();
MyStack s8 =newMyStack("1-5+32-2");
s8.showItems();
ProcessStack.parseMyStack(s8);
}
}
__MACOSX/Framework/._Main.java
Framework/MyStack.javaFramework/MyStack.javapackage calc
ulation;
import java.util.*;
publicclassMyStack{
/*Step 1: Define three data members for this class
* Data member 1: is called "total_stacks" which is used
* to record how many MyStack objects have been created;
*
* Data member 2: is called "id" represents the id number
* the current MyStack object. Each created MyStack object
* should have one unique id number, which is assigned at
* the time when the object is created. You can use the total_
stacks
* as a reference. For example, the first created MyStack obje
ct has ID = 0;
* The second created MyStack Object has ID = 1, and so fort
h
*
* Data member 3: is called "stack", which is the Java suppor
ted Stack.
* This is the main variable to store the expression.
*
* For these three data members, you should determine wheth
er it is a
* "static" or "non-
static" according to its role as mentioned above
*
* Try to use the "Generate Setters and Getters" tool in the "S
ource" menu to
* create the three pairs of setters and getters automatically*/
//Do the step 1 here
/*Step 2: Create two constructors of MyStack(). For both of the
constructors, you
* need to make sure to assign the ID for the created object.
Meanwhile, maintain
* the number of "total_stacks" globally, which means to incr
ease it by one every time when a
* new object is created
*
* Constructor 1: this constructor has no input arguments. Yo
u need to update the
* related variables as mentioned above. Also print out a mes
sage, e.g. "A stack with
* the id #5 is created" (do this at the end of the constructor)
*
* Constructor 2: this constructor has one input argument -
"String exp". In addition to finishing the
* tasks as constructor 1 does, it also push the expression as s
tring type into the
* stack data member by simply calling addItem() member fu
nction.
* */
//Do the step 2 here
/*Step 3: complete the functions below*/
/*remove the top item (String) from the stack data member*/
publicvoid removeItem()
{
//Implement here
}
/*Print out all the items of the stack by printing each one in a ne
w line
* For example, for an expression 5 * 18 + 21
* [0] 5
* [1] *
* [2] 18
* [3] +
* [5] 21
* If you use the stack API directly, you probably can only ac
cess the items in the
* order from the top to the bottom. So to print them out in th
e order as the items
* are inserted, you need to use the Iterator class, which is ret
urned from the stack.
* You need to look it up online on how to use Iterator class*
/
publicvoid showItems()
{
//Implement here
}
/* Return the top character of the stack, you can't remove the to
p item but just read it*/
publicString getTopItem()
{
}
//Return how many items are there in the stack
publicint getSize()
{
//Implement here here
}
/*Step 4: as described in the instruction. This is the most import
ant function for this class
* The role is to process the input String, and store them into
the stack as items*/
publicvoid addItem(String exp)
{
//Implement here
}
}
__MACOSX/Framework/._MyStack.java
Framework/ProcessStack.javaFramework/ProcessStack.javapack
age calculation;
//This Message class is just to used as a return type to show whe
ther the stored items of the stack
//can be executable or valid. There are two data member involve
d, the first one "success" is
// to indicate whether the expression is valid, 0 -
empty expression; 1 - invalid expression; 2 - valid expression
// Actually only when success == 2, the second parameter "resul
t" is meaningful. It shows the
// result of the expression. Otherwise for the case success == 0
or success == 1, we can assume
// result = 0.
classMessage
{
privateint success;//valid indicator 0 - empty expression; 1 -
invalid expression; 2 - valid expression
privatedouble result;
privateString expression;
//Constructor 1
publicMessage()
{
success =0;//by default, assume the expression is 0
result =0.0;
}
publicMessage(int s,double r)
{
success = s;
result = r;
}
//below are basic setter and getter
publicint getSuccess(){
return success;
}
publicvoid setSuccess(int success){
this.success = success;
}
publicdouble getResult(){
return result;
}
publicvoid setResult(double result){
this.result = result;
}
}
/*This is a display class that is used to show message. In other
word, for the class ProcessStack below, it use
* this Display class to print out message information.
*
* The reason I design it in this way is to let you practice imple
menting different tasks in
* different modules. So this Display class is to take care of the
output message. The ProcessStack
* class is to take care the logic*/
classDisplay{
publicstaticvoid showMessage(Message m)
{
if(m.getSuccess()==0)
{
System.out.println("No any input from the stack");
}
elseif(m.getSuccess()==1)
{
System.out.println("The expression is wrong!");
}
else
{
System.out.println("The expression result is: "+ m.getResult());
}
}
}
/*The most important class in this file, which is used to process
*/
publicclassProcessStack{
publicProcessStack()
{
}
/*This method call the the calculate() and print out the correspo
nding message*/
publicstaticvoid parseMyStack(MyStack s)
{
Message m = calculate(s);
Display.showMessage(m);
}
/*Step 5: implement the following function
* This is the most important function of this file. The descri
ption for this function
* is already defined in the instructions. Basecially, you will
check the stored item of
* the MyStack input parameter. There are three possible case
s: empty expression, invalid expression,
* and valid expression. If it is a valid expression, calculate i
t. According to the three
* cases, return different messages.
* */
publicstaticMessage calculate(MyStack ms)
{
//if ms stores correct expression, return new Message(2, result);
//if ms has empty expression, return new Message(0, 0.0);
//if ms has invalid expression, return new Message(1, 0.0)
}
}
__MACOSX/Framework/._ProcessStack.java
__MACOSX/._Framework
Computing Project
1. Project Description:
For this project, you will implement a core part of a calculator
that for a given sequence
of computation (e.g. “5 + 3 * 12 / 25”), your program is able to
analyze the expression
string by extracting out numbers or operators, and finally
compute the result if the input
is a valid expression. To achieve this goal, you will use the
“Stack” class to store those
data and process them properly. The detailed instructions are
given as below.
2. Project Goals:
• To warm up with Java classes and packages
• To practice on static and non-static members inside a class
• To learn to use Eclipse IDE to generate “Setters and Getters”
• To get familiar about commonly used container class in Java,
“Stack”
• To learn to look up Java APIs online, such as how to use
String, Stack, Double
3. Project Basic Classes:
There are three main classes involved: “MyStack”,
“ProcessStack”, and “Main”. The first
two classes are in a package called “calculation”; the “Main”
class is in another package
“test”. The basic roles for these classes are:
• MyStack class
A Stack data structure class is used to hold the extracted
numbers or operators from the
input string expression and store them into a stack. So each item
of the stack is a String.
• ProcessStack class
This class is responsible to process an object of MyStack. If the
MyStack stored
expression is valid, the ProcessStack will compute the results;
otherwise, it reports an
error.
• Main class
This is a basic test class. You really do NOT need to implement
anything here. It is
basically for testing purpose on the two above classes. I will
provide you some code in
the Main class. Then you can use it as a basic test. You are free
to have more testing code
here.
4. Two Important Functions:
For this project, there are several functions you need to
implement. The two most
important functions are “addItem()” and “calculate()”. The first
one is from
the “MyStack” class; the second one is from the “ProcessStack”
class. The details about
these two functions are as below:
Function 1: public void addItem(String exp)
This function is to analyze the input String “exp” and store the
extracted items into a
stack. For example, if the input is “5 + 2 * 12 - 24”. It will be
stored into a stack as:
stack: 24
–
12
*
2
+
5
As this function is inside the “MyStack” class, so it operates on
a stack variable, which is
a data member of the MyStack class. This variable is defined by
the Java supported class
"Stack”. In other words, the “MyStack” class is a kind of
wrapper of the Java Stack class.
Here is a piece of code of the MyStack class:
public class MyStack {
...
private Stack stack;
….
}
Also, the function addItem(String exp) should be able to
distinguish invalid characters.
For example, if the input expression is “5 a+b2 *12-f24”, it can
filter out those invalid
characters, such as letters ‘a’, ‘b’, ‘f’, and re-store the right
expression “5 + 2 * 12 - 24”
into the stack.
The general principle for this character analysis is: you use a
loop to analyze each
character of the String (there is a good function of the Java
String class; please look it
up). If the current character is one of the ‘+’, ‘–’, ‘*’, ‘/’
characters, push it into stack
directly. If the current character is a number, you should keep
moving forward to the
next character. Because a number can be made of more than one
characters, e.g 329,
which has three characters. You need to keep moving until the
next one is not a number
or a ‘.’. Here ‘.’ is a special and challenging case. Because for a
floating number, e.g.
52.8, you need to consider the ‘.’ as part of a number. But the
‘.’ can show at most ONCE
in a number. For example, you never have a number looks like
32.57.65, which can not
be a number. For this example, we consider it as two numbers:
32.57 and 0.65. We allow
users to use a casual way to represent “0.65” by “.65”. If the
current character is
neither a number (including ‘.”) nor an operator, you just
simply ignore this character.
Here are an example of correctly extracted results:
Input String: “62d – 23.5 ba 5+2 12 – 3 * a +zer/6
+.52.3*2.6%$”
Extracted results: “62”, “–”, “23.5”, “5”, “+”, “2”, “12”, “–”,
“3”, “*”, “a”, “+”, “/”, “6”,
“+”, “0.52”, “0.3”, “*”, “2.6”.
In the example above all letters, such as ‘a’, ‘z’, will be
automatically filtered out.
Function 2: public static Message calculate(MyStack ms)
This function is to execute the expression from the input
parameter of MyStack. To be
exact, it actually reads the items from the “stack" member of
MyStack and computes the
result of the stored items if it is a valid expression. Here,
someone may wonder, since the
“addItem()” function already filters those invalid characters,
why it is still necessary to
check potential invalid expressions. This is because, the
function “addItem()” can only
detect invalid characters. But it cannot check whether it is a
valid expression. For
example: “5 + 6 * / 2 – 12 8”, all of the characters are valid, but
it is not a valid
expression. This is the responsibility for “calculate()” to
identify its correctness. If it is a
valid expression, the function should calculate the result and
return it in the data type of a
Message. Otherwise, it returns an error.
Attention: to make this task simpler, when calculate the result,
you don’t need to consider
the priority between “+”, “–”, “*”, “/”, we can assume the left
go first. For example: if the
expression is 5 + 2 * 3, if we ignore the operator priority, the
answer is 21. As the “+” is
on the left, it goes first.
5. Steps to finish:
For this project, you are provided with the basic code
framework, which contains three
“.java” files. So what you need to do is to implement some
functions as required. The
steps details are put inside the comments of the project. There
are 5 steps involved:
“MyStack.java”: steps (1) – (4)
- Step (1): define data members
- Step (2): create constructors
- Step (3): complete some easy functions
- Step (4): finish one important function
“ProcessStack.java”: step (5)
- Step (5): finish another important function
6. To start:
First, you are suggested to create a project from a scratch with
the project name
“Project1”. Then create two packages with the same names as
shown below and create
the corresponding three “.java” files. Copy the code of the
provided files into the
corresponding “.java” directly. Simply copy all the code to each
file (Ctrl + A, Ctrl + C,
Ctrl + P). The project structure is shown as the figure below:
When you first copy all the code, you may find many
compilation errors. Don’t worry.
This is because some of the data members or functions are not
implemented yet. As you
finish those steps, the errors will disappear. But you can
comment out all the code in the
“Main.java” first if you feel those errors are not very
comfortable.
Try to finish the Step (1) – (4) first. You can then uncomment
some of the code in the
“Main.java” to test it. Such as constructors, or addItem(). You
can also write down your
own test code inside the “Main.java” to test your current code
as you proceed. Finally,
you can work on the Step(5).
6. Rubrics:
- Successfully finish Step (1) (15%)
- Successfully finish Step (2) (20%)
- Successfully finish Step (3) (20%)
- Successfully finish Step (4) (25%)
- Successfully finish Step (5) (30%)
7. Some testing results:
Here are some result according to the provided testing code in
the “Main.java”. You can
also try to use your own code to further test your
implementation.
_________________________Testing
Results_________________________________
A stack with id 0 is created.
A stack with id 1 is created.
A stack with id 2 is created.
A stack with id 3 is created.
A stack with id 4 is created.
***************** Case 1 **********************
stacks[2] has 1 item(s)
The items in stack #2
[0]: 1
***************** Case 2 **********************
5 + 2 + 32 * 10
A stack with id 5 is created.
s2 has 7 item(s)
The items in stack #5
[0]: 5
[1]: +
[2]: 2
[3]: +
[4]: 32
[5]: *
[6]: 10
A stack with id 6 is created.
The expression result is: 390.0
****************** Case 3 *********************
5+2+32*10
A stack with id 7 is created.
s3 has 7 item(s)
The items in stack #7
[0]: 5
[1]: +
[2]: 2
[3]: +
[4]: 32
[5]: *
[6]: 10
******************* Case 4 ********************
d5 ~c+ 2$+a32*10b
A stack with id 8 is created.
s4 has 7 item(s)
The items in stack #8
[0]: 5
[1]: +
[2]: 2
[3]: +
[4]: 32
[5]: *
[6]: 10
A stack with id 9 is created.
The expression result is: 390.0
******************* Case 5 ********************
d5.3. c+ 22.5^+a31.2*10b
A stack with id 10 is created.
s5 has 7 item(s)
The items in stack #10
[0]: 5.3
[1]: +
[2]: 22.5
[3]: +
[4]: 31.2
[5]: *
[6]: 10
A stack with id 11 is created.
The expression result is: 590.0
******************* Case 6 ********************
A stack with id 12 is created.
s6 has 11 item(s)
The items in stack #12
[0]: 5.3
[1]: 0.6
[2]: /
[3]: 0.215
[4]: +
[5]: 22.5
[6]: +
[7]: 31.2
[8]: *
[9]: 1
[10]: 21
A stack with id 13 is created.
The expression is wrong!
******************* Case 7 ********************
A stack with id 14 is created.
s6 has 15 item(s)
The items in stack #14
[0]: 5.3
[1]: 0.6
[2]: /
[3]: 0.2
[4]: 15
[5]: +
[6]: 22
[7]: 5
[8]: +
[9]: 31.2
[10]: *
[11]: 10
[12]: +
[13]: /
[14]: 8
The items in stack #14
[0]: 5.3
[1]: 0.6
[2]: /
[3]: 0.2
[4]: 15
[5]: +
[6]: 22
[7]: 5
[8]: +
[9]: 31.2
[10]: *
[11]: 10
[12]: +
[13]: /
[14]: 8
[15]: 502
[16]: +
[17]: 123
[18]: -
[19]: -
[20]: *
[21]: 0.5
[22]: 0.5
[23]: 0.7
[24]: -
1-5+32-2
A stack with id 15 is created.
The items in stack #15
[0]: 1
[1]: -
[2]: 5
[3]: +
[4]: 32
[5]: -
[6]: 2
A stack with id 16 is created.
The expression result is: 26.0

Mais conteúdo relacionado

Semelhante a Alcohol Awareness Special Lecture ReflectionAlcohol is among the.docx

Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxfredharris32
 
Ive posted 3 classes after the instruction that were given at star.pdf
Ive posted 3 classes after the instruction that were given at star.pdfIve posted 3 classes after the instruction that were given at star.pdf
Ive posted 3 classes after the instruction that were given at star.pdfdeepaarora22
 
Goal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdfGoal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdfarsmobiles
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6helpido9
 
This file contains a complete array-based MultiSet, but not the code.pdf
This file contains a complete array-based MultiSet, but not the code.pdfThis file contains a complete array-based MultiSet, but not the code.pdf
This file contains a complete array-based MultiSet, but not the code.pdfdeepaksatrker
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfinfo309708
 
Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6comp274
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6solutionjug4
 
this file has a complete array-based MultiSet, but not the code need.pdf
this file has a complete array-based MultiSet, but not the code need.pdfthis file has a complete array-based MultiSet, but not the code need.pdf
this file has a complete array-based MultiSet, but not the code need.pdfflashfashioncasualwe
 
Java Generics
Java GenericsJava Generics
Java Genericsjeslie
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1Albert Rosa
 
Commenting in Agile Development
Commenting in Agile DevelopmentCommenting in Agile Development
Commenting in Agile DevelopmentJan Rybák Benetka
 
Oop lect3.pptx
Oop lect3.pptxOop lect3.pptx
Oop lect3.pptxMrMudassir
 
We will be making 4 classes Main - for testing the code Hi.pdf
 We will be making 4 classes Main - for testing the code Hi.pdf We will be making 4 classes Main - for testing the code Hi.pdf
We will be making 4 classes Main - for testing the code Hi.pdfanithareadymade
 

Semelhante a Alcohol Awareness Special Lecture ReflectionAlcohol is among the.docx (20)

Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
 
Computer programming 2 -lesson 4
Computer programming 2  -lesson 4Computer programming 2  -lesson 4
Computer programming 2 -lesson 4
 
Java doc Pr ITM2
Java doc Pr ITM2Java doc Pr ITM2
Java doc Pr ITM2
 
Ive posted 3 classes after the instruction that were given at star.pdf
Ive posted 3 classes after the instruction that were given at star.pdfIve posted 3 classes after the instruction that were given at star.pdf
Ive posted 3 classes after the instruction that were given at star.pdf
 
Goal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdfGoal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdf
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
CS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUALCS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUAL
 
This file contains a complete array-based MultiSet, but not the code.pdf
This file contains a complete array-based MultiSet, but not the code.pdfThis file contains a complete array-based MultiSet, but not the code.pdf
This file contains a complete array-based MultiSet, but not the code.pdf
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
@Prompt
@Prompt@Prompt
@Prompt
 
Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
this file has a complete array-based MultiSet, but not the code need.pdf
this file has a complete array-based MultiSet, but not the code need.pdfthis file has a complete array-based MultiSet, but not the code need.pdf
this file has a complete array-based MultiSet, but not the code need.pdf
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1
 
Commenting in Agile Development
Commenting in Agile DevelopmentCommenting in Agile Development
Commenting in Agile Development
 
Oop lect3.pptx
Oop lect3.pptxOop lect3.pptx
Oop lect3.pptx
 
We will be making 4 classes Main - for testing the code Hi.pdf
 We will be making 4 classes Main - for testing the code Hi.pdf We will be making 4 classes Main - for testing the code Hi.pdf
We will be making 4 classes Main - for testing the code Hi.pdf
 
backend
backendbackend
backend
 
backend
backendbackend
backend
 

Mais de simonlbentley59018

Allison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docx
Allison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docxAllison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docx
Allison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docxsimonlbentley59018
 
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docx
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docxAllen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docx
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docxsimonlbentley59018
 
All workings, when appropriate, must be shown to substantiate your.docx
All workings, when appropriate, must be shown to substantiate your.docxAll workings, when appropriate, must be shown to substantiate your.docx
All workings, when appropriate, must be shown to substantiate your.docxsimonlbentley59018
 
All yellow highlight is missing answer, please answer all of t.docx
All yellow highlight is missing answer, please answer all of t.docxAll yellow highlight is missing answer, please answer all of t.docx
All yellow highlight is missing answer, please answer all of t.docxsimonlbentley59018
 
All models are wrong. Some models are useful.—George E. P. B.docx
All models are wrong. Some models are useful.—George E. P. B.docxAll models are wrong. Some models are useful.—George E. P. B.docx
All models are wrong. Some models are useful.—George E. P. B.docxsimonlbentley59018
 
allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx
allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docxallclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx
allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docxsimonlbentley59018
 
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docx
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docxALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docx
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docxsimonlbentley59018
 
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docx
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docxALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docx
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docxsimonlbentley59018
 
All views expressed in this paper are those of the authors a.docx
All views expressed in this paper are those of the authors a.docxAll views expressed in this paper are those of the authors a.docx
All views expressed in this paper are those of the authors a.docxsimonlbentley59018
 
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docx
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docxAll Wet! Legacy of Juniper Utility has residents stewingBy Eri.docx
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docxsimonlbentley59018
 
All three of the Aristotle, Hobbes, and Douglass readings discussed .docx
All three of the Aristotle, Hobbes, and Douglass readings discussed .docxAll three of the Aristotle, Hobbes, and Douglass readings discussed .docx
All three of the Aristotle, Hobbes, and Douglass readings discussed .docxsimonlbentley59018
 
All rights reserved. No part of this report, including t.docx
All rights reserved. No part of this report, including t.docxAll rights reserved. No part of this report, including t.docx
All rights reserved. No part of this report, including t.docxsimonlbentley59018
 
All PrinciplesEvidence on Persuasion Principles This provides som.docx
All PrinciplesEvidence on Persuasion Principles This provides som.docxAll PrinciplesEvidence on Persuasion Principles This provides som.docx
All PrinciplesEvidence on Persuasion Principles This provides som.docxsimonlbentley59018
 
All papers may be subject to submission for textual similarity revie.docx
All papers may be subject to submission for textual similarity revie.docxAll papers may be subject to submission for textual similarity revie.docx
All papers may be subject to submission for textual similarity revie.docxsimonlbentley59018
 
All of us live near some major industry. Describe the history of an .docx
All of us live near some major industry. Describe the history of an .docxAll of us live near some major industry. Describe the history of an .docx
All of us live near some major industry. Describe the history of an .docxsimonlbentley59018
 
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docx
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docxAll of Us Research Program—Protocol v1.12 IRB Approval Dat.docx
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docxsimonlbentley59018
 
All participants must read the following article ATTACHED Agwu.docx
All participants must read the following article ATTACHED Agwu.docxAll participants must read the following article ATTACHED Agwu.docx
All participants must read the following article ATTACHED Agwu.docxsimonlbentley59018
 
ALL of the requirements are contained in the attached document.  T.docx
ALL of the requirements are contained in the attached document.  T.docxALL of the requirements are contained in the attached document.  T.docx
ALL of the requirements are contained in the attached document.  T.docxsimonlbentley59018
 
All five honorees cared greatly about the success of Capella lea.docx
All five honorees cared greatly about the success of Capella lea.docxAll five honorees cared greatly about the success of Capella lea.docx
All five honorees cared greatly about the success of Capella lea.docxsimonlbentley59018
 
All of the instructions will be given to you in a document. One docu.docx
All of the instructions will be given to you in a document. One docu.docxAll of the instructions will be given to you in a document. One docu.docx
All of the instructions will be given to you in a document. One docu.docxsimonlbentley59018
 

Mais de simonlbentley59018 (20)

Allison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docx
Allison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docxAllison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docx
Allison RogersProfessor KoenigCOMM 3313October 12th, 2018H.docx
 
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docx
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docxAllen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docx
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docx
 
All workings, when appropriate, must be shown to substantiate your.docx
All workings, when appropriate, must be shown to substantiate your.docxAll workings, when appropriate, must be shown to substantiate your.docx
All workings, when appropriate, must be shown to substantiate your.docx
 
All yellow highlight is missing answer, please answer all of t.docx
All yellow highlight is missing answer, please answer all of t.docxAll yellow highlight is missing answer, please answer all of t.docx
All yellow highlight is missing answer, please answer all of t.docx
 
All models are wrong. Some models are useful.—George E. P. B.docx
All models are wrong. Some models are useful.—George E. P. B.docxAll models are wrong. Some models are useful.—George E. P. B.docx
All models are wrong. Some models are useful.—George E. P. B.docx
 
allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx
allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docxallclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx
allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx
 
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docx
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docxALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docx
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docx
 
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docx
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docxALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docx
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docx
 
All views expressed in this paper are those of the authors a.docx
All views expressed in this paper are those of the authors a.docxAll views expressed in this paper are those of the authors a.docx
All views expressed in this paper are those of the authors a.docx
 
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docx
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docxAll Wet! Legacy of Juniper Utility has residents stewingBy Eri.docx
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docx
 
All three of the Aristotle, Hobbes, and Douglass readings discussed .docx
All three of the Aristotle, Hobbes, and Douglass readings discussed .docxAll three of the Aristotle, Hobbes, and Douglass readings discussed .docx
All three of the Aristotle, Hobbes, and Douglass readings discussed .docx
 
All rights reserved. No part of this report, including t.docx
All rights reserved. No part of this report, including t.docxAll rights reserved. No part of this report, including t.docx
All rights reserved. No part of this report, including t.docx
 
All PrinciplesEvidence on Persuasion Principles This provides som.docx
All PrinciplesEvidence on Persuasion Principles This provides som.docxAll PrinciplesEvidence on Persuasion Principles This provides som.docx
All PrinciplesEvidence on Persuasion Principles This provides som.docx
 
All papers may be subject to submission for textual similarity revie.docx
All papers may be subject to submission for textual similarity revie.docxAll papers may be subject to submission for textual similarity revie.docx
All papers may be subject to submission for textual similarity revie.docx
 
All of us live near some major industry. Describe the history of an .docx
All of us live near some major industry. Describe the history of an .docxAll of us live near some major industry. Describe the history of an .docx
All of us live near some major industry. Describe the history of an .docx
 
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docx
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docxAll of Us Research Program—Protocol v1.12 IRB Approval Dat.docx
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docx
 
All participants must read the following article ATTACHED Agwu.docx
All participants must read the following article ATTACHED Agwu.docxAll participants must read the following article ATTACHED Agwu.docx
All participants must read the following article ATTACHED Agwu.docx
 
ALL of the requirements are contained in the attached document.  T.docx
ALL of the requirements are contained in the attached document.  T.docxALL of the requirements are contained in the attached document.  T.docx
ALL of the requirements are contained in the attached document.  T.docx
 
All five honorees cared greatly about the success of Capella lea.docx
All five honorees cared greatly about the success of Capella lea.docxAll five honorees cared greatly about the success of Capella lea.docx
All five honorees cared greatly about the success of Capella lea.docx
 
All of the instructions will be given to you in a document. One docu.docx
All of the instructions will be given to you in a document. One docu.docxAll of the instructions will be given to you in a document. One docu.docx
All of the instructions will be given to you in a document. One docu.docx
 

Último

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Último (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

Alcohol Awareness Special Lecture ReflectionAlcohol is among the.docx

  • 1. Alcohol Awareness Special Lecture Reflection Alcohol is among the most commonly used and abused substances in today's society, and is of particular interest in the college aged population as there are many habits and tendencies of college students in regards to alcohol use that do not extend past those 4 years (i.e. pre-gaming, drinking games, drinking to get "blacked out", etc.). Miami University Peer Hawks is an amazing group of YOUR PEERS who are dedicated to increasing awareness about safe alcohol use, as well as many other health behaviors (see the Peer Hawks Website (Links to an external site.)Links to an external site. for more information, and check out their video below). Specifically, they have created an Alcohol Skills Training Program that is specialized for YOU. For this assignment, I'd like you to review the Alcohol Skills Training Program (ASTP) PowerPoint, and write a 2 page reflection. In this reflection, you may discuss anything that you'd like in regards to the ASTP lecture. In addition, I'd like you to consider the following questions: 1. What information, if any, was new to you? If so, were you surprised by any of the information presented? Explain. 2. How have you seen the impact of alcohol use in your life? Either personally, or generally (i.e. on campus, in your hometown, etc.)? 3. What is your major take away point from this special lecture? Why? **NOTES** · Your paper must be in 12 point Times New Roman font, double spaced, with 1 inch margins on all sides. · At the top of page 1, please use only your name in the header at the top of the page (i.e. do not put the date, my name, the class name, the assignment name, etc.) · This ASTP PowerPoint can also be found in the Modules Tab.
  • 2. Framework/.DS_Store __MACOSX/Framework/._.DS_Store Framework/Main.javaFramework/Main.javapackage test; import calculation.*; publicclassMain{ publicstaticvoid main(String[] args) { MyStack[] stacks =newMyStack[5]; for(int i =0; i <5; i++){ stacks[i]=newMyStack(); } //testing stacks[2] System.out.println("***************** Case 1 ************ **********"); stacks[2].addItem("1"); System.out.println("stacks[2] has "+ stacks[2].getSize()+" item( s)"); stacks[2].showItems(); //testing s2 System.out.println("***************** Case 2 ************ **********"); MyStack s2 =newMyStack("5 + 2 + 32 * 10"); System.out.println("s2 has "+ s2.getSize()+" item(s)"); s2.showItems();
  • 3. ProcessStack.parseMyStack(s2); //testing s3 System.out.println("****************** Case 3 *********** **********"); MyStack s3 =newMyStack("5+2+32*10"); System.out.println("s3 has "+ s3.getSize()+" item(s)"); s3.showItems(); //testing s4 System.out.println("******************* Case 4 ********** **********"); MyStack s4 =newMyStack("d5 ~c+ 2$+a32*10b"); System.out.println("s4 has "+ s4.getSize()+" item(s)"); s4.showItems(); ProcessStack.parseMyStack(s4); //testing s5 System.out.println("******************* Case 5 ********** **********"); MyStack s5 =newMyStack("d5.3. c+ 22.5^+a31.2*10b"); System.out.println("s5 has "+ s5.getSize()+" item(s)"); s5.showItems(); ProcessStack.parseMyStack(s5); //testing s6 System.out.println("******************* Case 6 ********** **********"); MyStack s6 =newMyStack(); s6.addItem("d5.3.6 c/0.215+ 22.5+a31.2*1%21b"); System.out.println("s6 has "+ s6.getSize()+" item(s)");
  • 4. s6.showItems(); ProcessStack.parseMyStack(s6); //testing s7 System.out.println("******************* Case 7 ********** **********"); MyStack s7 =newMyStack(); s7.addItem("d5.3.6 c/0.2 15+ 22. 5+a31.2 *10b +./8"); System.out.println("s6 has "+ s7.getSize()+" item(s)"); s7.showItems(); s7.addItem("502 + 123 -- *0.5ba.5.7-"); s7.showItems(); MyStack s8 =newMyStack("1-5+32-2"); s8.showItems(); ProcessStack.parseMyStack(s8); } } __MACOSX/Framework/._Main.java Framework/MyStack.javaFramework/MyStack.javapackage calc ulation; import java.util.*; publicclassMyStack{ /*Step 1: Define three data members for this class * Data member 1: is called "total_stacks" which is used * to record how many MyStack objects have been created; *
  • 5. * Data member 2: is called "id" represents the id number * the current MyStack object. Each created MyStack object * should have one unique id number, which is assigned at * the time when the object is created. You can use the total_ stacks * as a reference. For example, the first created MyStack obje ct has ID = 0; * The second created MyStack Object has ID = 1, and so fort h * * Data member 3: is called "stack", which is the Java suppor ted Stack. * This is the main variable to store the expression. * * For these three data members, you should determine wheth er it is a * "static" or "non- static" according to its role as mentioned above * * Try to use the "Generate Setters and Getters" tool in the "S ource" menu to * create the three pairs of setters and getters automatically*/ //Do the step 1 here /*Step 2: Create two constructors of MyStack(). For both of the
  • 6. constructors, you * need to make sure to assign the ID for the created object. Meanwhile, maintain * the number of "total_stacks" globally, which means to incr ease it by one every time when a * new object is created * * Constructor 1: this constructor has no input arguments. Yo u need to update the * related variables as mentioned above. Also print out a mes sage, e.g. "A stack with * the id #5 is created" (do this at the end of the constructor) * * Constructor 2: this constructor has one input argument - "String exp". In addition to finishing the * tasks as constructor 1 does, it also push the expression as s tring type into the * stack data member by simply calling addItem() member fu nction. * */ //Do the step 2 here /*Step 3: complete the functions below*/ /*remove the top item (String) from the stack data member*/
  • 7. publicvoid removeItem() { //Implement here } /*Print out all the items of the stack by printing each one in a ne w line * For example, for an expression 5 * 18 + 21 * [0] 5 * [1] * * [2] 18 * [3] + * [5] 21 * If you use the stack API directly, you probably can only ac cess the items in the * order from the top to the bottom. So to print them out in th e order as the items * are inserted, you need to use the Iterator class, which is ret urned from the stack. * You need to look it up online on how to use Iterator class* / publicvoid showItems() { //Implement here } /* Return the top character of the stack, you can't remove the to p item but just read it*/ publicString getTopItem() { } //Return how many items are there in the stack
  • 8. publicint getSize() { //Implement here here } /*Step 4: as described in the instruction. This is the most import ant function for this class * The role is to process the input String, and store them into the stack as items*/ publicvoid addItem(String exp) { //Implement here } } __MACOSX/Framework/._MyStack.java Framework/ProcessStack.javaFramework/ProcessStack.javapack age calculation; //This Message class is just to used as a return type to show whe ther the stored items of the stack //can be executable or valid. There are two data member involve d, the first one "success" is // to indicate whether the expression is valid, 0 - empty expression; 1 - invalid expression; 2 - valid expression // Actually only when success == 2, the second parameter "resul t" is meaningful. It shows the // result of the expression. Otherwise for the case success == 0
  • 9. or success == 1, we can assume // result = 0. classMessage { privateint success;//valid indicator 0 - empty expression; 1 - invalid expression; 2 - valid expression privatedouble result; privateString expression; //Constructor 1 publicMessage() { success =0;//by default, assume the expression is 0 result =0.0; } publicMessage(int s,double r) { success = s; result = r; } //below are basic setter and getter publicint getSuccess(){ return success; } publicvoid setSuccess(int success){ this.success = success; } publicdouble getResult(){ return result; }
  • 10. publicvoid setResult(double result){ this.result = result; } } /*This is a display class that is used to show message. In other word, for the class ProcessStack below, it use * this Display class to print out message information. * * The reason I design it in this way is to let you practice imple menting different tasks in * different modules. So this Display class is to take care of the output message. The ProcessStack * class is to take care the logic*/ classDisplay{ publicstaticvoid showMessage(Message m) { if(m.getSuccess()==0) { System.out.println("No any input from the stack"); } elseif(m.getSuccess()==1) { System.out.println("The expression is wrong!"); } else { System.out.println("The expression result is: "+ m.getResult()); } } } /*The most important class in this file, which is used to process
  • 11. */ publicclassProcessStack{ publicProcessStack() { } /*This method call the the calculate() and print out the correspo nding message*/ publicstaticvoid parseMyStack(MyStack s) { Message m = calculate(s); Display.showMessage(m); } /*Step 5: implement the following function * This is the most important function of this file. The descri ption for this function * is already defined in the instructions. Basecially, you will check the stored item of * the MyStack input parameter. There are three possible case s: empty expression, invalid expression, * and valid expression. If it is a valid expression, calculate i t. According to the three * cases, return different messages. * */ publicstaticMessage calculate(MyStack ms) { //if ms stores correct expression, return new Message(2, result); //if ms has empty expression, return new Message(0, 0.0);
  • 12. //if ms has invalid expression, return new Message(1, 0.0) } } __MACOSX/Framework/._ProcessStack.java __MACOSX/._Framework Computing Project 1. Project Description: For this project, you will implement a core part of a calculator that for a given sequence of computation (e.g. “5 + 3 * 12 / 25”), your program is able to analyze the expression string by extracting out numbers or operators, and finally compute the result if the input is a valid expression. To achieve this goal, you will use the “Stack” class to store those data and process them properly. The detailed instructions are given as below. 2. Project Goals: • To warm up with Java classes and packages • To practice on static and non-static members inside a class • To learn to use Eclipse IDE to generate “Setters and Getters” • To get familiar about commonly used container class in Java,
  • 13. “Stack” • To learn to look up Java APIs online, such as how to use String, Stack, Double 3. Project Basic Classes: There are three main classes involved: “MyStack”, “ProcessStack”, and “Main”. The first two classes are in a package called “calculation”; the “Main” class is in another package “test”. The basic roles for these classes are: • MyStack class A Stack data structure class is used to hold the extracted numbers or operators from the input string expression and store them into a stack. So each item of the stack is a String. • ProcessStack class This class is responsible to process an object of MyStack. If the MyStack stored expression is valid, the ProcessStack will compute the results; otherwise, it reports an error. • Main class This is a basic test class. You really do NOT need to implement anything here. It is basically for testing purpose on the two above classes. I will provide you some code in the Main class. Then you can use it as a basic test. You are free to have more testing code here. 4. Two Important Functions: For this project, there are several functions you need to
  • 14. implement. The two most important functions are “addItem()” and “calculate()”. The first one is from the “MyStack” class; the second one is from the “ProcessStack” class. The details about these two functions are as below: Function 1: public void addItem(String exp) This function is to analyze the input String “exp” and store the extracted items into a stack. For example, if the input is “5 + 2 * 12 - 24”. It will be stored into a stack as: stack: 24 – 12 * 2 + 5 As this function is inside the “MyStack” class, so it operates on a stack variable, which is a data member of the MyStack class. This variable is defined by the Java supported class "Stack”. In other words, the “MyStack” class is a kind of wrapper of the Java Stack class. Here is a piece of code of the MyStack class: public class MyStack { ... private Stack stack;
  • 15. …. } Also, the function addItem(String exp) should be able to distinguish invalid characters. For example, if the input expression is “5 a+b2 *12-f24”, it can filter out those invalid characters, such as letters ‘a’, ‘b’, ‘f’, and re-store the right expression “5 + 2 * 12 - 24” into the stack. The general principle for this character analysis is: you use a loop to analyze each character of the String (there is a good function of the Java String class; please look it up). If the current character is one of the ‘+’, ‘–’, ‘*’, ‘/’ characters, push it into stack directly. If the current character is a number, you should keep moving forward to the next character. Because a number can be made of more than one characters, e.g 329, which has three characters. You need to keep moving until the next one is not a number or a ‘.’. Here ‘.’ is a special and challenging case. Because for a floating number, e.g. 52.8, you need to consider the ‘.’ as part of a number. But the ‘.’ can show at most ONCE in a number. For example, you never have a number looks like 32.57.65, which can not be a number. For this example, we consider it as two numbers: 32.57 and 0.65. We allow users to use a casual way to represent “0.65” by “.65”. If the current character is
  • 16. neither a number (including ‘.”) nor an operator, you just simply ignore this character. Here are an example of correctly extracted results: Input String: “62d – 23.5 ba 5+2 12 – 3 * a +zer/6 +.52.3*2.6%$” Extracted results: “62”, “–”, “23.5”, “5”, “+”, “2”, “12”, “–”, “3”, “*”, “a”, “+”, “/”, “6”, “+”, “0.52”, “0.3”, “*”, “2.6”. In the example above all letters, such as ‘a’, ‘z’, will be automatically filtered out. Function 2: public static Message calculate(MyStack ms) This function is to execute the expression from the input parameter of MyStack. To be exact, it actually reads the items from the “stack" member of MyStack and computes the result of the stored items if it is a valid expression. Here, someone may wonder, since the “addItem()” function already filters those invalid characters, why it is still necessary to check potential invalid expressions. This is because, the function “addItem()” can only detect invalid characters. But it cannot check whether it is a valid expression. For example: “5 + 6 * / 2 – 12 8”, all of the characters are valid, but it is not a valid expression. This is the responsibility for “calculate()” to identify its correctness. If it is a valid expression, the function should calculate the result and return it in the data type of a Message. Otherwise, it returns an error. Attention: to make this task simpler, when calculate the result, you don’t need to consider
  • 17. the priority between “+”, “–”, “*”, “/”, we can assume the left go first. For example: if the expression is 5 + 2 * 3, if we ignore the operator priority, the answer is 21. As the “+” is on the left, it goes first. 5. Steps to finish: For this project, you are provided with the basic code framework, which contains three “.java” files. So what you need to do is to implement some functions as required. The steps details are put inside the comments of the project. There are 5 steps involved: “MyStack.java”: steps (1) – (4) - Step (1): define data members - Step (2): create constructors - Step (3): complete some easy functions - Step (4): finish one important function “ProcessStack.java”: step (5) - Step (5): finish another important function 6. To start: First, you are suggested to create a project from a scratch with the project name “Project1”. Then create two packages with the same names as shown below and create the corresponding three “.java” files. Copy the code of the
  • 18. provided files into the corresponding “.java” directly. Simply copy all the code to each file (Ctrl + A, Ctrl + C, Ctrl + P). The project structure is shown as the figure below: When you first copy all the code, you may find many compilation errors. Don’t worry. This is because some of the data members or functions are not implemented yet. As you finish those steps, the errors will disappear. But you can comment out all the code in the “Main.java” first if you feel those errors are not very comfortable. Try to finish the Step (1) – (4) first. You can then uncomment some of the code in the “Main.java” to test it. Such as constructors, or addItem(). You can also write down your own test code inside the “Main.java” to test your current code as you proceed. Finally, you can work on the Step(5). 6. Rubrics: - Successfully finish Step (1) (15%) - Successfully finish Step (2) (20%) - Successfully finish Step (3) (20%) - Successfully finish Step (4) (25%) - Successfully finish Step (5) (30%) 7. Some testing results:
  • 19. Here are some result according to the provided testing code in the “Main.java”. You can also try to use your own code to further test your implementation. _________________________Testing Results_________________________________ A stack with id 0 is created. A stack with id 1 is created. A stack with id 2 is created. A stack with id 3 is created. A stack with id 4 is created. ***************** Case 1 ********************** stacks[2] has 1 item(s) The items in stack #2 [0]: 1 ***************** Case 2 ********************** 5 + 2 + 32 * 10 A stack with id 5 is created. s2 has 7 item(s) The items in stack #5 [0]: 5 [1]: + [2]: 2 [3]: + [4]: 32 [5]: * [6]: 10 A stack with id 6 is created. The expression result is: 390.0 ****************** Case 3 ********************* 5+2+32*10 A stack with id 7 is created. s3 has 7 item(s) The items in stack #7
  • 20. [0]: 5 [1]: + [2]: 2 [3]: + [4]: 32 [5]: * [6]: 10 ******************* Case 4 ******************** d5 ~c+ 2$+a32*10b A stack with id 8 is created. s4 has 7 item(s) The items in stack #8 [0]: 5 [1]: + [2]: 2 [3]: + [4]: 32 [5]: * [6]: 10 A stack with id 9 is created. The expression result is: 390.0 ******************* Case 5 ******************** d5.3. c+ 22.5^+a31.2*10b A stack with id 10 is created. s5 has 7 item(s) The items in stack #10 [0]: 5.3 [1]: + [2]: 22.5 [3]: + [4]: 31.2 [5]: * [6]: 10
  • 21. A stack with id 11 is created. The expression result is: 590.0 ******************* Case 6 ******************** A stack with id 12 is created. s6 has 11 item(s) The items in stack #12 [0]: 5.3 [1]: 0.6 [2]: / [3]: 0.215 [4]: + [5]: 22.5 [6]: + [7]: 31.2 [8]: * [9]: 1 [10]: 21 A stack with id 13 is created. The expression is wrong! ******************* Case 7 ******************** A stack with id 14 is created. s6 has 15 item(s) The items in stack #14 [0]: 5.3 [1]: 0.6 [2]: / [3]: 0.2 [4]: 15 [5]: + [6]: 22 [7]: 5 [8]: + [9]: 31.2 [10]: *
  • 22. [11]: 10 [12]: + [13]: / [14]: 8 The items in stack #14 [0]: 5.3 [1]: 0.6 [2]: / [3]: 0.2 [4]: 15 [5]: + [6]: 22 [7]: 5 [8]: + [9]: 31.2 [10]: * [11]: 10 [12]: + [13]: / [14]: 8 [15]: 502 [16]: + [17]: 123 [18]: - [19]: - [20]: * [21]: 0.5 [22]: 0.5 [23]: 0.7 [24]: - 1-5+32-2 A stack with id 15 is created. The items in stack #15 [0]: 1 [1]: -
  • 23. [2]: 5 [3]: + [4]: 32 [5]: - [6]: 2 A stack with id 16 is created. The expression result is: 26.0