In: Computer Science
1. write a truth table using this symbol: -->
2. write the inputs for the truth table to the left of the --> and write the outputs for the truth table to the right of the -->
3. write the compliment, or NOT using '
As an example:
The truth table for AND is written this way:
A B --> A AND B
0 0 --> 0
0 1 --> 0
1 0 --> 0
1 1 --> 1
or this way:
A B --> A AND B
a' b' --> 0
a' b --> 0
a b' --> 0
a b --> 1
As another example:
For a 3 input, 2 output truth table, the truth table is written this way:
A B C --> X Y
0 0 0 --> 0 0
0 0 1 --> 1 0
0 1 0 --> 1 0
0 1 1 --> 0 1
1 0 0 --> 1 0
1 0 1 --> 0 1
1 1 0 --> 0 1
1 1 1 --> 1 1
For the output F and the inputs A, B, C, and D, there is this Boolean equation:
F = A XOR B XOR C XOR D
Using the format for truth tables explained in the lab assignment instruction, write the truth table for the Boolean equation.
In: Computer Science
use IE Crow's Foot notation to make an E-R diagram. provide entity names and identifiers for each entity, along with all necessary relationships between entities, including minimum and maximum cardinalities
A professor wants to use a small database to track information about personal student software use during a course. He would like to store student names and email addresses, the name and installation instructions of each type of software required for the course, and the date each student installed the software on their personal machine.
Assume that there are multiple different software packages available for use during the class. Assume that students are not required to download the software on their personal machine, but they can choose to download any of the multiple software programs, and the professor wants to keep track of which students download which software on their personal machine so that he can better assist them with the homework.
In: Computer Science
In: Computer Science
Use Javascript to implement the class below to the code below.
class Sandwich {
constructor(price) {
this.price = price;
}
toString() {
return "Sandwich", this.price;
}
}
class Burger extends Sandwich {
constructor(price, lettuce, meat) {
super(price)
this.lettuce = lettuce;
this.meat = meat;
}
toString() {
return "Burger", this.price;
}
}
class CheeseBurger extends Burger {
constructor(price, lettuce, meat, cheese) {
super(price, lettuce, meat)
this.cheese = cheese;
}
toString() {
return "CheeseBurger", this.price;
}
}
In: Computer Science
C++ ONLY -- PRACTICE ASSIGNMENT
We are given a code (Driver.cpp) and asked to create a file (StringStack.h) and turn it in.
What should the code for StringStack.h look like based on the instructions below?
6. Test your stack class using the Driver.cpp file provided for you.
GIVEN DRIVER.CPP FILE:
#include <iostream>
#include "StringStack.h"
using namespace std;
int main()
{
// Define a StringStack object.
StringStack stack;
string animal, lastAnimal;
//get input from user and push to the stack
cout << "\n\nWhat did the old lady eat first? ";
getline(cin, animal);
stack.push(animal);
for(int x=0; x < 6; x++)
{
cout << "\nWhat did she eat next? ";
getline(cin, animal);
stack.push(animal);
}
cout << "\nWhat did she eat last? ";
getline(cin, animal);
stack.push(animal);
//start popping from stack and print results
lastAnimal = stack.pop();
animal = stack.pop();
cout << "\n\nShe swallowed the " << animal << " to catch the ";
animal = stack.pop();
cout << animal << ",\nShe swallowed the " << animal << " to catch the ";
animal = stack.pop();
cout << animal << ",\nShe swallowed the " << animal << " to catch the ";
animal = stack.pop();
cout << animal << ",\nShe swallowed the " << animal << " to catch the ";
animal = stack.pop();
cout << animal << ",\nShe swallowed the " << animal << " to catch the ";
animal = stack.pop();
cout << animal << "\nThat wriggled and jiggled and tickled inside her!\n";
cout << "She swallowed the " << animal << " to catch the ";
animal = stack.pop();
cout << animal << ";\nI don\'t know why she swallowed a " << animal;
cout << " - Perhaps she\'ll die!\n\n";
cout << "There was an old lady who swallowed a " << lastAnimal;
cout << ";\n...She\'s dead, of course!\n\n";
return 0;
}
In: Computer Science
C++:
Write a program using Stacks-Array and Queue-Array data structure we did in class to check whether a given string is a palindrome. (50 points)
This is an exercise in Stacks and Queues. So you need to use both datastructures to test :
In the main you can test whether a string is a palindrome using the method
bool palindromeTest( string test) and should include “QueArr.h” and “StackArr.h”
QueArr.h
#include <iostream>
using namespace std;
template <class ItemType>
class QueArr
{
private:
int maxSize;
int front;
int rear;
ItemType * items;
public:
QueArr();
QueArr(int size);
~QueArr();
void makeEmpty();
bool isEmpty() const;
bool isFull() const;
void add(ItemType item);
void remove(ItemType& item);
void print() const;
};
template <class ItemType>
QueArr<ItemType>::QueArr()
{
maxSize = 100;
front = maxSize - 1;
rear = maxSize - 1;
items = new ItemType [maxSize];
}
template <class ItemType>
QueArr<ItemType>::QueArr( int size )
{
maxSize = size;
front = maxSize - 1;
rear = maxSize - 1;
items = new ItemType[maxSize];
}
template <class ItemType>
QueArr<ItemType>::~QueArr()
{
delete[] items;
}
template <class ItemType>
void QueArr<ItemType>::makeEmpty()
{
front = maxSize - 1;
rear = maxSize - 1;
}
template <class ItemType>
bool QueArr<ItemType>::isEmpty() const
{
return (rear == front);
}
template <class ItemType>
bool QueArr<ItemType>::isFull() const
{
return ((rear + 1) % maxSize == front);
}
template <class ItemType>
void QueArr<ItemType>::add(ItemType item)
{
if (isFull())
cout << "Queue is Full"
<< endl;
else
{
rear = (rear + 1) % maxSize;
items[rear] = item;
}
}
template <class ItemType>
void QueArr<ItemType>::remove(ItemType& item)
{
if (isEmpty())
cout << "Queue is empty"
<< endl;
else
{
front = (front + 1) %
maxSize;
item = items[front];
}
}
template <class ItemType>
void QueArr<ItemType>::print() const
{
if (isEmpty())
cout << "Que is empty"
<< endl;
else
{
//cout << front << ", "
<< length << endl;
int temp = front;
while(temp != rear)
{
temp = (temp +
1) % maxSize;
cout <<
items[temp] << " ";
}
cout << endl;
}
}
StackArr.h
#include <iostream>
using namespace std;
template <class ItemType>
class StackArr
{
public:
StackArr();
//Empty constructor
StackArr(int max); //Constructor which takes a
size
bool IsEmpty() const;
bool IsFull() const;
void Push(ItemType item);
void Pop();
ItemType Top() const;
void PrintStack();
private:
int top;
int maxStack;
ItemType* items;
int length;
};
template <class ItemType>
StackArr<ItemType>::StackArr()
{
maxStack = 100;
top = -1;
items = new ItemType[maxStack];
length = 0;
}
template <class ItemType>
StackArr<ItemType>::StackArr( int max)
{
maxStack = max;
top = -1;
items = new ItemType[maxStack];
length = 0;
}
template <class ItemType>
bool StackArr<ItemType>::IsEmpty() const
{
return (top == -1);
}
template <class ItemType>
bool StackArr<ItemType>::IsFull() const
{
return (top == maxStack - 1);
}
template <class ItemType>
void StackArr<ItemType>::Push(ItemType item)
{
if (IsFull())
{
cout << "The stack is full
and item cannot be pushed";
}
else
{
top++;
items[top] = item;
length++;
}
}
template <class ItemType>
void StackArr<ItemType>::Pop()
{
if(IsEmpty())
{
cout << "The stack is empty
and item cannot be popped";
}
else
{
top--;
length--;
}
}
template <class ItemType>
ItemType StackArr<ItemType>::Top() const
{
if (IsEmpty())
{
cout << "The stack is empty
and no item on top";
}
else
return items[top];
}
template <class ItemType>
void StackArr<ItemType>::PrintStack()
{
if (length == 0)
cout << "Stack is empty"
<< endl;
else
{
for (int i = 0; i < length;
i++)
cout <<
items[i] << ", ";
cout << endl;
}
}
In: Computer Science
Risk Register
Assignment Content
Tony and his project team identified some risks during the first month of the Recreation and Wellness Intranet Project. However, all they did was document the risks in a list. They never ranked the risks or developed any response strategies. Because the project has had several problems, such as key team members leaving the company, users being uncooperative, and team members not providing good status information, Tony decided to be more proactive in managing risks and want to address positive risks as well as negative risks.
Complete the following tasks:
In: Computer Science
Question 7 Use the definition of Ω to show that 20(?^3) + 5(n^2) ∈ Ω (?^3)
Big-O, Omega, Theta complexity of functions, Running time equations of iterative functions & recursive functions, Substitution method & Master theorem
Please answer within these topics.
In: Computer Science
Hexadecimal numbers are numbers in base 16. They use the following sixteen digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. They are widely used in computing, for example, to represent colors or network addresses of computers.
In: Computer Science
Why is it costly if an error was discovered in later phases of software development?
In: Computer Science
3) Convert 1.25 decimal to 32 bit floating point format. 4) Convert the following truth table to a digital circuit consisting of NOT, AND, and OR gates. ABC Out 000 1 001 1 010 0 011 0 100 1 101 0 110 1 111 0 5) Construct a tri-state buffer using transistors
10) What are the advantages of a large page size?
In: Computer Science
Compare and contrast the representation and use of primitive data types and built-in data structures such as C-strings and string objects?
In: Computer Science
Web Mining Assignments
Exercise 6.1.1 : Suppose there are 100 items, numbered 1 to 100, and also 100 baskets, also numbered 1 to 100. Item i is in basket b if and only if i divides b with no remainder. Thus, item 1 is in all the baskets, item 2 is in all fifty of the even-numbered baskets, and so on. Basket 12 consists of items {1, 2, 3, 4, 6, 12}, since these are all the integers that divide 12. Answer the following questions:
(a) If the support threshold is 5, which items are
frequent?
! (b) If the support threshold is 5, which pairs of items are
frequent?
! (c) What is the sum of the sizes of all the baskets?
PS: I know the answer of a) which are 1, 2, 3, 4 ... 18, 19, 20. But how to get the answers of b) and c) please show the steps and the explanation. Thank you.
In: Computer Science
Exp1:
import java.util.Scanner;
public class User_Authentication
{
public static void main(String args[])
{
String username, password;
Scanner s = new Scanner(System.in);
System.out.print("Enter username:");//username:user
username = s.nextLine();
System.out.print("Enter password:");//password:user
password = s.nextLine();
if(username.equals("Bisha") && password.equals("Computer"))
{
System.out.println("Authentication Successful");
}
else
{
System.out.println("Authentication Failed");
}
}
}
Exp3:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Main {
static Scanner sc=new Scanner(System.in);
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws IOException {
// TODO code application logic here
System.out.print("Enter any String: ");
String str = br.readLine();
System.out.print("\nEnter the Key: ");
int key = sc.nextInt();
String encrypted = encrypt(str, key);
System.out.println("\nEncrypted String is: " +encrypted);
String decrypted = decrypt(encrypted, key);
System.out.println("\nDecrypted String is: "
+decrypted); System.out.println("\n");
}
public static String encrypt(String str, int key)
{ String encrypted = "";
for(int i = 0; i < str.length(); i++) {
int c = str.charAt(i);
if (Character.isUpperCase(c)) {
c = c + (key % 26);
if (c > 'Z')
c = c - 26;
}
else if (Character.isLowerCase(c)) {
c = c + (key % 26);
if (c > 'z')
c = c - 26;
}
encrypted += (char) c;
}
return encrypted;
}
public static String decrypt(String str, int key)
{ String decrypted = "";
for(int i = 0; i < str.length(); i++) {
int c = str.charAt(i);
if (Character.isUpperCase(c)) {
c = c - (key % 26);
if (c < 'A')
c = c + 26;
}
else if (Character.isLowerCase(c)) {
c = c - (key % 26);
if (c < 'a')
c = c + 26;
}
decrypted += (char) c;
}
return decrypted;
}
}
need your help regarding attached for all the questions
Answered it from your mind Do not copying the Answered Especially "D"
In: Computer Science