Questions
Design an EER diagram for Motor, Inc.: Motor, Inc. is a car dealer that sells both...

  1. Design an EER diagram for Motor, Inc.:

Motor, Inc. is a car dealer that sells both new cars and second-hand cars. You are the technical consultant of Motor Inc. and are currently helping the company to develop a database system. Your job is to draw an ERD to help them design the database.

  • A car has a unique car ID, selling price, make, model, year, color, and car type (used to indicate a car is new or used).
  • Motor Inc. has approximately 100 employees. An employee has an employee ID, job title, gender, salary, list of certifications, date of birth, and age. If an employee is currently married to another employee of Motor Inc., the date of marriage and who is married to whom must be stored; however, no record of marriage is required if an employee’s spouse is not an employee. An employee can handle none to multiple cars depending on his/her job title. A car can be handled by one to at most three employees.
  • There are seven branches at this company, and each of which has a unique name. Each branch is located at different addresses, which contains information such as street, city, state, and zip code. Besides that, each branch has its own email address, and three phone numbers. Each branch has many employees. If there are less than three employees, the branch would be closed. An employee must belong to one and only one branch. Moreover, some employees are the branch heads for these branches. Each branch only needs one branch head, but an employee can manage multiple branches.
  • The company also wants to track its customers’ information. A customer must provide SSN when registered with the company. The company would typically ask a customer to report their household income, and occupation. A customer can visit none or multiple branches, and a branch can be visited by none to multiple customers.

In: Computer Science

1. Describe four cloud-specific security threats. 2. Are there any advantages in not including the MAC...

1. Describe four cloud-specific security threats.

2. Are there any advantages in not including the MAC in the scope of the packet encryption in SSH?

In: Computer Science

2 newer techinques of stream ciphers

2 newer techinques of stream ciphers

In: Computer Science

JAVA StudentId: Consist of the first two characters of the student's first name, student's birth year,...

JAVA

StudentId: Consist of the first two characters of the student's first name, student's birth year, and the last two characters of the last name. For instance, if the student full name is John Doe and birthyear is 1995, then the id will be Jo1995oe. Birthday is using GregorianCalendar.

String firstname

String lastname

GregorianCalendar birthday

In: Computer Science

true or false C++ a.    (T or F)  A member of a class can be a method or...

true or false C++

a.    (T or F)  A member of a class can be a method or an attribute.

b.    (T or F)The private attributes of a class cannot be accessed by the public methods of that class.

c.    (T or F)  The initialization of a variable in the declaration

Ex:  int counter = 0;

is not allowed inside a class definition.

d.    (T or F)  In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition.

e.     (T or F)  A member of a class that was created “on the stack” (locally) can be accessed by using the dot operator (.) followed by the member name.

In: Computer Science

Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of...

Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a Java program that uses a while statement to input the miles driven and gallons used for each trip. The program should calculate and display the miles per gallon obtained for each trip and print the combined miles per gallon obtained for all tankfuls up to this point. Enter miles driven (-1 to quit): 287 Enter gallons used: 13 MPG this trip: 22.076923 Total MPG: 22.076923 Enter miles driven (-1 to quit): 200 Enter gallons used: 10 MPG this trip: 20.000000 Total MPG: 21.173913 Enter the miles driven (-1 to quit): 120 Enter gallons used: 5 MPG this trip: 24.000000 Total MPG: 21.678571 Enter the miles used (-1 to quit): -1

In: Computer Science

9.9 LAB: Artwork label (classes/constructors) Define the Artist class with a constructor to initialize an artist's...

9.9 LAB: Artwork label (classes/constructors)

Define the Artist class with a constructor to initialize an artist's information and a print_info() method. The constructor should by default initialize the artist's name to "None" and the years of birth and death to 0. print_info() should display Artist Name, born XXXX if the year of death is -1 or Artist Name (XXXX-YYYY) otherwise.

Define the Artwork class with a constructor to initialize an artwork's information and a print_info() method. The constructor should by default initialize the title to "None", the year created to 0, and the artist to use the Artist default constructor parameter values.

class Artist:
def __init__(self,name, birth_year, death_year):
self.name = 'None'
self.birth_year = 0.0
self.death_year = 0.0

def print_info(self):
if death_year == -1:
print('Artist:', name,'born' ,birth_year)
else:
print('Artist:', name,'(',birth_year,'-',death_year,')')
  
class Artwork:
  def __init__(self,title,year_created,artist):
self.title = 'none'
self.year_created = 0.0
self.artist = Artist(name,birth_year,death_year)

def print_info(self):
print('Title:',end= ' ')
print(title,end= ' ')
print(year_created)

if __name__ == "__main__":
user_artist_name = input()
user_birth_year = int(input())
user_death_year = int(input())
user_title = input()
user_year_created = int(input())

user_artist = Artist(user_artist_name, user_birth_year, user_death_year)

new_artwork = Artwork(user_title, user_year_created, user_artist)
  
new_artwork.print_info()

Whats wrong with my code? It keeps saying Title and Artist arn't defined. And it won't print class artist.

In: Computer Science

