Questions
IS 633 Assignment 1 Due 9/27 Please submit SQL statements as a plain text file (.txt)....

IS 633 Assignment 1

Due 9/27

Please submit SQL statements as a plain text file (.txt). If blackboard rejects txt file you can submit a zipped file containing the text file. Word, PDF, or Image format are not accepted. You do not need to show screen shot. Make sure you have tested your SQL statements in Oracle 11g.

Problem 1. Please create the following tables for a tool rental database with appropriate primary keys & foreign keys. [30 points]

Assumptions:

  1. Each tool belongs to a category.
  2. Each category may have a parent category but the parent category should not have parent category (so at most two levels). E.g., a Tool A belongs to electric mower, and electric mower belongs to mower. Mower has no parent category.
  3. Each tool can be rented at different time units. The typical time units are hourly, daily, and weekly. There is a different price for each time unit and tool combination. E.g., tool A may be rented at $5 per hour, $30 per day, and $120 per week.
  4. Each customer can rent a tool for a certain number of time units. If the tool is returned late a late fee will be charged.

  

The list of tables is:

Tables:

Cust Table:

cid, -- customer id

cname, --- customer name

cphone, --- customer phone

cemail, --- customer email

Category table:

ctid, --- category id

ctname, --- category name

parent, --- parent category id since category has a hierarchy structure, power washers, electric power washers, gas power washers. You can assume that there are only two levels.

Tool:

tid, --- tool id

tname, --- tool name

ctid, --- category id, the bottom level.

quantity, --- number of this tools

Time_unit table allowed renting unit

tuid, --- time unit id

len, --- length of period, can be 1 hour, 1 day, etc.

min_len, --- minimal #of time unit, e.g., hourly rental but minimal 4 hours.

Tool_Price:

tid, --- tool id

tuid, --- time unit id

price, -- price per period

Rental:

rid, --- rental id

cid, --- customer id

tid, --- tool id

tuid, --- time unit id

num_unit, --- number of time unit of rental, e.g., if num_unit = 5 and unit is hourly, it means 5 hours.

start_time, -- rental start time

end_time, --- suppose rental end_time

return_time, --- time to return the tool

credit_card, --- credit card number

total, --- total charge

Problem 2. Insert at least three rows of data to each table. Make sure you keep the primary key and foreign key constraints. [20 points]

Problem 3. Please write ONE SQL statement for each of the following tasks using tables created in Problem 1. You can ONLY use conditions listed in the task description. Task 1 and 2 each has 5 points. Tasks 3 to 6 each has 10 points. [50 points]

Task 1: return IDs of rentals started in August 2019.

Hint: function trunc(x) converts x which is of timestamp type into date type.

Task 2: Return names and quantity of all tools under the category carpet cleaner. You can assume there is no subcategory under carpet cleaner

Task 3: return number of rentals per customer along with customer ID in the year 2019 (i.e., the start_time of the rental is in 2019).

Task 4: return IDs of tools that has been rented at least twice in 2019.

Task 5: return the price of renting a small carpet cleaner (the name of the tool) for 5 hours.

Hint: find unit price for hourly rental and then multiply that by 5.

Task 6: return names of customers who have rented at least twice in year 2019 (i.e., rental’s start time is in 2019).

In: Computer Science

implement the reverse() method that changes the ordering of the items within a doublylinkedlist class. don't...

implement the reverse() method that changes the ordering of the items within a doublylinkedlist class. don't return anything and make sure it executes without errors on lists with no items or one item

example:

fruits = DoublyLinkedList()
fruits.append('apple')
fruits.append('banana')
fruits.append('cherry')
for i in fruits:
    print(i)
>> apple
>> banana
>> Charlie

fruits.reverse()
for i in fruits:
    print(i)
>> cherry
>> banana
>> apple

In: Computer Science

I am trying to tokenize a string using a function by passing the char string[] and...

I am trying to tokenize a string using a function by passing the char string[] and char *pointer[100]. While I have working code inside the int main(), I am having trouble actually declaring the parameters for the function.

I know how to pass the char array (char string[]), but not how to pass the char pointer array (char *pointer[100]).

This is my code below:

int main() {

   // Declare variables
   char str[] = "this is a test only - just a test";       // char array
   char *ptr1[100], *ptr2[100];                           // Creates two pointers

   function1(str, *ptr1[100]);

   return 0;
}

void function1(char str[], char *ptr1[100]) {

   int i = 0;
       int count = 0;

       // Declaration of strtok: char *strtok(char *str, const char *delim)
       // It breaks *str into a series of tokens using *delim
       char *p = strtok (str, " ");

       // Stores each piece into the array
       while (p != NULL) {
           ptr1[i++] = p;
           p = strtok(NULL, " ");
           count++;
       }

       // Prints the array
       for (i = 0; i < count; ++i) {
           printf("%s\n", ptr1[i]);
       }
}

