Questions
Class as a ChapteredVideo. The constructor should take the following parameters: ID, length, num_chapters, chap_lengths, location,...

Class as a ChapteredVideo. The constructor should take the following parameters:

ID, length, num_chapters, chap_lengths, location, [extension]

The new parameter should be stored as their own instance variables. The ChapteredVideo object should behave as the Video. However, the method get_ID should now return a list which contains whatever the Video previously would return as its ID as the first element, followed by a list of chapter names. Each chapter name will be formed by the ID of the main video followed by ‘#’ and then the chapter number (starting at 1). For instance, a valid list could be ["123", "123#1", "123#2", "123#3"]. The ChapteredVideo class should also have a new accessor method, get_num_chapters.

Implement ChapteredVideo class as specified above.

In: Computer Science

Topic: Database testing techniques Write a research paper on this topic but task is that i...

Topic: Database testing techniques
Write a research paper on this topic but task is that i write just scope of this paper
Brief Idea (not more than 200 words): Define scope of your project
List of papers which u take (Minimum of 8 paper at least 4 papers after 2016)
Kindly provide some research paper which are related with my topic

In: Computer Science

PLEASE READ CAREFULLY!!!! write a client.py and server.py file for tic-tac-toe IN PYTHON with the following...

PLEASE READ CAREFULLY!!!!

write a client.py and server.py file for tic-tac-toe IN PYTHON with the following restrictions (SO WRITE TWO FILES THAT PLAY PYTHON THROUGH A SOCKET)


Use a 5 x 5 grid (dimensions are subject to change, so use constants for NUM_ROWS and NUM_COLS)


Use 'X' for player 1 and 'O' for player 2 (symbols and the number of players is subject to change, so use constants)


Each player can make 1 move per turn before having to wait for the next player to move. If an illegal move is made, an
error message is sent to the player by the server and the player loses the current turn

SO AGAIN TO RECAP A TIC TAC TOE PROGRAM IN PYTHON THAT ALLOWS TWO PLAYERS TO PLAY TOGETHER, a client and a server file

In: Computer Science

2) Complete the parameterized constructor that takes arguments that are used to initialize ALL class’s member...

2) Complete the parameterized constructor that takes arguments that are used to initialize ALL class’s member variables. [2 points] 3) Complete the code for getTitle() member function. The function returns the title of the Song. [1 point] 4) Complete the code for getDurationSec() member function, which returns the duration in seconds instead of minutes. [2 points] 5) Write member function definitions for three member functions below: [3 points] void setTitle(string t); //set title to t void setAuthor(Author a); //set author to a void setDurationMin(double d); //set durationMin to d 6) Demonstrate how you can use the Song class in the main() function. Prompt users to enter the details of songs, store each song in a list (vector) then print out the Song objects from the list. The grading rubric for this question is shown below

In: Computer Science

a. Write a function sumDigits that takes a positive integer value and returns the total sum...

a. Write a function sumDigits that takes a positive integer value and returns the
total sum of the digits in the integers from 1 to that number inclusive.
b. Write a program to input an integer n and call the above function in part a if n
is positive, else give ‘Value must be Positive’ message.
Sample Runs:
Enter a positive integer: 1000000
The sum of the digits in the number from 1 to 1000000 is 27000001
Enter a positive integer: -642
Value must be Positive

and write e a docstring comment for this

In: Computer Science

Java or python. The clients need to be able to communicate with each other using the...

Java or python. The clients need to be able to communicate with each other using the command line. The "local chat" program should be implemented using a client/Server model based on UDP protocol.

Requirements:

1. The chat is performed between 2 clients and not the server.

2. The server will first start up and choose a port number. Then the server prints out its IP address and port number.

3. The client then will start up and create a socket based on the information provided by the server.

4. Now the client and the server can chat with each other by sending messages over the network.

5. The client/server MUST be able to communicate with each other in a continuous manner. (e.g. One side can send multiple messages without any replies from the other side)

6. There is no requirement on what language you use to implement this project, but your program should call upon the socket API for UDP to realize the functionality.

7. You should demonstrate your project using two machines (one for the client and one for the server. Pick your virtual machine as the client to communicate with your actual machine, which is server in our project).

8. You need to open at least 2 cmd window in your virtual machine to demonstrate multiple machine communicate with your server machine (actual machine)

In: Computer Science

In this module you learned how to implement recursive functions in your C++ programs. For this...

In this module you learned how to implement recursive functions in your C++ programs.

