1. What is output by the following C++ code segment? Assume myList is an initially empty linked list that can store floats. Draw the linked list (with head, nodes, and pointers) to show how it looks conceptually by the time the code completes executing.
FloatList myList;
myList.insertNode(5.25);
myList.insertNode(2.14);
myList.appendNode(9.11);
for (int x = 1; x < 4; x++)
myList.insertNode(x * 0.1);
myList.deleteNode(2.14);
myList.displayList();
Output:
Linked list drawing:
In: Computer Science
Exercise3: GuessingGame.cpp
In: Computer Science
Search online to find an incident of cybercrime (not included in the readings) or create one yourself. Please describe the event and explain which theory from the week’s readings can be used to explain the cybercrime. Why do you think so? Write a 1 to 2 page paper answering these questions. Choose a cybercrime with a real-world example of a cybercrime and use either the routine activities or rational choice theory to examine the facts of the crime.
In: Computer Science
Consider the following substitution block cipher:
Plain-text
000 110
001 100
010 111
011 001
100 101
101 000
110 010
111 011
Cipher-text
[10]
Compute the cipher-text belonging to plaintext 001 110 000 101 110 (using a block size of 3 bits) for the Electronic Code Book (ECB) mode and Cipher Block Chaining (CBC) mode taking IV = 111. Show the intermediate steps.
In: Computer Science
Using Python 3
Write a program that reads the 4letterwords.txt file and outputs a file called 4letterwords.out that has every word found in 4letterwords.txt but each word on one line. Any leading and trailing blank spaces must be removed in the output file.
In: Computer Science
In: Computer Science
Write a procedure of bubble sort to sort the array of byte. This
procedure receives
two arguments, firstly it receives the offset of array in SI
register, secondly BX
contains number of elements. Write a program that user Enter a
single digit
number, these numbers have one space between them, call bubble sort
procedure
for sorting the numbers
8086 assembly code
In: Computer Science
The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly instruction. What is the RISC-V instruction format and specific assembly language instruction?
0x40158a33
In: Computer Science
[P∧¬P]→Q is a tautology and is a
valid argument. A valid argument can be sound or unsound. An
invalid argument, however, can not be sound. Would the above
argument be sound or sound? Why or why not?
In: Computer Science
in java
Write program that draws out a path based on the user input. The starting coordinates for the path is the middle of the DrawingPanel. Ask the user to enter an x and a y coordinate for a DrawingPanel. Your program will draw a line from the last coordinates to the current coordinates the user enters. If the user enters an x value or y value out of bounds of the DrawingPanel, then end the program.
In: Computer Science
Assuming binding priority (¬, ∧, ∨, →), are these sequents valid or not? If they are valid, how do you prove it? If they are not valid, what would the truth table be?
In: Computer Science
1. What is the ouput (what are in the Bag) when the 2 below lines are executed? Please show the steps. String[] items = {"Z", "Y", "Y", "X", "S", "C", "A", "E", "M"}; testAdd(aBag, items);
2.
What is the output (what are in the Bag) when the 3 below lines are executed? Please show the steps.
String[] testString = { "X", "Y", "Z" };
aBag.removeAllOccurences(testString);
displayBag(aBag);
In: Computer Science
2. Create two class, a student class, and a course class, take advantage of the codes provided in the class slides and sample codes. python
Student |
Course |
__Username:str __Courses:list |
__courseName:str __students: list |
addCourse():None dropCourse():None getCourse():list |
addStudent:None dropStudent:None getStudents():list getNumber of students:int |
3. Create a student object for every student in the UD.txt (you can use a loop for this)
4. Create 6 course objects:
1. CS131 2. CS132 3. EE210 4. EE310 5. Math320 6. Math220 |
5. After the student user login to their account as we have done in lab 2. Display the following:
A: Show all courses available B: Add a course C: Drop a course D: Show all my courses E: Exit |
When students choose option A, should display the following, where # is the actual number of students enrolled in the class.
1. CS131 students number:# 2. CS132 students number:# 3. EE210 students number:# 4. EE310 students number:# 5. Math 320 students number:# 6. Math 220 students number:# |
Let the students add or drop a classes as they wish. When they choose E, exit the program.
6. For option D, show the courses in the student’s course list.
7. The hard part. Since your program will end when user chose option E. You need to keep track the classes been added and dropped by each students, and who are actually in the classes. Therefore, based on your experiences in lab 3 and 4, create a SI.txt (student info) to store the courses in each student’s course list. Create CI.txt (course info) to store all the students enrolled in each course. This will be executed in the background every time when the user chose option E: Exit. When you run your program, and create your course objects, this information needs to be read into each student and course object. When a student log into his or her account, the student should be able to see what courses is in the course list by chose option D. The number of students in each course also need to be displayed in Option A.
Student info
UD.txt
USERNAME,PASSWORD sdd233,Pad231 dcf987, BHYW4fw dgr803,Sb83d2d mkr212,UNNHS322 lki065,dgw6234 ped332,9891ds ytr876,dsid21kk nmh223,3282jd3d2
In: Computer Science
C programing.
Ask user to enter a word on sting and print all possible
combinations. (please don't use printer) Using recursion.
example
ask user to input
user: "ABC"
output:
ABC
ACB
BAC
BCA
CAB
CBA
In: Computer Science
What to do
This assignment is going to be pretty simple - we're just going compute frequency counts of certain colors in certain ranges (Histogram of the image).
Because there is no natural way of segregating RGB color ranges, we usually do this color by color. So you'll be computing frequency counts for individual color components individually.
The expectation is that you will write a function as described by a python function signature below (while you are free to do whatever you want, I think doing future parts of the assignment will be easier if the code is structured this way) -
Think about what happens when one is comparing images of different sizes -
To make sure similar images have similar histograms regardless of image size, it is good to normalise frequencies by dividing each frequency count by the total number of pixel in the image.
In: Computer Science