For my code, it works if I get rid of the function and simply place the code in my int main(). Other times, I manipulated the second parameter and it started to work. However, the return values from 'p' transformed into integers from the "ptr1[i++] = p" portion of the code.

In: Computer Science

Lab Assignment 1 2020 – 2021 Fall, CMPE 211 Fundamentals of Programming II STUDENT AFFAIRS DUE...

Lab Assignment 1

2020 – 2021 Fall, CMPE 211 Fundamentals of Programming II

STUDENT AFFAIRS

DUE DATE: 14.10.2020 – 23:59

In this lab, we will create a model course registration application. Please check out the example run of the program first.

You are asked to implement the classes;

  • Student.
  • Course.
  • Grade.
  • StudentAffairs. It will contain the main method.

The commands and their arguments for this week are:

  • createCourse <courseCode> <capacity> <day> <studentCount> <averageGrade>
  • createStudent <studentName> <studentID>
  • addGradeStudent <studentID> <letterGrade>
  • addGradeCourse <courseCode> <grade>
  • removeGradeStudent <studentID> <letterGrade>
  • removeGradeCourse <courseCode> <grade>
  • averageGradeStudent <studentID>
  • averageGradeCourse <courseCode>
  • printGradesStudent <studentID>
  • Q

where letterGrade can be (AA, BA, BB, CB, CC, DC, DD, F, FX).

In order to store the students and the courses, create 2 Arrays for them in the StudentAffairs class. You need to take commands from user until you see the “Q” command. For this purpose, you need to create while loop. Stopping condition of this command is “Q” command from user. Each command needs to be differentiated either if clause or switch case. After each command differentiated, specific information subcommands will be taken that belongs the specific main command parsed with space. Each command has specific things to do and command line output that will inform the user. Look at the demo video for better understanding. However, at first you need to create Student, Course and Grade classes.

Grade Class

Data Declarations:

  • double grade Methods:
  • Constructor : Constructor gets the letter grade and converts it to number representation with the method called convertLetter than holds that value within the grade variable.
  • double convertLetter (String letterGrade) : Gets letter grade and returns numeric version of it. (AA=4.0, BA=3.5, BB=3.0, CB=2.5, CC=2.0, DC=1.5, DD=1.0, F=0, FX=0)
  • Create Getters and Setters.

Student Class

Data Declarations:

  • Grade[] Grades : Holds the Grades of the Student.
  • String Name, String StudentID, int GradeCount Methods:
  • Constructor : Constructor gets the name of the student and the student ID. Grade array should be initialized here as well (array size is 4). GradeCount is 0 initially.
  • boolean addGrade (String letterGrade) : Adding a grade to the Grade array. Returns false if the gradeCount equals to the array size. Increase gradeCount if the grade succesfully added to the array and method should returns true.
  • boolean removeGrade (int index) : Remove a grade from the Grade array with given specific index. Returns false if the gradeCount equals to the 0. Decrease gradeCount if the grade successfully removed from the array and method should returns true. Don’t forget to be shifting array after deleting element.
  • String printGrades() : Returns all grades of student.
  • double averageGrade() : Returns average grades of student.
  • String toString( ) : The format is “<name>(<ID>)”.
  • Create Getters and Setters.

Course Class

Data Declarations:

  • String CourseCode, day
  • int studentCount, Capacity
  • double averageGrade Methods:
  • Constructor : Gets all of the data declarations.
  • boolean addGrade (double grade) : Adding a grade to the course. That means student count needs to increase by one. And average grade needs to be calculated. Return false if the capacity reached.
  • boolean removeGrade (double grade) : Removing a grade from the course. That means student count needs to decrease by one. And average grade needs to be calculated. Return false if the student count is already 0.
  • String toString( ) : The format is “<courseCode>”.
  • Create Getters and Setters.

In: Computer Science

A company has changed their web hosting policy and now requires SSL certificates on all web...

A company has changed their web hosting policy and now requires SSL certificates on all web servers. Users are reporting that they can no longer access an internal website. Which of the following commands should the administrator run to determine if port 443 is listening? (Select two.)

A. traceroute

B. telnet

C. netstat

D. ipconfig

E. nslookup

Thumbs up for explanation!

In: Computer Science

Draw the class diagram in draw.io software for an Airline Reservation system.

Draw the class diagram in draw.io software for an Airline Reservation system.

In: Computer Science

This is for CYBER SECURITY 1)What are the 3 factors of Authentication and provide at least...

This is for CYBER SECURITY

1)What are the 3 factors of Authentication and provide at least 3 examples for each?

2) Please compare and contrast the following 4 Access Control Models and let me know how they work and give me an example of each.

