1. How are a buffer and a NOT gate similar?
2. How are a buffer and a NOT gate different?
3. When interfacing an Arduino output to a higher voltage, explain how a buffer could be used.
4. What diagram do we use to code the AND function?
5. What diagram do we use to code the OR function?
6. Draw the international diagram for an AND gate.
7. Draw the international diagram for an OR gate.
8. Draw, the truth table for a 3 input AND gate, including the output.
9. Draw the truth table for a 3 input OR gate, including the output.
10. When does 1 + 1 = 1?
In: Computer Science
In: Computer Science
Submission Guidelines
This assignment may be submitted for full credit until Friday, October 4th at 11:59pm. Late submissions will be accepted for one week past the regular submission deadline but will receive a 20pt penalty. Submit your work as a single HTML file. It is strongly recommended to submit your assignment early, in case problems arise with the submission process.
Assignment
For this assignment, you will write a timer application in HTML and JavaScript.
Your HTML document should contain the following elements/features:
Evaluation
Your assignment will be graded according to whether all the required elements are present and in the correct formats and all required functionalities are operable.
In: Computer Science
Need to program a maze traversal program using dynamic array and stacks. The problem is faced in setting up the data structure and due the problem in setting the data structure other functions like moving in all direction, marking the current cell that is visited are showing the error.
The work so far is below:
const int R = 5; //Number of rows
const int C = 5; //Number of columns
class coordinate
{
public:
int v;
int h;
};
class stack
{
public:
coordinate x;
coordinate y;
};
The maze looks like:
# # S _ #
_ _ _ # #
_ # # _ #
_ _ # # #
_ _ _ _ G
where S = starting point, G = end point, _ = space for moving around and # = wall
In: Computer Science
Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum = 40:
20 10 5 2 1
In java
import java.util.Scanner;
public class DivideByTwoLoop {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int userNum;
userNum = scnr.nextInt();
*insert code*
System.out.println("");
}
}
In: Computer Science
Question 1
Discuss the key functions of an operating system, and how these functions make it possible for computer applications to effectively utilize computer system resources.
Compare and contrast the Windows API and the POSIX API and briefly explain how these APIs can be applied in systems programming.
Write a C/C++ program to create a file in a specified folder of the Windows file system, and write some text to the file. Compile and run the program and copy the source code into your answer booklet.
In: Computer Science
In: Computer Science
/* complete javascript file according to the individual instructions given in the comments. */ // 1) Prompt the user to enter their first name. // Display an alert with a personal greeting for the user // with their first name (example: Hello, Dave!) // 2) Create a Try code block that will cause a ReferenceError. // Create a Catch code block that will display the error in the // console with console.error() // 3) Prompt the user to enter a number. If the user input is // not a number, throw a custom error to the console and alert // the user. // Solving a Problem! // 4) Create a function named productOf() that accepts // two numbers as parameters: productOf(num1,num2) // Create a Try block in the function that checks to see if // num1 and num2 are numbers. // If both parameters are numbers, return the product of // the two numbers: num1 * num2 // If either num1 or num2 are not numbers, throw a custom // error to the console and alert the user. // After defining the function, ask the user to enter a number. // Then ask the user to enter a second number. // Call the function with the values entered by the user. // Solving a Problem! // 5) Create a loop that counts from 1 to 20. // If the current number is even, add it to this empty array: var myArray = []; // If the current number is odd, log an odd number warning to // the console. // However, if the number equals 19, set a debug breakpoint. // After the loop completes, print the array to the console.
In: Computer Science
I am needing to initialize a server socket and wait for incoming connections in C programming. I am also required to create a thread to handle my client and able to pass messages between them asynchronously. I would ideally like to start my server with pthreads to allow for multiple connections.
I have 2 functions started:
int serverRun(){
this will be the meat of the server code with sockets
}
int serverStart()
{
This is where I want to initiate the server
}
In: Computer Science
Use python 2.7 & plotly (dash) to draw bar/line graph for below data
OrderedDict([('0K', 7.239253544865276), ('PK', 3.236322216916338), ('1', 6.415793586505012), ('2', 6.020145027564326), ('3', 5.658685936530415), ('4', 5.37435274038192), ('5', 5.1860079887723085), ('6', 5.035941053040876), ('7', 5.1264549715408), ('8', 5.553318856838249), ('9', 12.200551540951867), ('10', 11.195203964258715), ('11', 8.990680759944928), ('12', 12.767287811888968)])
Make sure all keys, especially the 0K & PK, are showing in the x-axis.
In: Computer Science
Please code the following, using the language java!
Build a simple calculator that ignores order of operations. This “infix” calculator will read in a String from the user and calculate the results of that String from left to right. Consider the following left-to-right calculations:
"4 + 4 / 2" "Answer is 4" //not 6, since the addition occurs first when reading from left to right
“1 * -3 + 6 / 3” “Answer is 1” //and not -1Start by copying the driver code below.
Read this program and notice the comments before you proceed –your assignments in the lecture section will require you to comment accordingly, or they will drop a complete letter grade! Begin tracing the program in main, and your code will go in the calculate() function, so start writing code there. Hints:
import ?; /* * InFixCalc, V0.0 (concept borrowed from Carol Zander's Infix Calculator) * Complete the calculate() function below to build a simple, infix * calculator that evaluates a compound expression from left to right, * regardless of operator precedence * * Example: " 1 * -3 + 6 / 3" * Execution: calculate 1 * -3 first, then -3 + 6 next, then 3 / 3 * last to obtain the value 1 * * Solution by */ public class InFixCalc { //example pattern: "3 + 5" //general pattern: <lhs='3'> <operation='+'> <rhs='5'> //extended pattern: ... //special case: //other special cases? public static void main(String[] args) { //String input = "4 + 4"; //String input = "4 + 4 / 2"; //String input ="1 * -3"; String input ="1 * -3 + 6 / 3"; //String input ="5"; //String input ="-5"; int answer = calculate(input); System.out.println("Answer is " + answer); } //preconditions: all binary operations are separated via a space //postconditions: returns the result of the processed string public static int calculate(String input) { int lhs,rhs; //short for left-hand & right-hand side char operation; /*todo: your name and code goes here*/ /*You need a Scanner(or StringTokenizer) to get tokens *Then you need a loop, and switch inside that loop*/ return lhs; } }
In: Computer Science
Let’s give a formal proof that RadixSort works and give a bound on its runtime.
We start with correctness:
Lemma RadixSort will properly sort any n natural numbers.
Prove this statement. You can use any strategy you want, but we
recommend using induction on l (the number of digits that each
value has).
In: Computer Science
In: Computer Science
CREATE TABLE campaign
(
cmte_id varchar(12),
cand_id varchar(12),
cand_nm varchar(40),
contbr_nm varchar(40),
contbr_city varchar(40),
contbr_st varchar(40),
contbr_zip varchar(20),
contbr_employer varchar(60),
contbr_occupation varchar(40),
contb_receipt_amt numeric(6,2),
contb_receipt_dt varchar(20),
receipt_desc varchar(40),
memo_cd varchar(20),
memo_text varchar(20),
form_tp varchar(20),
file_num varchar(20),
tran_id varchar(20),
election_tp varchar(20)
Write SQL queries using the campaign data table.
-- 4. show the candidate name and number of contributions, for each candidate
-- Order by decreasing number of contributions.
-- 5. show the candidate name and average contribution amount for each candidate,
-- looking at positive contributions only
-- Order by decreasing average contribution amount.
-- 6. show the candidate name and the total amount received by each candidate.
-- Order the output by total amount received.
In: Computer Science
Python
Explain what happens when a user clicks a command button in a fully functioning GUI program.
In: Computer Science