Create, test, and validate an HTML document that defines a table with columns for state, state...

Create, test, and validate an HTML document that defines a table with columns for state, state bird, state flower, and state tree. There must be at least five rows for states in the table.

In: Computer Science

I have a error code, for my C++ class, using Putty include <iostream> using namespace std;...

I have a error code, for my C++ class, using Putty

include <iostream>

using namespace std;

int main()
{
char answer;
char grade;

cout << "Are you taking a class (enter y, Y, N or N): " << endl;
cin >> answer;

if (answer == 'N' || 'n');
{
cout << "Thanks for using the system" << endl;
}

else if (answer == 'Y' || 'y');
{
cout << "Enter a letter grade (A, B, C, D, or F): " << endl;
cin >> grade;


switch(grade);
{
case 'A':
cout << "Great Job!" << endl;
break;

case 'B':
cout << "Great Job!" << endl;
break;

case 'C':
cout << "You're doing alright." << endl;
break;

case 'D':
cout << "You can improve." << endl;
break;

case 'F':
cout << "You can improve." << endl;
break;

default:
cout << "Invalid grade." << endl;
break;
}
}

else
{
cout << "Invalid input" << endl;
}

return 0;
}


In: Computer Science

JAVA Design a class named Person and its two derived classes named Student and Employee. Make...

JAVA

Design a class named Person and its two derived classes named Student and Employee. Make Faculty and Staff derived classes of Employee. A person has a name, address, phone number, and e-mail address. A student has a class status (freshman, sophomore, junior, or senior). An employee has an office, salary, and datehired. Define a class named MyDate that contains the fields year, month, and day. A faculty member has office hours and a rank. A staff member has a title. Define an abstract toString function in the Person class and override it in each class to display the class name and the person’s name. Implement the classes. Write a test program that creates a Person, Student, Employee, Faculty, and Staff, and invokes their toString() functions.

In: Computer Science

Write a program that create a single linked list and consist of all the necessary functions...

Write a program that create a single linked list and consist of all the necessary functions to do the following

  1. Add an element to the list, insertion position can be anywhere in the list (first, last and middle)
  2. delete an element from the list, deletion position can be anywhere in the list (first, last and middle)

Note:

You need to add proper documentation to your programs and you need to include the output of each program

C++

In: Computer Science

1- The average is a way to characterize a collection of values. When the values refer...

1- The average is a way to characterize a collection of values. When the values refer to a fixed item (for example the number of oranges per tree) and we want to find the average number of oranges, the _______________ mean is appropriate.

2- The ___________________________ mean is used when we want to preserve the effect on the mean of a percentage change in a value independent of the values magnitude.

3- The word size of the IAS  computer (remember one instruction word contains the left and right instructions) is ________ bits.

In: Computer Science

Using C++ write a program to calculate the amount a customer should pay in a self...

Using C++ write a program to calculate the amount a customer should pay in a self checkout counter for his purchases in a bagel shop. The products sold are everything bagels, garlic bagels, blueberry bagels, cream cheese, and coffee. Using "doWhile loops" write the program to display the menu of the Bagel shop. Make the user buy multiple items of different choices. Finally display the total amount for the purchases. Below is my current code to work with. Please add comments to help me understand the code.

//This program implements bagel shop PoS
#include <iostream>
#include <iomanip>

using namespace std;

const float EVERY_BAGEL_COST = 1.99;
const float BLUE_BAGEL_COST = 1.99;
const float GARLIC_BAGEL_COST = 1.99;
const float CREAM_CHEESE_COST = 2.99;
const float COFFEE_COST = 3.99;

int main()

{

    char choice;
    int cnt;

    double total_charges = 0.0;
    double charges_every = 0.0;
    double charges_blueberry = 0.0;
    double charges_garlic = 0.0;
    double charges_cream = 0.0;
    double charges_coffee = 0.0;
    cout << fixed << showpoint << setprecision(2);

    cout << "Please pick one item from the menu:" << endl
    << endl;
    cout << "Enter A for Everything Bagel" << endl;
    cout << "Enter B for Blueberry Bagel" << endl;
    cout << "Enter C for Garlic Bagel" << endl;
    cout << "Enter D for Cream Cheese" << endl;
    cout << "Enter E for coffee" << endl;
    cout << "Enter F for quit" << endl
    << endl;

    do

    {
    // get the choice from A to F
    cout << "\nEnter your choice of food: ";
    cin >> choice;

    switch (choice)

    {

    case 'A':

    cout << "Enter number of items : ";
    cin >> cnt;

    charges_every += (EVERY_BAGEL_COST * cnt);

    break;

    case 'B':

    cout << "Enter number of items : ";
    cin >> cnt;

    charges_blueberry += (BLUE_BAGEL_COST * cnt);

    break;

    case 'C':

    cout << "Enter number of items : ";
    cin >> cnt;

    charges_garlic += (GARLIC_BAGEL_COST * cnt);

    break;

    case 'D':

    cout << "Enter number of items : ";
    cin >> cnt;

    charges_cream += (CREAM_CHEESE_COST * cnt);

    break;

    case 'E':

    cout << "Enter number of items : ";
    cin >> cnt;

    charges_coffee += (COFFEE_COST * cnt);

    break;

    case 'F':

    break;

    default:

    cout << "Enter a choice between A to F" << endl;

    }

    } while (choice != 'F');

    total_charges = charges_every + charges_coffee +

    charges_cream + charges_blueberry +

    charges_garlic;

    cout << "\nEverything Bagel : $" << charges_every << endl;

    cout << "\nBlueberry Bagel : $" << charges_blueberry << endl;

    cout << "\nGarlic Bagel : $" << charges_garlic << endl;

    cout << "\nCream Cheese : $" << charges_cream << endl;

    cout << "\ncoffee : $" << charges_coffee << endl;

    cout << "\nTotal charges are: $" << total_charges << endl;

    cout << endl;


    return 0;
}