For this assignment, you will create a program that tests a string to see if it is a palindrome. A palindrome is a string such as “madam”, “radar”, “dad”, and “I”, that reads the same forwards and backwards. The empty string is regarded as a palindrome. Write a recursive function:

bool isPalindrome(string str, int lower, int upper)

that returns true if and only if the part of the string str in positions lower through upper (inclusive at both ends) is a palindrome. Test your function by writing a main function that repeatedly asks the user to enter strings terminated by the ENTER key. These strings are then tested for palindromicity. The program terminates when the user presses the ENTER key without typing any characters before it.

Be sure to include comments throughout your code where appropriate.

In: Computer Science

What is a Symbol table? Please explain how a symbol table is created and used by...

  1. What is a Symbol table? Please explain how a symbol table is created and used by assemblers.

In: Computer Science

Using java.util.Stack and java.util.StringTokenizer to write a program that converts an infix expression to a postfix...

Using java.util.Stack and java.util.StringTokenizer to write a program that converts an infix expression to a postfix expression using data from infix.dat. Make sure your program can handle negative number. If the input expression can’t be converted, display error message.(1.5 points)

(Should remove parentheses)

infix.dat

5 * 6 + -10
3 - 2 + 4 7
( 3 * 4 - (2 + 5)) * 4 / 2
10 + 6 * 11 -(3 * 2 + 14) / 2
2 * (12 + (3 + 5 ) * 2

In: Computer Science

Construct a finite-state machine, using combinational logic for an apple vending machine that only accepts nickels...

Construct a finite-state machine, using combinational logic for an apple vending machine that only accepts nickels (5 cents). When 15 cents is deposited the user can push a button to receive an apple and the machine resets. If the user inserts more than 15 cents no money will be returned.

  1. What are the machine states?
  2. What are the inputs?
  3. What are the outputs?
  4. Draw state table
  5. Draw state diagram
  6. Write the combinational logic for next state and output
  7. Explain if you built a Mealy or Moore machine

In: Computer Science

Assignment 4: Objects that contain objects In this assignment, you will implement a Java application, called...

Assignment 4: Objects that contain objects

In this assignment, you will implement a Java application, called BankApplication, that can be used to manage bank accounts. The application is to be implemented using three classes, called Account, Customer, and BankDriver. The description of these classes is below.

Problem Description

class Account

The Account class keeps track of the balance in a bank account with a varying annual interest rate. The Account class is identified as follows:
• two double instance variables, called balance and annualRate.
• A constructor that takes two input parameters to initialize the balance and annualRate instance variables.
• No-argument constructor to set both the balance and annualRate to zero.
• Getters for both instance variables.
• deposit: a method than takes an amount (of type double) and adds that amount of money to account's balance.
• withdraw: a method than takes an amount (of type double) and withdraws that amount of money from the balance. If the amount to be withdrawn is greater than the current balance, then the method displays as error message and does not change the balance.
• addInterest: a method that adds interest to the balance at the current rate. The method takes an input (of type int) indicating how many years-worth of interest to be added. For example, if the account's balance is 1000 and annualRate is 0.05, the call addInterest(3) will add 3-years-worth of interest (i.e., 3*1000*0.05) to the current balance. (Note that interest calculations can be more complex if the second year's interest is to be calculated using the first's year balance after adding first year's interest and so on. However, for simplicity, you are not required to implement this more complex interest calculations).
• equals: a method to test the equality of two accounts. Two accounts are considered to be equal if they have the same balance and the same annualRate.
• toString: a method that returns a nicely formatted string description of the account.


class Customer

The Customer class represents a bank customer. A customer is identified by the following instance variables:
• name: a string that represents customer name
• checkingAccount: an instance variable of type Account
• savingAccount: an instance variable of type Account
Implement the following methods for the Customer class:

• A constructor that takes as input only the customer's name and creates a customer with zero balance and zero rate in both accounts.
• A constructor that takes five inputs that represent the customer's name and four double variables that represent the customer's checking account's balance, checking account's annual rate, saving account's balance, and saving account's annual rate.
• Getter methods for the saving and checking accounts.
• getTotalBalance: a method that calculates and returns the total balance of a customer (which is the sum of the checking account's balance and the saving account's balance).
• creditAccount: a method that takes two inputs to represent the account type and an amount of money to deposit. Note that account type is either 1 for saving account or 2 for checking account. The method then calls the appropriate Account's deposit method to add the specified amount of money. For example, the call creditAccount(1,500) adds 500 to the saving account while the call creditAccount(2,500) adds 500 to the checking account. The method should display an error message if the first input is any number other than 1 or 2.
• debitAccount: similar to creditAccount but it withdraws money form the specified account.
• addInterest: similar to creditAccount, this method takes as input account type and number of years. The method then adds interest to the specified account.
• toString: a method that returns a string representation of the customer that includes customer name, details of customer's accounts and customer’s total balance.


