Questions
Task 6.2.1. For each publisher with more than $2000 in purchase orders, list the customer id,...

Task 6.2.1. For each publisher with more than $2000 in purchase orders, list the customer id, name, credit code, and total of the orders. Use a WHERE clause to perform the join across the five required tables.

DROP TABLE publishers;
DROP TABLE po_items;
DROP TABLE bookjobs;
DROP TABLE items;
DROP TABLE pos;

CREATE TABLE publishers (
cust_id CHAR(3) NOT NULL,
name CHAR(10),
city CHAR(10),
phone CHAR(8),
creditcode CHAR(1),
PRIMARY KEY (cust_id)
);

CREATE TABLE bookjobs (
job_id CHAR(3) NOT NULL,
cust_id CHAR(3),
job_date DATE,
descr CHAR(10),
jobtype CHAR(1),
PRIMARY KEY (job_id),
FOREIGN KEY (cust_id) REFERENCES publishers (cust_id)
);

CREATE TABLE pos (
job_id CHAR(3) NOT NULL,
po_id CHAR(3) NOT NULL,
po_date DATE,
vendor_id CHAR(3),
PRIMARY KEY (job_id, po_id),
FOREIGN KEY (job_id) REFERENCES bookjobs (job_id)
);

CREATE TABLE items (
item_id CHAR(3) NOT NULL,
descr CHAR(10),
on_hand SMALLINT,
price DECIMAL(5,2),
PRIMARY KEY (item_id)
);

CREATE TABLE po_items (
job_id       CHAR(3) NOT NULL,
po_id       CHAR(3) NOT NULL,
item_id       CHAR(3) NOT NULL,
quantity     SMALLINT,
FOREIGN KEY (job_id) REFERENCES bookjobs (job_id),
FOREIGN KEY (job_id, po_id) REFERENCES pos (job_id, po_id),
FOREIGN KEY (item_id) REFERENCES items (item_id)
);

In: Computer Science

In Munson’s Unsuitable, why does Munson argue that the transplant team did not deceive Rob? Do...

In Munson’s Unsuitable, why does Munson argue that the transplant team did not deceive Rob? Do you agree with Munson? Explain why or why not. If one was to argue that the transplant team deceived Rob, do you think the deception was justified? Explain why or why not.

In: Psychology

EER diagram Draw the EER diagram for the following systems. Persons in an organization are employees...

EER diagram

Draw the EER diagram for the following systems.

Persons in an organization are employees or customers or visitors. Employees have computers.
The IT department of the company builds all its computers from components. Each computer
consists of several components like graphic cards, network cards, mother boards, memory
capsules, hard discs, etc. When a component is bought from a supplier it is given an ID number.
The finished computer is placed in a room, which may contain several computers.
Prepare an EER diagram using only the concepts listed above, that shows, as necessary,
entities, relationships, specializations and generalizations. Show the most likely cardinalities
(min, max) for all relationships.

In: Computer Science

JAVAFX You will create a GUI that solves the quadratic equation shown below. Part 1: Create...

JAVAFX

You will create a GUI that solves the quadratic equation shown below.

  • Part 1: Create the GUI 25%

  1. Create a user interface that offers the user a space to enter values for A, B, and C. (Use a different text field for each.) Be sure to either set the text in these so that the user knows which is for A, which is for B, and which is for C or add labels so that it is clear.

  1. Create a button that the user will press to generate the answers. (Or make sure it’s clear how the user should submit their values in another way.)

  1. Create a node that will display both X values that result from the math. This can be 2 labels, a single label, a Text object… whatever.

  1. Put these in a simple layout and make sure everything displays before moving on. Add enough styling so that things look neat.

  • Part 2: Add EventHandler 75%

  1. After your nodes are created but before your scene and stage commands, add

