Welcome to AssignmentCache!

Search results for '''

Items 1 to 10 of 275 total

per page
Page:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Grid  List 

Set Ascending Direction
  1. DAT305 Week 3 Challenge Activities 1 Deque ADT

    DAT/305 Week 3 Challenge Activities 3.5.1: Deque ADT

    Regular Price: $5.00

    Special Price $3.00

    DAT/305 Week 3 Challenge Activities 3.5.1: Deque ADT

    CHALLENGE ACTIVITY 1

    Given an empty deque numDeque, what are the deque's contents after the following operations?
    PushBack(numDeque, 24)
    PushFront(numDeque, 49)
    PushBack(numDeque, 44)

    After the above operations, what does PeekFront(numDeque) return?

    After the above operations, what does PeekBack(numDeque) return?

    After the above operations, what does GetLength(numDeque) return?


    CHALLENGE ACTIVITY 2

    Given an empty deque numDeque, what are the deque's contents after the following operations?
    PushBack(numDeque, 95)
    PopFront(numDeque)
    PushFront(numDeque, 42)
    PushFront(numDeque, 25)
    PopBack(numDeque)

    After the above operations, what does GetLength(numDeque) return?


    CHALLENGE ACTIVITY 3

    Given numDeque: 19, 38
    PeekFront(numDeque)
    PopFront(numDeque)
    After the above operations, what does GetLength(numDeque) return?

    After the above operations, what does IsEmpty(numDeque) return?

    Learn More
  2. DAT305 Week 3 Challenge Activities 1 Queue ADT

    DAT/305 Week 3 Challenge Activities 3.3.1: Queue ADT

    Regular Price: $5.00

    Special Price $4.00

    DAT/305 Week 3 Challenge Activities 3.3.1: Queue ADT

    CHALLENGE ACTIVITY 1

    Given numQueue: 75, 45
    What are the queue's contents after the following operations?
    Enqueue (numQueue, 80)
    Dequeue(numQueue)

    After the above operations, what does GetLength(numQueue) return?


    CHALLENGE ACTIVITY 2

    Given numQueue: 90, 60
    What does Peek(numQueue) return?

    What is the queue after the following operations?
    Peek(numQueue)
    Dequeue (numQueue)
    Peek(numQueue)
    Enqueue (numQueue, 90)

    After the above operations, what does GetLength(numqueue) return?


    CHALLENGE ACTIVITY 3

    Given numQueue: 73, 39
    Peek(numQueue)
    Dequeue (numqueue)
    After the above operations, what does GetLength(numQueue) return?

    After the above operations, what does IsEmpty(numQueue) return?


    CHALLENGE ACTIVITY 4

    Given numQueue is empty, what does the list head pointer point to?

    What does the list tail pointer point to?

    After the following operations:
    Enqueue (numQueue, 26)
    Enqueue (numQueue, 47)
    Enqueue (numQueue, 22)
    Dequeue (numQueue)

    What does the list head pointer point to?

    What does the list tail pointer point to?

    Learn More
  3. DAT305 Week 3 Challenge Activities 1 Stacks using linked lists

    DAT/305 Week 3 Challenge Activities 3.2.1: Stacks using linked lists

    Regular Price: $5.00

    Special Price $3.00

    DAT/305 Week 3 Challenge Activities 3.2.1: Stacks using linked lists

    CHALLENGE ACTIVITY 1

    Given an empty stack numStack, what does the list head pointer point to? If the pointer is null, enter null.

    After the following operation, which node does the list head pointer point to?
    StackPush(numStack, 83)


    CHALLENGE ACTIVITY 2

    Given numStack: 54, 38, 25, 28 (top is 54)
    After the following operation: StackPush(numStack, 40)
    What node does newNode's next pointer point to? If the pointer is null, enter null.

    What node does the list's head pointer point to?


    CHALLENGE ACTIVITY 3

    Given numStack: 51 (top is 51)
    After the following operation: StackPop(numStack)
    What is returned?

    What node does the list's head pointer point to? If the pointer is null, enter null:

    Learn More
  4. DAT380 Week 5 LAB 5.6 - Implement independent entity (Sakila)

    DAT/380 Week 5 LAB 5.6 - Implement independent entity (Sakila)

    Regular Price: $5.00

    Special Price $3.00

    DAT/380 Week 5 LAB 5.6 - Implement independent entity (Sakila)

    Implement a new independent entity phone in the Sakila database. Attributes and relationships are shown in the following diagram:

    The phone entity appears on the right. The phone entity contains four attributes, each followed by cardinality information: phone_id 1-1(1), country_code M-1(1), phone_numer M-1(1), and phone_type M-1(0). Three entities appear on the left: store, staff, and customer, connected to the phone entity by three identical relationships. The three relationships are named 'has' and have cardinality 1(0) on both sides.

    The diagram uses Sakila naming conventions. Follow the Sakila conventions for your table and column names:
    All lower case
    Underscore separator between root and suffix
    Foreign keys have the same name as referenced primary key

    Write CREATE TABLE and ALTER TABLE statements that:
    1. Implement the entity as a new phone table.
    2. Implement the has relationships as foreign keys in the Sakila customer, staff, and store tables.
    3. Remove the existing phone column from the Sakila address table.

    Step 2 requires adding a foreign key constraint to an existing table. Ex:
    ALTER TABLE customer
    ADD FOREIGN KEY (phone_id) REFERENCES phone(phone_id)
    ON DELETE SET NULL
    ON UPDATE CASCADE;

    Specify data types as follows:
    phone_id, phone_number, and country_code have data type INT.
    phone_type has date type VARCHAR(12) and contains strings like 'Home', 'Mobile', and 'Other'.

    Apply these constraints:
    NOT NULL constraints correspond to cardinalities on the diagram above.
    Foreign key actions are SET NULL for delete rules and CASCADE for update rules.
    Specify a suitable column as the phone table primary key.

    Learn More
  5. DAT380 Week 4 LAB 4.6 - Select lesson schedule with inner join

    DAT/380 Week 4 LAB 4.6 - Select lesson schedule with inner join

    Regular Price: $5.00

    Special Price $3.00

    DAT/380 Week 4 LAB 4.6 - Select lesson schedule with inner join

    The database has three tables for tracking horse-riding lessons:
    Horse with columns:
    ID - primary key
    RegisteredName
    Breed
    Height
    BirthDate

    Student with columns:
    ID - primary key
    FirstName
    LastName
    Street
    City
    State
    Zip
    Phone
    EmailAddress

    LessonSchedule with columns:
    HorseID - partial primary key, foreign key references Horse(ID)
    StudentID - foreign key references Student(ID)
    LessonDateTime - partial primary key

    Write a SELECT statement to create a lesson schedule with the lesson date/time, horse ID, and the student's first and last names. Order the results in ascending order by lesson date/time, then by horse ID. Unassigned lesson times (student ID is NULL) should not appear in the schedule.

    Hint: Perform a join on the Student and LessonSchedule tables, matching the student IDs.

    Learn More
  6. DAT/380 Week 3 LAB 3.10 - Create Horse table with constraints

    DAT/380 Week 3 LAB 3.10 - Create Horse table with constraints

    Regular Price: $5.00

    Special Price $3.00

    DAT/380 Week 3 LAB 3.10 - Create Horse table with constraints

    Create a Horse table with the following columns, data types, and constraints. NULL is allowed unless 'not NULL' is explicitly stated.
    ID - integer with range 0 to 65 thousand, auto increment, primary key
    RegisteredName - variable-length string with max 15 chars, not NULL
    Breed - variable-length string with max 20 chars, must be one of the following: Egyptian Arab, Holsteiner, Quarter Horse, Paint, Saddlebred
    Height - number with 3 significant digits and 1 decimal place, must be ≥ 10.0 and ≤ 20.0
    BirthDate - date, must be ≥ Jan 1, 2015

    Note: Not all constraints can be tested due to current limitations of MySQL.

    Learn More
  7. DAT/380 Week 2 LAB 2.10 - Select employees and managers with inner join

    DAT/380 Week 2 LAB 2.10 - Select employees and managers with inner join

    Regular Price: $5.00

    Special Price $3.00

    DAT/380 Week 2 LAB 2.10 - Select employees and managers with inner join

    The Employee table has the following columns:
    ID - integer, primary key
    FirstName - variable-length string
    LastName - variable-length string
    ManagerID - integer
    Write a SELECT statement to show a list of all employees' first names and their managers' first names. List only employees that have a manager. Order the results by Employee first name. Use aliases to give the result columns distinctly different names, like "Employee" and "Manager".

    Hint: Join the Employee table to itself using INNER JOIN.

    Learn More
  8. PRG 211 Week 5 Lab 11.1 Miles to track laps Program

    PRG 211 Week 5 Labs

    Regular Price: $20.00

    Special Price $15.00

    PRG 211 Week 5 Labs

    Lab 11.1 Miles to track laps

    One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input, and outputs the number of laps.

    Ex: If the input is 1.5, the output is:
    6.0

    Ex: If the input is 2.2, the output is:
    8.8

    Your program should define and call a function:
    Function MilesToLaps(float userMiles) returns float userLaps


    Lab 11.2 Driving cost

    Write a function DrivingCost with parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar cost to drive those miles. All items are of type float.

    Ex: If the function is called with 50 20.0 3.1599, the function returns 7.89975.

    Define that function in a program whose inputs are the car's miles/gallon and the gas dollars/gallon (both floats). Output the gas cost for 10 miles, 50 miles, and 400 miles, by calling your DrivingCost function three times.

    Ex: If the input is 20.0 3.1599, the output is:
    1.57995 7.89975 63.198

    Note: Small expression differences can yield small floating-point output differences due to computer rounding. Ex: (a + b)/3.0 is the same as a/3.0 + b/3.0 but output may differ slightly. Because our system tests programs by comparing output, please obey the following when writing your expression for this problem. In the DrivingCost function, use the variables in the following order to calculate the cost: drivenMiles, milesPerGallon, dollarsPerGallon.


    Lab 11.3 Step counter

    A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output is the miles walked. If the input is 5345, the output is 2.6725.

    Your program should define and call a function:
    Function StepsToMiles(integer userSteps) returns float numMiles


    Lab 11.4 Leap year

    A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are:

    1) The year must be divisible by 4

    2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400

    Some example leap years are 1600, 1712, and 2016.

    Write a program that takes in a year and determines whether that year is a leap year. If the input is 1712, the output is: 1712 is a leap year. If the input is 1913, the output is: 1913 is not a leap year.

    Your program must define and call a function:

    Function OutputLeapYear(integer inputYear) returns nothing
    The function should output whether the input year is a leap year or not.


    Lab 11.5 Max and min numbers

    Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. If the input is 7 15 3, the output is:
    largest: 15
    smallest: 3

    Your program should define and call two functions:
    Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNum
    Function SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNum
    The function LargestNumber should return the largest number of the three input values. The function SmallestNumber should return the smallest number of the three input values.


    Lab 11.6 Output values below an amount

    Write a program that first gets a list of six integers from input. The first five values are the integer list. The last value is the upper threshold. Then output all integers less than or equal to the threshold value.

    Ex: If the input is 50 60 140 200 75 100, the output is:
    50 60 75
    For coding simplicity, follow every output value by a space, including the last one.

    Such functionality is common on sites like Amazon, where a user can filter results.

    Your program should define and use a function:
    Function outputIntsLessThanOrEqualToThreshold(integer array(?) userVals, integer upperThreshold) returns nothing

    Learn More
  9. PRG 211 Week 3 Lab 7.4 Countdown until matching digits Program

    PRG 211 Week 3 Labs

    Regular Price: $15.00

    Special Price $12.00

    PRG 211 Week 3 Labs

    Lab 7.1 Loops Convert to binary

    Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:

    As long as x is greater than 0
    Output x % 2 (remainder is either 0 or 1)
    x = x / 2
    Note: The above algorithm outputs the 0's and 1's in reverse order.

    Ex: If the input is 6, the output is:
    011
    (6 in binary is 110; the algorithm outputs the bits in reverse).


    Lab 7.2 Loops Varied amount of input data

    Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics.

    Ex: When the input is 15 20 0 5 -1, the output is:
    10 20
    You can assume that at least one non-negative integer is input.


    Lab 7.3 Loops Output range with increment of 10

    Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.

    Ex: If the input is -15 30, the output is:
    -15 -5 5 15 25

    Ex: If the second integer is less than the first as in 20 5, the output is:
    Second integer can't be less than the first.

    For coding simplicity, output a space after every integer, including the last.


    Lab 7.4 Loops Countdown until matching digits

    Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.

    Ex: If the input is 93, the output is:
    93 92 91 90 89 88

    Ex: If the input is 77, the output is:
    77

    Ex: If the input is not between 20 and 98 (inclusive), the output is:
    Input must be 20-98

    For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.

    Learn More
  10. PRG 211 Week 2 Lab 5.3 Leap Year Program

    PRG 211 Week 2 Labs

    Regular Price: $12.00

    Special Price $9.00

    Lab 5.1 Largest number

    Write a program whose inputs are three integers, and whose output is the largest of the three values.

    Ex: If the input is 7 15 3, the output is:
    15


    Lab 5.2 Remove gray from RGB

    Summary: Given integer values for red, green, and blue, subtract the gray from each value.

    Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray).

    Given values for red, green, and blue, remove the gray part.

    Ex: If the input is 130 50 130, the output is:
    80 0 80
    Find the smallest value, and then subtract it from all three values, thus removing the gray.

    Note: This page converts rgb values into colors.


    Lab 5.3 Leap Year

    A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are:

    1. The year must be divisible by 4
    2. If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400
    Some example leap years are 1600, 1712, and 2016.

    Write a program that takes in a year and determines whether that year is a leap year.

    Ex: If the input is 1712, the output is:
    1712 is a leap year.

    Ex: If the input is 1913, the output is:
    1913 is not a leap year.

    Learn More

Items 1 to 10 of 275 total

per page
Page:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Grid  List 

Set Ascending Direction
[profiler]
Memory usage: real: 14680064, emalloc: 14274880
Code ProfilerTimeCntEmallocRealMem