class BankDriver

Your driver class should do the following actions:
• creates two customers with your choice of names, balances, and annual rate values.
• adds 1 year-worth of interest to all checking accounts.
• adds 3 years-worth of interest to all saving accounts.
• Check whether the checking account of the first customer is equal to the checking account of the second cusomter.
• prints all customers’ information in a nicely formatted output.


Important Requirements

The output of our program must be nicely formatted.
• The programs should display your name.
• At the top of the program include your name, a brief description of the program and what it does and the due date.
• Add appropriate comments to your code.
• All code blocks must be indented consistently and correctly. Blocks are delimited by opening and closing curly braces. Opening and closing curly braces must be aligned consistently.
• Variable names should convey meaning.
• The program must be written in Java and submitted via D2L.

Draw a UML diagram of your application that includes the Account and Customer classes but not the BankDriver class.

In: Computer Science

The following code snippet is free of errors (issues that will prevent the code from compiling)...

The following code snippet is free of errors (issues that will prevent the code from compiling) but it does contain a major bug that will cause the program to hang (not finish running). Identify the problem and create a line of code to fix it.

#include <stdio.h>

char get_input();

int main() {
    printf("The user's inputted letter is %c\n", get_input());
    return 0;
}

char get_input() {
    printf("Please enter a letter: \n");
    char input = getchar();
    
    while (!(input >= 'a' && input <= 'z') && !(input >= 'A' && input <= 'Z')) {
        printf("You did not enter a letter! Try again\n");
    }
    
    return input;
}

In: Computer Science

Your code must print all the steps in the output as an Eg> When you run...

Your code must print all the steps in the output as an Eg>

When you run your Merge sort code the sequence of output should be:

1) Enter input sequence

2) Show n/2 division of the input sequence

3) keep showing n/2 division of your sequence until you get one attribute

4) Sort first two numbers

5) Make a stack of 4 by merging 2 * 2 and sort them

6) keep showing merging and sorting until you show the final merging of last two stacks and sort them.

Similarly, show all the steps for Bubble sort.

Mostly need Bubble in Java, please.v

In: Computer Science

#include <stdio.h> #include <stdlib.h> #include <time.h> void sort(int a[], int size); void printArray(int a[], int size);...

#include <stdio.h>
#include <stdlib.h> 
#include <time.h> 

void sort(int a[], int size);
void printArray(int a[], int size);

int main(){
        int arraySize, limit, count,

        srand(time(0)); 

        print f("Enter the size of array\n");
        scanf("%d", arraySize);

        int array[arraySize];

        printf("Enter the upper limit\n");
        scanf("%d", &limit);

        count = 0;
        while(count <= arraySize){
                array[count] = (rand() % (limit + 1));
                count++;
        }

        printArray(array, &arraySize);

        sort(array, arraySize);

        printArray(array, arraySize);

        Return 0;
}

void printArray(int a[], int size){
        int i = 0;
        printf("Array: [");
        while(i < size){
                if(i != size - 1){
                        printf("%d, ", a[i]);
                } else {
                        printf("%d]\n", a[i]);
                }
                printf("%d, ", a[i]);
        }
}

Find the bugs in the given code and write the correct line of code where the bug is. There are a total of 7 bugs.

In: Computer Science

Describe any experiences you have had with tabletop simulation exercises or other types of simulation exercises....

  1. Describe any experiences you have had with tabletop simulation exercises or other types of simulation exercises. If you have not had direct experiences with this sort of exercise, discuss the closest you have come, including fantasy or role-playing games or even board games that spurred your imagination.
  2. Discuss the effectiveness of tabletop simulations or similar exercises. What are they good for? If done well, what sorts of results may be expected? Consider especially the use of such exercises in cybersecurity and in combating adversarial threats that are adaptable and may be hard to predict. Also, consider impacts beyond addressing technical controls: for instance, what can such exercises show an organization about compliance, communication, decision making, training, or other matters?

In: Computer Science