an event handler. I would like it to be an ActionEvent type.

  1. Inside of the handle method, you will get the values from A, B, and C and solve for both X values. Make sure you store A, B, and C as doubles, not integers. Display the two answers that you get back to the GUI. There will be times where X will have no values. Handle this as addressed below.

  1. Be sure to check first to see if A has a 0 in it. If it does, the math should not be performed and the user should be informed that A cannot be 0.  

  1. Also check to see if the discriminant is negative. This is the part that occurs under the square root. We know that if it’s negative, then finding the square root of it will result in an imaginary number. Your program won’t crash if this happens but Java will display either ??? or NaN. Have the program check the discriminant before continuing with the math and display a custom message if the discriminant is negative.

  1. The only acceptable printed outcomes are: a message saying A cannot be 0; a message saying that the inputted values will result in an imaginary number; or the two X values that result from the equation.  

  1. One final task: Make sure both X answers are formatted to three decimal places. You can use String.format(), which was covered in Lab 1, the DecimalFormat class, or any other means for displaying 3 decimal places accurately.

Test values are below.

A: 3.0, B: 5.0, C: -2.0 → X = -2.000 and X = 0.333

A: -3.0, B: 10.0, C: 8.0 → X = 4.000 and X = -0.666

In: Computer Science

In early January 2017, NewTech purchases computer equipment for $273,000 to use in operating activities for...


In early January 2017, NewTech purchases computer equipment for $273,000 to use in operating activities for the next four years. It estimates the equipment’s salvage value at $26,000.

rev: 07_27_2017_QC_CS-94103

Exercise 8-7 Straight-line depreciation LO P1

Prepare a table showing depreciation and book value for each of the four years assuming straight-line depreciation.

Prepare a table showing depreciation and book value for each of the four years assuming double-declining-balance depreciation.

In: Accounting

I am trying to create a program That works with two other programs in c++ and...

I am trying to create a program That works with two other programs in c++ and a makefile.

Only Shape.cpp can be modified. and it needs to work on a unix machine. It isn't running on my machine. And gives me an error message that it doesn't recomize cin and endl

The program will accept a character and an X and Y coordinate. Dependign on the Charactor, It will then tell you what Cells that shape occupies.

I almost have the program working, but I am getting several bugs. Can someone fix the Shape.cpp file, and tell me what they did to fix it?

Thanks.

all: testShape

CXXFLAGS=-g -Wall

Shape.o: Shape.cpp Shape.h
testShape.o: testShape.cpp Shape.h

testShape: testShape.o Shape.o
   $(CXX) -o $@ $^ $(LDFLAGS)

clean:
   rm -f *.o testShape

// end of makefile

//
// testShape.cpp
//DO NOT MODIFY

#include "Shape.h"
#include
#include
using namespace std;

int main()
{
Shape *t1, *t2;
char ch;
int x,y;

try
{
cin >> ch >> x >> y;
t1 = Shape::makeShape(ch,x,y);
t1->print();
cin >> ch >> x >> y;
t2 = Shape::makeShape(ch,x,y);
t2->print();
t2->move(1,-1);
t2->print();

if ( t1->overlap(*t2) )
cout << "overlap" << endl;
else
cout << "no overlap" << endl;

delete t1;
delete t2;
}
catch ( invalid_argument &exc )
{
cout << exc.what() << ": " << ch << " " << x << " " << y << endl;
}
}

//end of testshape

//
// Shape.h
// DO NOT MODIFY

#ifndef SHAPE_H
#define SHAPE_H
class Shape
{
public:
virtual ~Shape(void);
virtual char name(void) const = 0;
virtual int size(void) const = 0;
void print(void) const;
void move (int dx, int dy);
bool overlap(const Shape &t) const;
static Shape *makeShape(char ch,int posx,int posy);
protected:
int *x, *y;
};

class O: public Shape
{
public:
O(int posx, int posy);
virtual char name(void) const;
virtual int size(void) const;
};

class I: public Shape
{
public:
I(int posx, int posy);
virtual char name(void) const;
virtual int size(void) const;
};

class L: public Shape
{
public:
L(int posx, int posy);
virtual char name(void) const;
virtual int size(void) const;
};

class S: public Shape
{
public:
S(int posx, int posy);
virtual char name(void) const;
virtual int size(void) const;
};

class X: public Shape
{
public:
X(int posx, int posy);
virtual char name(void) const;
virtual int size(void) const;
};

class U: public Shape
{
public:
U(int posx, int posy);
virtual char name(void) const;
virtual int size(void) const;
};
#endif

//end of shape.h

// THIS IS THE FILE I NEED HELP WITH Shape.cpp

#ifndef SHAPE_CPP
#define SHAPE_CPP

#include "Shape.h"

