Question 1
A local online trading company, Bursa Malaysia (BSKL) is running out of capacity and performance with the current storage system. BSKL has decided to own a RAID system at a reasonable cost to increase the speed, capacity, availability and scalability of the trading activities.
(a) Identify any FIVE (5) RAID systems that might be suitable for BSKL. (Refer to the BSKL website to understand the online activities that have been actively running.)
[10 marks]
In: Computer Science
(Python Programming)
You are asked to develop a cash register for a fruit shop that sells oranges and apples. The program will first ask the number of customers. Subsequently, for each customer, it will ask the name of the customer and the number of oranges and apples they would like to buy. And then print a summary of what they bought along with the bill as illustrated in the session below:
How many customers? 2 Name of Customer 1 Harry Oranges are $1.40 each. How many Oranges? 1 Apples are $.75 each. How many Apples? 2 Harry, you bought 1 Orange(s) and 2 Apple(s). Your bill is $2.9 Name of Customer 2 Sandy Oranges are $1.40 each. How many Oranges? 10 Apples are $.75 each. How many Apples? 4 Sandy, you bought 10 Orange(s) and 4 Apple(s). Your bill is $17.0
In: Computer Science
Exercise 1:
Write an XML document describing the exercises in this document: the root element is <exercises>. The root has an attribute number that has value 1. The root element has three child elements; <date> that contains as text the date of the exercise, and two <item> elements for the first two exercises (1--2). Write some text in the <item> elements.
Exercise 2:
Write an XML document describing a person: name, occupation, address and hobbies. Please do not use your own information, you can use fake data. Decide on suitable element names and nesting. Check your document for well-formedness.
Exercise 3:
Draw a tree that represents the XML document you created in task 2.
Exercise 4:
This is the books.xml file
<?xml version='1.0'?>
<!-- This file represents a fragment of a book store inventory
database -->
<bookstore>
<book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin
Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
<book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
<author>
<first-name>Herman</first-name>
<last-name>Melville</last-name>
</author>
<price>11.99</price>
</book>
<book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
<author>
<name>Plato</name>
</author>
<price>9.99</price>
</book>
</bookstore>
Using books.xml as a model, create a small xml file for a student's
program of study form called programOfStudy.xml. It should capture
the following data:
In: Computer Science
Project: Use SMTP to send an email
1. Start a connection
2. Say hello to the server
helo networking
3. Login request
auth login
4. Input username
For example,
Plaintext: networkingtest2018
BASE64: bmV0d29ya2luZ3Rlc3QyMDE4
5. Input password
BASE64: Your passwordxxxxxx
after inputting your password, you will see
means you have already logged in.
6. Input sender and receiver’s information
, which
Note that go to https://www.base64decode.org/ to find the
encoded BASE64 phrase of your username and password.
7. Start drafting your email by typing data
8. Write your email
Subject:Hello
xxx
xxx
.
9. Finish writing your email and send.
If you want to finish writing, enter an enter to have a new line and input a dot.
10. Log out by inputting a quit
In: Computer Science
Describe in detail the encryption and decryption process for Simplified DES by showing your results at each step Details of decryption process:
input: 10 bit key = 1 1 1 1 1 1 1 1 1 1 and 8 bit plaintext = 0 0 0 0 0 0 0 0
Output from IP =
Output from first Fk using K2 =
Output from SW =
Output from first Fk using K1 =
Output from IP-1 =
In: Computer Science
Python 3 Program
Program 4 should first tell users that this is a word analysis software. For any user-given text file, the program will read, analyze, and write each word with the line numbers where the word is found in an output file. A word may appear in multiple lines. A word shows more than once at a line, the line number will be only recorded one time.
Ask a user to enter the name of a text file. Using try/except for invalid user input. Then the program reads the contents of the text file and create a dictionary in which the key-value pairs are described as follows:
Key. The key are the individual words found in the file.
Value. Each value is a list that contains the line numbers in the file where the word (the key) is found. Be aware that a list may have only one element.
Once the dictionary has been built, the program should create another text file for otuput, named “words_index.txt”. Next, write the contents of the dictionary to the file as an alphabetical listing of the words that are stored as keys in the dictionary (sorting the keys), along with the line numbers where the words appear in the original file. Please see the sample file for your reference.
Looking to seeing everyone to submit a well-done program! Here are some tips:
Documents/Comments of your program (Never more)
Testing your program by the given two files, Kennedy.txt . The output file of the Kennedy_index.txt, Kennedy_index_B.txt, Kennedy_index_C.txt, for input file “kennedy.txt”
Remember the output file name of your program is words_index.txt.
For this program, not running one (syntax error) will receive NO point.
Example of original text- Kennedy.txt
We observe today not a victory of party but a celebration of freedom symbolizing an end as well as a beginning signifying renewal as well as change
New text example - Kennedy_index.txt
Text File to be analyzed: Kennedy.txt We: 1 a: 1, 2, 4 an: 3 as: 4, 5, 6 beginning: 4 but: 2 celebration: 2 change: 6 end: 3 freedom: 3 not: 1 observe: 1 of: 2, 3 party: 2 renewal: 5 signifying: 5 symbolizing: 3 today: 1 victory: 1 well: 4, 5
example- Kenndy_index_B.txt
Text File to be analyzed: kennedy.txt
We : 1
a : 1, 2, 4
an : 3
as : 4, 5, 6
beginning : 4
but : 2
celebration : 2
change : 6
end : 3
freedom : 3
not : 1
observe : 1
of : 2, 3
party : 2
renewal : 5
signifying : 5
symbolizing : 3
today : 1
victory : 1
well : 4, 5
example- Kenndy_index_C.txt
Text File to be analyzed: kennedy.txt We : 1 a : 1, 2, 4 an : 3 as : 4, 5, 6 beginning : 4 but : 2 celebration : 2 change : 6 end : 3 freedom : 3 not : 1 observe : 1 of : 2, 3 party : 2 renewal : 5 signifying : 5 symbolizing : 3 today : 1 victory : 1 well : 4, 5
In: Computer Science
Shell script program that asks a number between 5 to 9. If the input is not between 5 and 9, display an error message and ask again.
Output
1
22
333
4444
55555
666666
7777777
88888888
999999999
In: Computer Science
Draw an ER diagram containing the ConferenceSeries, the ConferenceEvent, and the ConferenceTrack entitysets where each ConferenceSeries can be linked to zero or many ConferenceEvent entities, and each Conference Event may be linked to one or many ConferenceTracks. ConferenceTrack should not exists without a ConferenceEvent. Choose an appropriate relationship name. Then augment the model with an entityset Venue and a relationship named OrganizedAt associating each ConferenceEvent with exactly one Venue. Assume that a Venue must have run at least one ConferenceEvent. Your ER diagram should show all details. Show a translation into tables for a SQL database (topic covered in class on Tue Sept 9). Note: Add 3 attributes to each of the entity type with appropriate primary key.
In: Computer Science
does a zombie process use CPU time true or false
and is it true or false that a orphan process will find a new parent and will not use CPU time.
In: Computer Science
Show the encoding of the following machine instructions and convert into hexadecimal.
1. STUR X7, [X9, #32]
2. SUBI X16, X4, #52
3. AND X5, X20, X3
In: Computer Science
This code is an expression of cp command in c language. But I don't understand this code very well. Please explain in notes one by one.(in detail)
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<errno.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>
int main(int argc, char *argv[])
{
char ch;
int src, dst;
struct stat st;
if(argc != 3)
{
printf("argument error \n");
printf("usage: ./a.out src dest \n");
exit(0);
}
if (stat(argv[1], &st) == -1) {
perror("stat : ");
exit(-1);
}
src = open(argv[1], O_RDONLY);
if(src == -1){
perror("open source");
exit(errno);
}
dst = open(argv[2], O_WRONLY | O_CREAT|O_TRUNC);
if(dst == -1){
perror("open source");
exit(errno);
}
while(read(src, &ch,1)){
write(dst,&ch,1);
}
close(src);
close(dst);
if (chmod(argv[2], st.st_mode)) {
perror("chmod : ");
return -1;
}
return 0;
}
In: Computer Science
I need to make changes to code following the steps below. The code that needs to be modified is below the steps. Thank you.
1. Refactor Base Weapon class:
a. Remove the Weapon abstract class and create a new Interface class named WeaponInterface.
b. Add a public method fireWeapon() that returns void and takes no arguments.
c. Add a public method fireWeapon() that returns void and takes a power argument as an integer type.
d. Add a public method activate() that returns void and takes an argument as an boolean type.
2. Refactor the specialization Weapon Classes:
a. Refactor the Bomb class so that it implements the WeaponInterface class.
b. Refactor the Gun class so that that it implements the WeaponInterface class.
3. Refactor the Game Class:
a. Remove all existing game logic in main().
b. Create a private helper method fireWeapon() that takes a WeaponInterface as an argument as a weapon. For the passed in weapon activate the weapon then fire the weapon.
c. Create an array of type WeaponInterface that can hold 2 weapons.
d. Initialize the first array element with a Bomb.
e. Initialize the second array element with a Gun.
f. Loop over the weapons array and call displayArea() for each weapon.
------
// Weapon.java
public abstract class Weapon {
public void fireWeapon(int power)
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Power
:"+power);
}
public abstract void activate(boolean enable);
}
______________________
// Bomb.java
public class Bomb extends Weapon {
@Override
public void fireWeapon(int power)
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Power
:"+power);
}
public void fireWeapon()
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
super.fireWeapon(67);
}
@Override
public void activate(boolean enable) {
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Enable
:"+enable);
}
}
_____________________________
// Gun.java
public class Gun extends Weapon {
@Override
public void fireWeapon(int power)
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Power
:"+power);
}
public void fireWeapon()
{
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
super.fireWeapon(98);
}
@Override
public void activate(boolean enable) {
System.out.println("Class Name
:"+this.getClass().getSimpleName());
System.out.println("Mathod Name
:"+new Throwable().getStackTrace()[0].getMethodName());
System.out.println("Enable
:"+enable);
}
}
_____________________________
// Game.java
public class Game {
public static void main(String args[]) {
Bomb b = new Bomb();
Gun g = new Gun();
b.fireWeapon(45);
g.fireWeapon(60);
}
}
In: Computer Science
Explain how to use the C# shortcut arithmetic operators -=, *=, and /=.
In: Computer Science
C++ Please
Fill in for the functions for the code below. The functions will be implemented using vectors. Additional public helper functions or private members/functions can be used. The List class will be instantiated via a pointer and called similar to the code below:
---the code can be general (can be tested with any int main() test function)---
Stack *ptr = new Stack();
ptr->push(value);
int pop1 = ptr->pop();
int pop2 = ptr->pop();
bool isEmpty = ptr->empty();
class Stack{
public:
// Default Constructor
Stack() {// ... }
// Push integer n onto top of stack
void push(int n) {// ... }
// Pop element on top of stack
int pop() {// ... }
// Get the top element but do not pop it (peek at top of stack)
int top() {// ... }
// Return whether the stack is empty or not
bool empty() {// ... }
};
In: Computer Science
Create java class with name MyClass1
Instructions for MyClass1
For this portion of the assignment you will need to create a java class of your own to model some objects in the real world or your own imagination. your classes should have at least three instances variables, accessor and mutator methods for each of those instance variables, one constructor method of any type, as well as an overridden toString method that will display every field value as part of a String. Use meaningful identifiers for the name of class.
Demonstrate that your class work appropriately by creating instances of each in the MainClass class which contains a main method
In: Computer Science