Use MYSQL to create the set of database tables of the relational database model and complete the associated queries given.
Procedure: 1) Write all the SQL statements, necessary to create all tables and relationships, with Primary & Foreign keys.
2) Execute each statement in the correct order to create the relational database in MYSQL.
3)Insert some data into each table.
4) Use all your SQL create and Insert statements (from MS Word) to execute in the MYSQL WorkBench
5) Write in MS Word and execute in MYSQL WorkBench the statements necessary to; i. display all tables, ii. identify sales total for each item iii. identify delivery confirmation of sold items iv. identify marketing level for sold items
(Tables that have to be created)
Sales details
Marketing details
Customer details
Production details
Delivery details
Management details
In: Computer Science
In: Computer Science
Python - Please include running time of push(), pop(), and top() methods and tester code for all methods.
Design a stack ADT using a single queue as an instance variable, and only constant additional local memory within the method bodies. What is the running time of the push(), pop(), and top() methods for your design? Implement your modified stack ADT in Python, including tester code to test all its methods.
In: Computer Science
Write a C program that would constantly watch all processes (say once every second), and if it encountered a notepad, it would kill it immediately.
In: Computer Science
When it comes to the passphrase (pre-shared key) for WPA, what would you personally advise when it comes to length? How should one create the passphrase? Please also provide some quantitative justification as well, that is important. Thank you.
In: Computer Science
Create a Java program that allows two players to play Rock,
Paper, Scissors. Player 1 will enter an integer to determine
whether they use rock, paper or scissors. Player 2 will also enter
an integer to determine whether they use rock, paper or scissors.
Use named constants for rock, paper and scissors and set their
values as shown below. Use if-else statements to determine the
results of the game. Use the named constants to compare with the
player 1 and player 2 choices rather than hardcoding the numbers.
Make sure to close your Scanner at the end of your program to avoid
losing a point. When run, the program should look like the
screenshots shown below.
Named constants:
ROCK = 1
PAPER = 2
SCISSORS = 3
Name your Java program RockPaperScissors.java and submit it to
Canvas along with the other files specified in the “Grading”
section below. Make sure your program compiles before submitting it
to avoid losing points.
Example 1:
Player 1 chooses rock.
Player 2 chooses paper.
Player 2 wins!
In: Computer Science
Write a C program called cards.c that simulates some card game logic by comparing the cards from 4 people and determining which person has the best card. The program MUST work as follows:
Eachcardmustberepresentedbyexactlytwocharsrepresenting a rank and a suit. The possible rank options are: '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A'. The possiblesuit options are: 'H', 'D', 'S', 'C'. So 6H represents the “6 of hearts”, JC represents the “Jack of Clubs” etc...
YouMUSTwriteafunctioncalledisValidRank(charc)which determines if the given character is one of the ranks mentioned above. It should return a char with a value of 1 if the character is a valid rank and 0 otherwise. Lowercase letters are not valid.
YouMUSTwriteafunctioncalledisValidSuit(charc)whichdeterminesifthegivencharacter is one of the suits mentioned above. It should return a char with a value of 1 if the character is a valid suit and 0 otherwise. Lowercase letters are not valid.
You MUST have a function called getTrump() that returns a char. It should prompt the user for a trump suit, which must be 'H', 'D', 'S' or 'C'. It should be robust, in that any invalid input is not accepted. It should only return from the function when a valid suit has been entered, and it must make use of the isValidRank() function. For any invalid entry, an appropriate error message should be given. Blank entries are invalid and so are lowercase letters.
The main function should first get the trump suit, by calling the above function. It should then enter an infinite loop to do the following: (1) ask for 4 cards from the user, (2) display the 4 cards entered, (3) determine and display which player wins the round (i.e., which one has the “best” card). These steps will be explained below.
6. Whenenteringthecards...yourcode should be robust and handle any input, just like you did in thegetTrump() function. For each of the 4 cards entered, your code should allow the user to enter two characters and then press enter. If the first character (i.e., the rank) is invalid (use the function you wrote earlier), then an appropriate error message should be displayed and the second character (i.e., the suit) should not be prompted for. If it was valid, then the suit character should be prompted for.
Player 1: Enter card
rank andRC
Invalid card, please re-enter Player 1: Enter card rank and4F
Invalid card, please
re-enter Player 1: Enter card rank and6
Invalid card, please re-enter Player 1: Enter card rank andH
Invalid card, please
re-enter Player 1: Enter card rank andJC
Player 2: Enter card rank and6S
Player 3: Enter card rank and
suit (e.g., 2S, TC, KD)
suit (e.g., 2S, TC, KD)
suit (e.g., 2S, TC, KD)
suit (e.g., 2S, TC, KD)
suit (e.g., 2S, TC, KD) suit (e.g., 2S, TC, KD) suit (e.g., 2S, TC, KD)
suit (e.g., 2S, TC, KD)
suit (e.g., 2S, TC, KD) suit (e.g., 2S, TC, KD)
is invalid, another
error message
should be shown. Either way, the
code should keep prompting until a
valid card is entered before moving on
to get the next player’s card. Here is
an example of what you should do à 5H
If it
Invalid card, please
re-enter Player 3: Enter card rank and9d
Invalid card, please re-enter Player 3: Enter card rank and9D
Player 4: Enter card rank and
Once4validcardentrieshavebeenentered,the4cardsshouldbedisplayedlikethis:
JC, 6S, 9D, 5H
You must then determine which card wins the round. That is, which player has the best card. To do this, you must follow these rules:
A card which is of the trump suit always beats a card that is a non-trump suit.
If two cards have the same suit, the one with the higher rank is better. 'A' is the highest
rank and '2' is the lowest.
The card played by player 1 is called the “suit led”. If no other player has a higher ranking card of the same suit as the suit led, and no other player has the trump suit, then player 1 has the best card and wins.
Inyourmainfunction,iftherankofthefirst(orany)playerisa'.'character,thentheprogram should quit. The TA’s will need this functionality in order to test your program.
Show transcribed image text
View comments (1)
In: Computer Science
(1) Convert negative fractional decimal number to 8-bit binary number: – 6.625
Hint: –7 + 0.375
Given the hint above, the fractional number will be divided into
two parts,
- Whole number,
- Fractional part, must be positive
(2) Use 2's complement binary format to convert negative fractional decimal number to 8-bit binary number: – 6.625
(3) Proof to check that your representation calculation for (1) & (2) is correct
In: Computer Science
The Objective is to create a Custom LinkList.
Implement the
following methods
Class Name: CustomLinkList
Methods
void insert (String data) – insert it the item to the
last row void delete() - Deletes the last row
boolean exists() - returns a Boolean if found
String[] toArray()
String getTail() – returns the last record
String getHead () – return the 1st record
Extra Credit
int delete (String data) – delete an item in the
link by position. If an item is successfully
the delete method return the number 1, else return the number 0
In: Computer Science
Code is only reading the last line from the text files. How would I resolve? This is for the Name Search problem in Starting out with Python book. def main(): #open a file for reading infile = open('GirlNames.txt' , 'r') #Read the contents into a list Girls = infile.readlines() #open another file for reading infile = open('BoyNames.txt', 'r') #Read the contents into a lits Boys = infile.readlines() #Get a name to search for Name = input('Enter a name: ') #Determine if name is in list if Name in Girls or Name in Boys: print( Name, "is one of the popular names.") else: print(Name, "was not found in the list.") main()
In: Computer Science
Describe and discuss the benefits and drawbacks of environmental design.
In: Computer Science
Convert the hexadecimal number BAD D00D 60E5 F00l to binary, octal, base-4. Show your work.
In: Computer Science
In: Computer Science
#include<iostream>
using namespace std;
void calcSumAndDiff(int ,int, int &, int &);
void calcSumAndDiff(int n1,int n2, int &sum, int &diff){
sum = n1 + n2;
diff = n1 - n2;
}
int main()
{
int n1,n2,sum,diff;
n1=30;n2=10;
calcSumAndDiff(n1,n2,sum,diff);
cout<<"Sum is
:"<<sum<<endl;
cout<<"Diff is:"<<diff<<endl;
system("pause");
}
In: Computer Science
Write an algorithm in pseudo code to find one element and delete it in a doubly linked list. Your algorithm will print the original list, request the user to put in an element to be deleted, then print the final list after the deletion is done. If the element doesn’t exist in the list, print "XXX is not in the list" where "XXX" should be the one you received from the user.
Use the following as your test cases to evaluate whether your algorithm works correctly:
if you have a linked list: 3<->2<->0,
with user input 5, your algorithm should print "5 is not in the list".
with user input 2, your algorithm should print "3<->0".
if your linked list is empty, with user input 5, your algorithm should print "5 is not in the list".
In: Computer Science