// Constructor for O
O::O(int posx, int posy)
{
   x = new int[1];
   y = new int[1];

   x[0] = posx;
   y[0] = posy;
}

char O::name() const
{
   return 'O';
}

int O::size() const
{
   return 1;
}

// Constructor for I
I::I(int posx, int posy)
{
   x = new int[2];
   y = new int[2];

   x[0] = x[1] = posy;
   y[0] = posy;
   y[1] = posy+1;
}

char I::name() const
{
return 'I';
}
int I::size() const
{
   return 2;
}


// Constructor for L
L::L(int posx, int posy)
{
   x = new int[3];
   y = new int[3];

   x[0] = x[2] = posx;
   y[0] = y[1] = posy;

   x[1] = posx+1;
   y[2] = posy+1;
}

char L::name() const
{
   return 'L';
}
int L::size() const
{
   return 3;
}

// Constructor for S
S::S(int posx, int posy)
{
   x = new int[4];
   y = new int[4];

   x[0] = posx;
   x[1] = posx+1;
   x[2] = posx+2;
   x[3] = posx+3;

   y[0] = y[1] = posy;
   y[2] = y[3] = posy+1;
}

char S::name() const
{
   return 'S';
}
int S::size() const
{
   return 4;
}

/*
   Constructor for X
   the constructor initialises the cell co-ordinates

   X is spread across 5 cells

           *
       *   * *
           *

   The Numbering of cells is done from bottom-top and left to right
   (x[0], y[0]) is the position of bottom most cell
   (x[1], y[1]) is the position of left most cell of the 2nd row from bottom
   (x[2], y[2]) is the position of the middle cell in the 2nd row from bottom
   ....
*/
X::X(int posx, int posy)
{
   x = new int[5];
   y = new int[5];
   x[0] = x[2] = x[4] =posx;
   x[1] = posx-1;
   x[3] = posx+1;

   y[0] = posy;
   y[1] = y[2] = y[3] = posy+1;
   y[4] = posy+2;
}

char X::name() const
{
   return 'X';
}
int X::size() const
{
   return 5;
}

// Constructor for U
U::U(int posx, int posy)
{
   x = new int[7];
   y = new int[7];
   x[0] = x[3] = x[5] = posx;
   x[1] = posx+1;
   x[2] = x[4] = x[6] = posx+2;

   y[0] = y[1] = y[2] = posy;
   y[3] = y[4] = posy+1;
   y[5] = y[6] = posy+2;
}

char U::name() const
{
   return 'U';
}
int U::size() const
{
   return 7;
}

void Shape::print() const
{
   //get the size of the object i.e no of cells across which this is spread
   int sz = size();

   // get the type of object i.e O, L, X...
   char n = name();

   cout<

   //Print all the cell co-ordinates for this object
   for(int i = 0 ; i < sz ; i++)
   {
       cout<<"("<        if(i != sz-1)
           cout<<" ";
   }
   cout< }

void Shape::move(int dx, int dy)
{
   int sz = size();

   for(int i = 0 ; i < sz ; i++)
   {
       x[i] += dx;
       y[i] += dy;
   }

}

/*
   This function checks if the object(this) and t overlap

   * First add all the cells of t to a set
   * the iterate over all the cells of (this) and check
   if they are already present in the set
   * If any of the cell is already present , objects overlap
   and return true
*/
bool Shape::overlap(const Shape &t) const
{
   set > st;
   int sz1 = t.size();
   int sz2 = size();

   for(int i = 0 ; i < sz1 ; i++)
   {
       st.insert(make_pair(t.x[i], t.y[i]));
   }

   for(int i = 0 ; i < sz2 ; i++)
   {
       if(st.find(make_pair(x[i], y[i]))!= st.end())
           return true;
   }
   return false;
}

/*
   This function creates a new object of type ch
*/
Shape * Shape::makeShape(char ch, int posx, int posy)
{
   if(ch == 'O')
       return new O(posx, posy);
   else if(ch == 'I')
       return new I(posx, posy);
else if(ch == 'L')
   return new L(posx, posy);
else if(ch == 'S')
   return new S(posx, posy);
else if(ch == 'X')
   return new X(posx, posy);
else if(ch == 'U')
   return new U(posx, posy);
else
   throw std::invalid_argument("Invalid syntax.");
}