1. Discretionary Access Control

2. Mandatory Access Control

3. Rule Based Access Controls

4. Role Based Access Controls

In: Computer Science

5. T/F. Secure Shell (SSH) is used as a more secure replacement for legacy remote connection...

5. T/F. Secure Shell (SSH) is used as a more secure replacement for legacy remote connection protocol Telnet and is used through programs such as Putty to remotely administer computers running various operating systems.
6. T/F. In most organizations, the Chief Operating Officer (COO) is the position responsible for all cyber security at a company.
7. T/F. Under non-discretionary access control, a third-party security administrator determines what users have access to certain network and system resources.
8. T/F. When establishing firewall rules, the most prudent configuration is to implicitly deny by blocking all traffic by default then rely on business need and justification to create new rules as exceptions.

In: Computer Science

Telecommunication Governance 1: Give at least 3 real life examples of the impact vs. probability risk...

Telecommunication Governance 1:

Give at least 3 real life examples of the impact vs. probability risk management actions and their individual application.

In: Computer Science

Reflection Write a program in Python or Matlab to perform reflection of an image about its...

  1. Reflection Write a program in Python or Matlab to perform reflection of an image about its y-axis. Apply your program to an image of your choice to demonstrate the reflection. Do not use transpose library.

In: Computer Science

Assume that you have the following MAC address 01:00:5e:XX:XX:XX (where the last 3 bytes matches the...

Assume that you have the following MAC address 01:00:5e:XX:XX:XX (where the last 3 bytes matches the last 3 bytes of your own device MAC address), figure out what IPv4 multicast address does this MAC address belongs to?

In: Computer Science

Can you make links out of lists where each item in s list is its own...

Can you make links out of lists where each item in s list is its own link? How might you accomplish this?

explain it with a good examplle

In: Computer Science

Given the sample data set s = [1,1,2,2,2,9,-5,-10,8,0] Compute the mean, median, mode, variance and standard...

  1. Given the sample data set

s = [1,1,2,2,2,9,-5,-10,8,0]

  1. Compute the mean, median, mode, variance and standard deviation on paper/ text editor. Show all calculation steps for full credit.
  2. Compute and verify the above statistical quantities using python. You can use the statistics package. Feel free to modify the sample code provided in the pre-class material. Your code must clearly print out the required quantities when executed. The display on screen must clearly say what quantity is being printed (eg: “The mean is: 3.45”, etc.).

In: Computer Science

Using C++ There are number of cable company in southern California which offer number of services...

Using C++

There are number of cable company in southern California which offer number of services

for customers. This company have two types of customers:

Residential and business. There are two rates for calculating a cable bill: one for Residential customers and one for business customers.

For residential customers the following rates apply:

  • Bill processing Fee $4.50
  • Basic service fee $20.50
  • Premium channels $7.50 per channel

For business customers the following rates apply:

  • Bill processing fee $15.0
  • Basic service fee $75.0 for the first 10 connections, $5.00 for additional connections.
  • Premium channels: $ 50.00 per channel for any number of connections.

Input:

The customer’s account number,

Customer code

Number of premium channels

And in case of business customers, number of basic service connections

What to deliver (output) Customers’ account number and the billing amount

Run your program for the given data:

Enter customer code: R or r (Residential) or B or b (Business) B

Enter number of service connections 16

Enter number of premium channels 8

Display total billing amount:

Run for residential customers:

R

Test your program for 12 premium channels.

flow chart, pseudo code are required for every projects and activities.

In: Computer Science

Objective: The purpose of this assignment is to introduce declaration of list objects, the forstatement and...

Objective: The purpose of this assignment is to introduce declaration of list objects, the forstatement and the def keyword used to define functions.

Problem: Write a Python module (a text file containing valid Python code) named p3.py. This file will contain the following.

  •  Definition of a list containing strings which are in turn integers. These integers represent years, which will be used as inputs to the next item in the file

  •  Definition of a function named isLeap. This function must accept a string containing an integer that will be interpreted by this function as a year. If the year is prior to the introduction of the Gregorian calendar, it will print “Not Gregorian.” If the year is aGregorian year and a leap year, it will print “Leap year!”. If the year is a Gregorian year butnot a leap year, it will print “Not a leap year!”.

  •  A for loop that will call isLeap with each of the year strings in the list of year strings defined above.

    While you are free to use any name for your list of year strings, you must use the name isLeap for the function.

    Submission: Submit the code you write in a text file named p3.py to the Blackboard folder for this assignment.

    Also –

    As you implement the code for this assignment, consider what might be added to the testing process and program output to make it clearer what the unit testing is accomplishing. For up to five points extra credit, you also submit a Word document describing any improvements you think would help in testing the function you created, including any additional output that would be useful or testing cycles.

In: Computer Science