Relational Database
You should understand that a relational database is a collection of tables that are related to one another based on a common field. The tables within the database contain a collection of records. The records within the table contain a collection of fields. Each field in the table represents a particular characteristic of the data.
A field, or a collection of fields, is designated as the primary key. The primary key uniquely identifies a record in the table. When the primary key of one table is represented in a second table to form a relationship, it is called a foreign key.
Think about creating a database that will store information about students. Design a table that will contain information about students. You should decide on all the fields (characteristics) they would need to maintain student records. Select a field that would uniquely identify a student (usually a student ID). Explain why the student’s name would not be a good choice for the primary key Next, “fill in” the data for a particular student
Create another table that will store information about the student organizations students participate in (or extracurricular activities, sports, etc.).When you decided what the second table will be, determine the required fields. Most importantly, decide on the common field that will link these tables in a relational database.
In: Computer Science
Skills needed to complete this assignment: linked lists, stacks
PROMPT (In C++)
|
Postfix notation is a mathematical notation in which operators follow their operands; for instance, to add 3 and 4 one would write 3 4 + rather than 3 + 4. If there are multiple operations, operators are given immediately after their second operands; so, the expression written 3-4+5 in conventional notation would be written as 3 4 - 5 + in postfix notation: 4 is first subtracted from 3 and then 5 is added to it. An advantage of postfix notation is that it removes the need for parentheses that are required by infix notation. While 3-4*5 can also be written 3-(4*5), which is difficult from (3-4) * 5. In post fix notation, the former could be written 3 4 5 * -, while the latter could be written 3 4 - 5 * or 5 3 4 - *. |
|
Stacks can be used to evaluate expressions in postfix notations by following these steps: 1. If a number is typed, push it on the stack 2. If an operation is typed, depending on the operation, pop off two numbers from the stack, perform the operation, and push the result back on the stack. |
| You should complete the Stack class and other functions in the template file so that when the user enters an expression in postfix notation, the program calculates and shows the result. In this assignment the user enters one digit positive numbers only, but the result can be any integer. Only basic operations (+, -, /, *) are entered by the user and integer division is used in calculations. User input ends with a semicolon. |
|
Class Stack uses a linked list to implement a stack, it has five public member functions: 1. Default constructor: initializes the stack to an empty stack 2. isEmpty: returns true if the stack is empty and false otherwise 3. push: pushes a new number to the top of stack 4. pop: removes the top of the stack 5. top: returns the value at the top of the stack, does not remove it from the stack. |
TEMPLATE CODE (MUST USE THIS CODE)
DO NOT edit any other code, only write your code in the sections that say /*your code here*/
|
#include <iostream> #include <cstdlib> using namespace std; const char SENTINEL = ';'; |
|
struct Node { int data; Node *link; }; |
|
//precondition: c is initialized //precondition: returns true if c is '+', '-', '*' or '/' bool isOperator(char c); //precondition: o1 and o2 are initialized and op is an operator //precondition: returns op(o1, o2), e.g. if op is '-' then returns o1-o2 int calculate(int o1, in o2, char op); //precondition: c is a digit //precondition: returns the integer value of c int charToInt(char c); |
|
class Stack { public: //default constructor //initializes the stack to an empty stack Stack(); //this is a const function, meaning it cannot change any of the member variables //returns true if the stack is empty, false otherwise bool isEmpty() const; //returns the value at the top of the stack, does not modify the stack, does not check if the stack is empty or not int top() const; //adds data to the top of the stack void push(int data); //removes the top value of stack, does not return it, does nothing if the stack is empty void pop(); private: Note *listHead; //pointer to the head of a linked list }; |
|
int main() { char in; Stack operandStack; cout << "Enter a postfix expression (ending with " << SENTINEL << " and press Enter):\n"; cin >> in; while(in != SENTINEL) { if(isOperator(in)) { //pop two numbers from stack int n1, n2; if(operandStack.isEmpty()) { //print error message /*your code here*/ exit(1); } n2 = operandStack.top(); operandStack.pop(); if(operandStack.isEmpty()) { //print error message /*your code here*/ exit(1); } n1 = operandStack.top(); operandStack.pop(); //push the result of calculation to the top of operandStack /*your code here*/ } else { //push the number to the top of operandStack /*your code here*/ } cin >> in; } //pop a number from the top of stack int result; result = operandStack.top(); operandStack.pop(); if(operandStack.isEmpty()) //nothing left in the stack cout << "\nThe result is: " << result << endl; else // there is still numbers in the stack { //print an error message /*your code here*/ } return 0; } |
|
Stack::Stack() { /*your code here*/ } |
|
bool Stack::isEmpty() const { /*your code here*/ } |
|
int Stack::top() const { /*your code here*/ } |
|
void Stack::pop() { /*your code here*/ } |
|
void Stack::push(int data) { /*your code here*/ } |
|
int calculate(int o1, o2, char op) { /*your code here*/ } |
|
bool isOperator(char c) { return c == '+' || c == '-' || c == '*' || c == '/'; } |
|
int charToInt(char c) { return(static_cast(c) - static_cast('0'));} |
Input/Output Example
|
Example #1: Enter a postfix expression (ending with ; and press Enter): 3 4 - 5 +; The result is: 4 |
|
Example #2 Enter a postfix expression (ending with ; and press Enter): 3 4 - 5; Not enough operators entered! |
|
Example #3 Enter a postfix expression (ending with ; and press Enter): 3 4 - 5 + *; Not enough operands entered for operator: * |
In: Computer Science
In: Accounting
In: Economics
Read the following description and then answer items 12 to 16: Researchers are interested in determining if there is a difference between two exercise regimens (A and B). The researchers think that the regimens may have differential effects on a treadmill test where the participants run to exhaustion.
12.Write the appropriate null hypothesis.
14. What is the dependent variable in this study?
16. Describe what happens if the researchers make a type II error.
In: Math
Explain the need and rationale for a Satellite Control
Network. Then explain its key
functions via its generic block schematic.
In: Mechanical Engineering
Why will the number of suppliers in the tourism industry decrease, and how will this consolidation of suppliers take place?
In: Economics
True or False????
1) The Cp,m of He gas at 10K and 1 atm is larger than 5R/2.
2) ΔH does not depend on temperature.
3) Whether the equilibrium constant of an ideal-gas reaction increases or decreases, as T increases, is determined by the sign of ΔH.
4) Since the concentrations of reactants decreases with time, the rate, r, of a reaction always decreases as time increases.
Need help asap, please write a little explanation/reasoning as to why it is T/or F. Thank you.
In: Chemistry
Fill out the characteristic traits of each order
|
Orders |
Cell division |
Motile or non |
Forms ex) Filamentous, unicellular or colonial |
Number of chloroplasts |
Retention/nourishment of zygote by parent plant |
Habitat: freshwater, brackish, marine |
Reproduction: isogamy, anisogamy or oogamy |
Sporopollenin on zygote wall: present or absent |
Apical growth |
|
Charales & Coleochaetales |
|||||||||
|
Klebsormidiales |
|||||||||
|
Zygnematales |
In: Biology
When a carpenter shuts off his circular saw, the 10.0-inch diameter blade slows from 4452 rpm to zero in 2.50 s .
A) What is the angular acceleration of the blade?
B) What is the distance traveled by a point on the rim of the blade during the deceleration?
C) What is the magnitude of the net displacement of a point on the rim of the blade during the deceleration?
In: Physics
1. What mass (in g) of nickel (II) hexahydrate will you need for this solution? (the molar mass of nickel II hexahydrate is 290.79 g/mol)
2. If you had a 0.500 M stock solution, how many mL will you need from the stock to prepare 25.0 mL of 0.125 M?
Please provide a detailed explanation with your answer.
In: Chemistry
How would I modify this Python Program to include two different if statement structures? "For this program, decisions may include adding different charges to a tables' check based on what the diner orders, and/or deciding when to quit the program, among other possibilities. "
def
display_menu_items():
print("item cost")
print("1.item-1 5")
print("2.item-2 10")
print("3.item-3 15")
print("4.item-4 50")
print("5.item-5 25")
print("6.item-6 2")
print("7.item-7 26")
def main():
print("Enter -1 to quit manager or any other number to
continue")
enter_to_quit=int(input())
if (enter_to_quit==-1):
quit()
print("enter table number")
table_number=int(input())
print("enter no.of diners (maximum limit 4)")
number_of_diners=int(input())
print("select an item and enter -1 to exit")
items=[]
item_number=[]
select=0
ch=[0,5,10,15,50,25,2,26]
display_menu_items()
while ( select is not -1):
items.append(ch[select])
item_number.append(select)
select=int(input())
total_items_cost=0
for i in items:
total_items_cost=total_items_cost+i
print("Total cost without tax
=",total_items_cost)
total_cost=total_items_cost+(total_items_cost/100)*8
print("cost for individual diner
=",total_cost/number_of_diners)
print("total cost with tax = ",total_cost)
print("suggestions for tip 1.10% 2.15% 3.20% 4.25%
")
tip=int(input())
tip_list=[10,15,20,25]
total_tip=tip_list[tip]
total_tip=(total_cost/100)*total_tip
print("table information")
print("table no:- ",table_number)
print("selected items:-")
item_list=["item-1","item-2","item-3","item-4","item-5","item-6","item-7"]
for i in range(1,len(items)):
print(item_list[item_number[i]-1])
print("total cost= ",total_cost)
print("tip= ",total_tip)
print("total cost with tip=
",total_cost+total_tip)
main()
In: Computer Science
Exercise 19-5 Absorption costing and variable costing income statements LO P2
Rey Company’s single product sells at a price of $231 per unit.
Data for its single product for its first year of operations
follow.
| Direct materials | $ | 35 | per unit |
| Direct labor | $ | 43 | per unit |
| Overhead costs | |||
| Variable overhead | $ | 9 | per unit |
| Fixed overhead per year | $ | 286,000 | per year |
| Selling and administrative expenses | |||
| Variable | $ | 33 | per unit |
| Fixed | $ | 230,000 | per year |
| Units produced and sold | 26,000 | units | |
1. Prepare an income statement for the year using
absorption costing
2. Prepare an income statement for the year using
variable costing.
|
|||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||
In: Accounting
At year-end 2018, Wallace Landscaping’s total assets were $2.09 million, and its accounts payable were $390,000. Sales, which in 2018 were $2.4 million, are expected to increase by 25% in 2019. Total assets and accounts payable are proportional to sales, and that relationship will be maintained. Wallace typically uses no current liabilities other than accounts payable. Common stock amounted to $425,000 in 2018, and retained earnings were $205,000. Wallace has arranged to sell $135,000 of new common stock in 2019 to meet some of its financing needs. The remainder of its financing needs will be met by issuing new long-term debt at the end of 2019. (Because the debt is added at the end of the year, there will be no additional interest expense due to the new debt.) Its net profit margin on sales is 6%, and 35% of earnings will be paid out as dividends. What was Wallace's total long-term debt in 2018? Do not round intermediate calculations. Round your answer to the nearest dollar. $ What were Wallace's total liabilities in 2018? Do not round intermediate calculations. Round your answer to the nearest dollar. $ How much new long-term debt financing will be needed in 2019? (Hint: AFN - New stock = New long-term debt.) Do not round intermediate calculations. Round your answer to the nearest dollar. $
In: Finance