// base class virtual destructor
Shape::~Shape()
{
   delete [] x;
   delete [] y;
}
#endif

In: Computer Science

what are the importance of setting policy priorities for budgeting purposes

what are the importance of setting policy priorities for budgeting purposes

In: Operations Management

Last week we observed a shopkeeper going about their daily routine and made some observations. This...

Last week we observed a shopkeeper going about their daily routine and made some observations. This week we will collect some user requirements either through an interview or a questionnaire (Your choice although the interview is much faster).

Find out what the shopkeepers challenges are, how their work can be made easier (think stock keeping, accounting, sales, ordering the possibilities are endless). Concentrate on one area and using the information you collect extract the requirements for the system. Using this information, create a persona for the shopkeeper.

  1. Proposed system per your understanding
  2. Extracted Requirements
  3. Shopkeeper Persona - Should have at a minimum: Photo, User Quote(If any), Bio, Personality, Challenges (Frustrations) and key goals

In: Computer Science

What is the nocebo effect? Why does the nocebo effect create a moral dilemma in the...

What is the nocebo effect? Why does the nocebo effect create a moral dilemma in the informed consent procedure? According to Cohen, when do doctors have good reason to NOT disclose potential side effects of treatments to their patients? Do you agree? Explain why or why not.

In: Psychology

Write the c++ program of Bisection Method and False Position Method and newton Raphson method in...

Write the c++ program of Bisection Method and False Position Method and newton Raphson method in a one program using switch condition .Like :

cout<<"1.Bisection Method \n 2.False Position Method\n3.Newton Raphson method"<<endl; if press 1 then work Bisection Method code if press 2 then workFalse Position Method if press 3. work Newton Raphson method .so please writhe the code in c++ using switch case.and the equation given down consider the equation in the given.Note: Must showt the all the step of output all the iteration step shown in the program .in program must shown all the step of iteration result like every iteration x1,x2,x3 must be shown in program.

f(x)=3x-cosx-1;

Please in every itaration must be shown the output then finally Got the root

In: Computer Science

Write a function that has two parameters as input: the list of subtitles and the separator...

Write a function that has two parameters as input: the list of subtitles and the separator string. On the output it returns a single string being a combination of input string separated by a separator.

Example:

call: combine (List("This","is", "string"),"-")

result: "This-is-string"



In: Computer Science

How does the involvement of paid staff and volunteers in program development enhance a volunteer-based program?

How does the involvement of paid staff and volunteers in program development enhance a volunteer-based program?

In: Operations Management

Give an example for each type of market.

Give an example for each type of market.

In: Operations Management

Q3# Briefly provide the answers to the following questions? (a) Define overfitting. (b) List causes of...

Q3# Briefly provide the answers to the following questions?

(a) Define overfitting.

(b) List causes of overfitting in neural networks.

(c) How can overfitting be avoided in neural nertworks?

In: Computer Science

(Automobile leasing problem) Sundown Rent-a-Car, a large automobile rental agency operating in the Midwest, is preparing...

(Automobile leasing problem) Sundown Rent-a-Car, a large automobile rental agency operating in the Midwest, is preparing a leasing strategy for the next six months. Sundown leases cars from an automobile manufacturer and then rents them to the public on a daily basis. A forecast of the demand for Sundown’s cars in the next six months follows: MONTH MARCH APRIL MAY JUNE JULY AUGUST Demand 420 400 430 460 470 440 Cars may be leased from the manufacturer for either three, four, or five months. These are leased on the first day of the month and are returned on the last day of the month. Every six months the automobile manufacturer is notified by Sundown about the number of cars needed during the next six months. The automobile manufacturer has stipulated that at least 50% of the cars leased during a six-month period must be on the five-month lease. The cost per month on each of the three types of leases are $420 for the three-month lease, $400 for the four-month lease, and $370 for the five-month lease. Currently, Sundown has 390 cars. The lease on 120 cars expires at the end of March. The lease on another 140 cars expires at the end of April, and the lease on the rest of these expires at the end of May. Use LP to determine how many cars should be leased in each month on each type of lease to minimize the cost of leasing over the six-month period. How many cars are left at the end of August?

Show objective function and constraints

In: Operations Management