In: Computer Science

1. Data in Java: Primitives and Objects In this section, we’ll build a class that is...

1. Data in Java: Primitives and Objects In this section, we’ll build a class that is composed of both primitives and objects. Java has classes to help in converting from primitives to objects (for example an int to an Integer) and vice-versa. Let’s start by building a small class used to represent a single concept such as a Car or Vehicle. Make a new Java project and and create a new class called “Car”. Cars should define primitives for things like odometers, etc., and Strings for make and model. Inside your Car class but outside of any method, define three (instance) variables for the odometer, make, and model. Write a main that builds 2 cars and prints them out. (Hint: Car c1 = new Car(); and System.out.println(c1.toString());.)

2. Variable Scope in Java: Local and Class-Level Lets practice building classes again and defining two variables: one local and one with class-level scope. Prove to yourself that you can access the class-level variable throughout the class in which it’s defined. Then, try to access the local variable from a method other than the one in which it’s defined. Finally, look inside of Rectangle.java and identify at least 4 instance variables (class-level) and at least 2 local variables. Indicate these using comments.

3. This (the Implicit Parameter) Take a class you’ve already built (or build the Car Class described in the “Data in Java” section) and build an object from that class. Observe the address of that object in main by using println with toString(). Next, from a method inside the class, print out the address of the “this” object using println. Call that method on the object you’ve just built, and explain why the two addresses are the same.

4. Access Modifiers: Public and Private Build yet another simple class (say, a Point or Pair). Then, create another (separate, distinct) class that is to be the “driver” for this example (just like the driver above). In your driver, build an object of the Point class and try to access a method declared as public. Now, on the same vehicle object, try to call a method declared as private. What message does Java print out? Next, declare some class-level data item as public (an int, say), and declare another class-level data item as private. In your driver’s “main”, try again to access these two data items – what message does the Java compiler display now?

5. Accessors and Mutators (or, Getters and Setters) Each of these sections encourages you to practice building small classes, and we’ll continue that pattern here. Construct a simple class used to store the time or date. Add a field for minute, second, and hour, but make these class-level variables private. So that our class can be used by external clients, we need to declare some public methods for use with our private data. Build two methods for each data item: one to get the value of the data item, and one to set the value of the data item. See the getters and setters defined in the Rectangle class for examples of these getters & setters.

6. Overriding toString() (and equals()) Build a simple class to represent a Vehicle (or reuse your Car class above). In a main, build an object of that class, and print out the object using System.out.println(). Notice that this simply reports the memory address of the object in question, and we’d like to do something more useful. To replace (or override) the toString (or equals) function, first see the examples defined in the NewAndReviewExamples.java file for both toString and equals. Now, build a toString function that prints out the make, model, and odometer reading for a vehicle object.

7. Overloading Methods Check out the Rectangle class constructors to see an example of overloading – defining multiple methods with the same name. Now build a SquareSomething class, with all static functions, whose purpose is to take an int, a double, or a float, and report back the square of the number (returning the correct type). This will mean your square class has three functions ( all named “square”) that each take a different type of data as input (int, double, float). Your square function that takes a double should return a double as well. This is how the println() method accomplishes such flexibility – you can hand it an int, a string, a double, a float, etc. and it simply prints the data. How it does so is by overloading the println() method to provide a different function for each possible type of input.

8. Constructors as Methods First, check out the set of constructors provided for you in the Rectangle class. Notice how they are overloaded (meaning many methods with the same name, but different with regards to input) to provide flexibility for users of this class. Add to your Car class two constructors – one to take a string make, the other to take two strings: a make and a model. Test these constructors by building multiple Cars in your main() driver, calling each constructor in turn.

In: Computer Science

Envision an algorithm that when given any positive integer n, it will print out the sum...

Envision an algorithm that when given any positive integer n, it will print out the sum of the squares from 1 to n.

E.g. given 4 the algorithm would print 30 (because 1 + 4 + 9 + 16 = 30) You can use multiplication denoted as * in your solution and you do not have to define it (e.g. 2*2=4)

Write pseudocode for this algorithm using iteration (looping).

Create a flow chart

Implement solution from flowchart in Python at http://www.codeskulptor.org/

In: Computer Science