power point slides on canada for 2 minute speech on dissaperance or death of child leaves.
In: Operations Management
Please explain; What are some sources of process class in organizations?
In: Operations Management
JAVA PROGRAM
The Florida Dental Association needs a simple program to record what teeth the members of Florida families have. Different Floridians have different numbers of different types of teeth (the program must use this simplified categorization of types of teeth):
The program must record the teeth for one Florida family. When it starts the program asks how many people there are in the family (maximally 5), then for each family member gets their name, a string of tooth types for the uppers (maximally 10 teeth including missing teeth), and a string a tooth types for the lowers (maximally 10 teeth), e.g., the string "CMCBBBMCCM" would represent 10 teeth (of which three are missing). The names are recorded in an array of strings. The tooth information is recorded in a three dimensional array of characters, where each plane corresponds to a person, there are two rows for uppers and lowers, and each row has a column for each tooth. Once the information is recorded the program must offer a menu of four options:
The program must be reasonably idiot proof:
Here's what a sample run should look like (with the keyboard input shown in italics) ...
Welcome to the Floridian Tooth Records -------------------------------------- Please enter number of people in the family : -3 Invalid number of people, try again : 7 Invalid number of people, try again : 3 Please enter the name for family member 1 : Henrietta Please enter the uppers for Henrietta : ABCDEFGHIJ Invalid teeth types, try again : BBBCMCBBBMCCMBBB Too many teeth, try again : CMCBBBMCCM Please enter the lowers for Henrietta : CCMBBMCC Please enter the name for family member 2 : Stanley Please enter the uppers for Stanley : mbbm Please enter the lowers for Stanley : ccMMcc Please enter the name for family member 3 : Raul Please enter the uppers for Raul : CCBbbcC Please enter the lowers for Raul : ccbBBCC (P)rint, (E)xtract, (R)oot, e(X)it : T Invalid menu option, try again : p Henrietta Uppers: 1:C 2:M 3:C 4:B 5:B 6:B 7:M 8:C 9:C 10:M Lowers: 1:C 2:C 3:M 4:B 5:B 6:M 7:C 8:C Stanley Uppers: 1:M 2:B 3:B 4:M Lowers: 1:C 2:C 3:M 4:M 5:C 6:C Raul Uppers: 1:C 2:C 3:B 4:B 5:B 6:C 7:C Lowers: 1:C 2:C 3:B 4:B 5:B 6:C 7:C (P)rint, (E)xtract, (R)oot, e(X)it : E Which family member : Melanie Invalid family member, try again : stanley Which tooth layer (U)pper or (L)ower : M Invalid layer, try again : u Which tooth number : 27 Invalid tooth number, try again : 4 Missing tooth, try again : 2 (P)rint, (E)xtract, (R)oot, e(X)it : P Henrietta Uppers: 1:C 2:M 3:C 4:B 5:B 6:B 7:M 8:C 9:C 10:M Lowers: 1:C 2:C 3:M 4:B 5:B 6:M 7:C 8:C Stanley Uppers: 1:M 2:M 3:B 4:M Lowers: 1:C 2:C 3:M 4:M 5:C 6:C Raul Uppers: 1:C 2:C 3:B 4:B 5:B 6:C 7:C Lowers: 1:C 2:C 3:B 4:B 5:B 6:C 7:C (P)rint, (E)xtract, (R)oot, e(X)it : R One root canal at 0.40 Another root canal at -2.07 (P)rint, (E)xtract, (R)oot, e(X)it : X Exiting the Floridian Tooth Records :-)
In: Computer Science
Hi, I don’t know why I keep getting this error and I’ve spent a while on it now. I am coding in C++.
Here is my .h
___
#ifndef CARD_H #define CARD_H #include <iostream> #include <string> using namespace std; class Card { private: int powerLevel; string element; public: Card(); Card(string, int); string getElement(); int getPowerLevel(); void displayCard(); }; #endif
___
Here is my .cpp
___
#include <iostream> #include "Card.h" #include <string> using namespace std; Card::Card() { element = ""; powerLevel = 0; } Card::Card(string e, int a) { element = e; powerLevel = a; } string Card::getElement() { return element; } int Card::getPowerLevel() { return powerLevel; } void Card::displayCard() { cout << element << "-" << powerLevel << endl; }
___
This is the error message
___
/tmp/ccOrFltm.o: In function `Card::Card()': Card.cpp:(.text+0x0): multiple definition of `Card::Card()' /tmp/ccRpEdKb.o:Card.cpp:(.text+0x0): first defined here /tmp/ccOrFltm.o: In function `Card::Card()': Card.cpp:(.text+0x0): multiple definition of `Card::Card()' /tmp/ccRpEdKb.o:Card.cpp:(.text+0x0): first defined here /tmp/ccOrFltm.o: In function `Card::Card(std::string, int)': Card.cpp:(.text+0x64): multiple definition of `Card::Card(std::string, int)' /tmp/ccRpEdKb.o:Card.cpp:(.text+0x64): first defined here /tmp/ccOrFltm.o: In function `Card::Card(std::string, int)': Card.cpp:(.text+0x64): multiple definition of `Card::Card(std::string, int)' /tmp/ccRpEdKb.o:Card.cpp:(.text+0x64): first defined here /tmp/ccOrFltm.o: In function `Card::getElement()': Card.cpp:(.text+0xd0): multiple definition of `Card::getElement()' /tmp/ccRpEdKb.o:Card.cpp:(.text+0xd0): first defined here /tmp/ccOrFltm.o: In function `Card::getPowerLevel()': Card.cpp:(.text+0xfe): multiple definition of `Card::getPowerLevel()' /tmp/ccRpEdKb.o:Card.cpp:(.text+0xfe): first defined here /tmp/ccOrFltm.o: In function `Card::displayCard()': Card.cpp:(.text+0x10e): multiple definition of `Card::displayCard()' /tmp/ccRpEdKb.o:Card.cpp:(.text+0x10e): first defined here collect2: error: ld returned 1 exit status
___
Thank you for your time
In: Computer Science
Effective process control distinguishes between attribute and variable data.
In: Operations Management
Can performance on some jobs simply not be measured? Why or why not?
In: Psychology
In: Computer Science
Describe the function of the mirror neuron system (MNS).
Key Terms
mirror neuron system (MNS)
Exercises
1. What is the role of the MNS in learning from and teaching others?
Describe the physical and psychological effects of meditation.
Key Terms: meditation
Exercises
1. List the physical effects of meditation.
2. List the psychological effects of meditation.
3. Why does correlation fail to prove causation?
In: Psychology
Exercise: Advanced counting
Complete the program below in the answer box by entering functions so the program can modify the value variable either by adding 1, adding 5, subtracting 1, or subtracting 5. There should only be one function updating the value. The functions subtract_one, add_one, etc. are helper functions as described above; they should simply call the value update function.
from tkinter import *
from tkinter.ttk import *
# Write your functions here
def main():
"""Set up the GUI and run it"""
global value, value_label
window = Tk()
value = 0
value_label = Label(window, text=str(value))
value_label.grid(row=0, column=0, columnspan=4)
subtract_five_button = Button(window, text="-5",
command=subtract_five)
subtract_five_button.grid(row=1, column=0)
subtract_one_button = Button(window, text="-1",
command=subtract_one)
subtract_one_button.grid(row=1, column=1)
add_one_button = Button(window, text="+1", command=add_one)
add_one_button.grid(row=1, column=2)
add_five_button = Button(window, text="+5", command=add_five)
add_five_button.grid(row=1, column=3)
window.mainloop()
main()
In: Computer Science
Define the term compliance and describe three techniques that rely on compliance in our everyday lives and how they work
In: Psychology
9-18. Hammaker Manufacturing: Lean Production/Lean Accounting
HMC continues to be profitable. Although Denise and Lloyd Rowland mapped several business processes 5 years ago to determine whether HMC should work on process improvements or consider business process reengineering, they never really finished that effort nor did HMC decide whether to outsource any processes. Hammaker still thinks that HMC could be more efficient and more profitable, but he’s not really sure how the company can achieve this “next level” of excellence. About a year ago, Denise started reading books and trade journals on the topics of business strategy, lean production, and lean manufacturing. So, when Dick approached her regarding his intent to improve the company, she began to share with him some of the insights she had gained over the past year on business strategy and how their current AIS might not be capturing the most useful metrics for optimal decision-making. Denise mentioned that the next Lean Accounting Summit will be in September and suggested that she and her three financial analysts go to the 4-day conference to gain a better understanding of lean production and accounting concepts to determine how they might be able to better support HMC and Bob's goal of improving the company.
Requirements
In: Operations Management
In: Computer Science
what are the strongest arguments for the proposition that corporations should have influence on how public policy is formulated?
In: Operations Management
3 Design
3.1 Token Class
The Token type, which is an enum type and used in the Token class, is defined as follows:
enum Token_type {ID, INT, OP, EQ, OpenBrace, CloseBrace, INVALID};
If string s, passed in to the constructor or set method, is an identifier then the token type is ID; is a nonnegative integer then the token type is INT; is one of +, -, *, / then the token type is OP; is = then the token type is EQ; is (, open parenthesis, then the token type is OpenBrace; is ), close parenthesis, then the token type is CloseBrace; is none of the above then the token type is INVALID. The constructor and set method are required to figure out the type of a token string.
Token class is used to store a “token”, which has three members and a few member functions. The members are:
type This field stores the type of the token. Its type is Token type whose definition is given earlier.
token This field stores the token. Its type is string.
priority This field stores the priority of the token when token is
an operator
or a parenthesis. Its type is int. The member functions are:
Token() This default constructor initializes type to INVALID, token to empty string, and priority to -1.
Token(string s) This constructor takes in a string and treats it as a token. It sets the type and token member accordingly. For the current project, it sets the priority member to -1.
void set(string s) This method takes in a string and treats it as a token. It sets the members based on the new token s. Again, for the current project, it sets the priority member to -1.
2
int value() const This method returns the value associated with the token when token type is integer or identifier. In this assignment, if the type is INT, the integer represented as a string stored in token member should be converted to int and returned; if the type is ID, it returns -1; for all other types, it returns -2.
In the future assignment, we will be able to process assignment statement such as x=5 and a symbol table is used to associate x with 5. In this case, for token x, the function returns 5.
void display() const This method outputs the values of the token members in three lines. Each line begins with the member name, followed by “=”, followed by the value. This method is mainly for debugging use. For example, if token string is a12, we have:
type = ID token = a12 (value is -1) priority = -1
Token type get type() const Getter for type member. string get
token() const Getter for token member.
int get priority() const Getter for priority member.
Typically during the tokenizing process of the input string, we get a sequence of characters stored in a string, which is a token. We then use Token class via its constructor or set method to figure out if the token is valid or not and what type of token it is and so on. That is perhaps the most challenging programming (algorithmic) task for the implementation of the Token class. Since an expression is really a sequence of tokens in an abstract sense, the Token class is used by the Expression class to be designed next.
Since none of the member of the Token class involves pointer type and mem- ory allocation, the default copy constructor and assignment operator provided by the compiler should work just fine. We do not need to implement them.
3.2 Expression Class
The Exp type type, which is an enum type and used in the Expression class, is defined as follows:
enum Exp_type {ASSIGNMENT, ARITHMETIC, ILLEGAL};
For the current assignment, we are not required to figure out the type of an expression. We will do that in a later assignment. For the current project, we treat an expression in two ways: 1) as a string and 2) as a sequence of tokens (Token objects stored in a vector) obtained from the string.
Expression class is used to store an “expression”, which has five members and a few member functions. The members are:
3
original This field stores the original or not yet processed “expression”. Its type is string.
tokenized This field stores the expression as a sequence of tokens. Its type is vector.
postfix This field stores the expression as a sequence of tokens in postfix nota- tion provided the expression has arithmetic type. Its type is vector. This member is not used for the current homework assignment but will be used for the last assignment. The set method or con- structors of this assignment should leave it as an empty vector, that is to do nothing.
valid This field indicates whether the expression is a valid expression (no syntax error). Its type is bool. It is not used for the current homework assignment but will be used for the last assignment. The set method or constructors of this assignment should simply set it to false.
type This field indicates whether the type of the expression is ASSIGNMENT or ARITHMETIC expression or ILLEGAL. Its type is Exp type. It is not used for the current homework assignment but will be used for the last assignment. The set method or constructors of this assignment should simply set it to ILLEGAL.
The member functions are:
Expression() This default constructor initializes all fields to empty or false or ILLEGAL.
Expression(const string& s) This constructor takes in a string and treats it as an expression. It tokenizes the input string and sets the original and tokenized members accordingly. And it sets the other members based on the description given earlier (refer to each member description).
void set(const string& s) This method takes in a string and treats it as an expression. It tokenizes the input string and sets the original and tok- enized members accordingly. And it sets the other members based on the description given earlier.
void display() const This method output the values of the expression fields, one field per line. This method is mainly for debugging use.
original=a12=1?ab + -a0123c(a+123)*(ab-(3+4 )) tokenized =
a12;=;1?ab;+;-;a;0123;c;(;a;+;12;3;);*;(;ab;-;(;3;+;4;);); number
of tokens = 24
postfix =
valid = false type = ILLEGAL
4
string get original() const Getter for original member.
vector get tokenized() const Getter for tokenized member.
other methods There are other methods such as to evaluate the expression, to transform the expression, and getters for other fields such as postfix, valid, or type. These methods will be needed for the last assignment. Since we have not studied the related concepts and algorithms, these member functions are omitted.
When we receive a string (maybe from a line of input or a hard coded value within the program), which would be an expression, we use Expression class to figure out if the expression is legal or not and what its type is and so on (use either the non default constructor or set method, and pass the string as its argument).
In order to do the above, the string (perhaps a line of input from the user) gets tokenized first by the Expression class via its constructor or set method. That is perhaps the most challenging programming (algorithmic) task for the current implementation of the Expression class.
Since none of the member of the Expression class involves pointer type and memory allocation, the default copy constructor and assignment operator pro- vided by the compiler should work just fine. We do not need to implement them.
4 Implementation
Please note the similarity between the constructor that takes a string parameter and the set method in Token class. We could implement the set method first. Then the constructor calls the set method to accomplish its tasks. The same can be said for the similarity between the non default constructor and set method in Expression class.
You should implement and test the Token class first. Then use it in the development of the Expresion class. The most challenging method to implement (develop the code for) is the set method of the Expression class. We need to figure out the right algorithm to tokenize. One of the reasons is that we cannot simply use space (a blank character) as a delimiter to tokenize. For instance, in (2+3)*4, we have 7 valid tokens. They are (, 2, +, 3, ), *, 4 and no space betweenthem. Butifitisgivenas( 2 + 3 ) * 4,wecouldusespace. Our method should work for any possible combination of spaces and tokens. You might first assume space is used to separate each token including special tokens and develop a solution. Then consider if you might add space to the given string to use your with space as delimiter solution earlier. This approach is perhaps less efficient than those algorithms that process the string once because it processes a string twice and might double its length. However, it is acceptable for this assignment.
5
For those students who would like a challenge, you might develop an efficient algorithm that tokenizes the string with one pass through the given string.
Token class implementation has .h and .cpp files and the same is true for Expression class. The homework3.cpp file contains the code for testing of both classes.
5 Test and evaluation
Have a main program to test the Token class by sending the constructor and set method many different “tokens” and display the results to see if they are correct or not. You may want to be creative and cover a wide range of possible “tokens” in your testing. Similarly, test the Expression class by sending the constructor and set method many different “expressions” and display the results to see if they are correct or not. You may want to be creative and cover a wide range of possible “expressions” in your testing.
In: Computer Science