As you consider computer hardware and software, what hardware element do you think impact software performance the most?
In: Computer Science
*Need to write the pseudocode for this given C++ code*:
public:
slist(): head_(nullptr), size_(0) {}
void prepend(int data)
{
snode* newnode = new
snode(data, head_);
head_ = newnode;
++size_;
}
bool empty() const
{
return size_ == 0;
}
size_t size() const{
return size_;
}
friend std::ostream& operator
<<(std::ostream& os, const slist sli){
if(sli.empty()){
return os << "list empty\n";
}
snode* p =
sli.head_;
while(p!=
nullptr){
os << *p << "\n";
p=p->next_;
}
return os;
}
int get_largest() const
{
snode*p = head_;
int largest =
p->data_;
while(p !=
nullptr){
if (p->data_ > largest)
{
largest = p->data_;
}
p = p->next_;
}
return largest;
}
bool is_greater(int n){
return
is_greater_helper(head_,n);
}
bool is_greater_helper(snode* p ,int n){
if(p->next_ ==
nullptr){return n > p->data_;}
return n >
p->data_ && is_greater_helper(p->next_, n);
}
In: Computer Science
How is testing a software system like inspecting a house?
In: Computer Science
You were introduced to control structures - such as IF-ELSE statement, WHILE and FOR loops. Describe what they do and why are control structures important to programming?
In: Computer Science
mention some RFID anti-collision protocols ?
In: Computer Science
3. To get some idea on what is involved in digital transmission of multimedia traffic, complete the following:
3.1. In PAM encoding, the general rule is that we need to sample at
twice the bandwidth. In addition, if we use n bits for each sample,
we can represent 2n loudness (amplitude) levels. What transmission
speed would you need if you wanted to encode and transmit, in real
time and without compression, two-channel music with a bandwidth of
20 kHz and 40,000 loudness levels?
3.2. How much disk space would your require to store 30 minutes of
digital music as you calculated above?
3.3. Assume that the 30 minutes of uncompressed digital music is to
be transmitted over a DS-0 digital circuit at 64 Kbps. How long
will it take to complete the transmission? Express you result in
hours/minutes if necessary.
In: Computer Science
1, Considering using sorted and unsorted array as priority queue to do sorting. For an input array, we insert each element to a PQ and remove them out to an output array. Please write the arrays below:
Input array: 2,7,5,3
Input array: 2,7,5,3
2, If I use upheap strategy to construct a heap(array as implementation) from above array, what is the array of the heap of each step?
In: Computer Science
How to fix this debugging in java
Problem Debugging
This problem is to assign a value to num2 based on the input value of num1. It should then print both numbers.
int num1 = 0;
int num2 = 0;
System.out.print("Enter a number - 1, 2, or 3: ");
num1 = keyboard.nextInt();
if (num1 == 1);
num2 = 2;
else if (num1 == 2);
num2 = 3;
else if (num1 == 3);
num2 = 4;
System.out.println("num1 = " + num1 // + " and num2 = " + num2);
System.out.println("\n");
In: Computer Science
In: Computer Science
Create your own function in C that accepts one input number and returns a double number. The themes for the functions should be one of the following:
Divides the number by 3 and returns the result. For example, if 6 was input then 2.0 should be returned.
provide both your C code and an example call to the C code function. Be sure to provide an overview of what your function is doing. Include header documentation in the code as well as internal code documentation.
In: Computer Science
Question 1:
The Ethernet frame format has remained unchanged since the first standard; however, the cables and the wiring scheme have changed dramatically.
A: True
B: False
Question 2:
The concept of a ___________ is allow a switch to be configured to emulate multiple, independent switches.
A. VLAN switch
B. Repeater
C. Modem
D. Bridge
Question 3:
A Virtual Local Area Network (VLAN) switch allows the switch to be reconfigured to emulate multiple, independent switches.
A. True
B. False
Question 4:
The IEEE 802.1Q standard allows
A. connections to multiple bridging devices on multiple LAN segments.
B. multiple VLAN switches to be interconnected and to operate like a giant VLAN switch.
C. a single switch to emulate multiple, independent switches.
D. switches to connect to a virtual WAN router.
Question 5:
The purpose of a Distributed Spanning Tree (DST) is to
A. include additional LAN segments on a network.
B. increase distances a message can be forwarded.
C. prevent broadcast messages from flowing in an endless loop.
D. associate a wireless host with an access point.
In: Computer Science
In: Computer Science
Consider the following database schema for a BOOKSTORE database:
The Books relation stores information about books sold by the bookstore. Note that bookid is the primary key. An example tuple is as follows:
(105, 'JAVA PROGRAMMING', 'JOHN DOE', 2001)
The Customers relation stores information about the customers of the bookstore. Note that customerid is the primary key. An example tuple is as follows:
(210, 'JOHN SMITH', '[email protected]')
The Purchases relation stores information about the customer purchases of books. Note that customerid and bookid form the primary key. An example tuple is as follows:
(210, 105, 2002), indicating that 'JOHN SMITH' with customerid 210 purchased the 'JAVA PROGRAMMING' book with bookid 105 in the year 2002.
The Reviews relation stores information about the customer reviews/ratings of the books. The ratings field refers to the number of "stars" given to the book. Note that customerid and bookid form the primary key. An example tuple is as follows:
(210, 105, 3), indicating that 'JOHN SMITH' with customerid 210 gave a 3-star rating to the 'JAVA PROGRAMMING' book with bookid 105.
The Pricing relation stores information about the price of the various books sold by the bookstore. Note that the same book can be available in multiple formats at possibly different prices. The price field refers to the number of dollars. For instance a $25 purchase will have a price field of 25. Note that the bookid and format fields form the primary key for the relation. An example tuple is as follows:
(105, 'AUDIO', 25), indicating that the 'JAVA PROGRAMMING' book with bookid 105 is available in the audio format for $25.
Given the above schema, write queries for the following:
In: Computer Science
Is Copper completely obsolete?
Here is a direct quote from “Why such slow Wi-Fi?” in a recent Los
Angeles Times article:
“In an analysis of fixed broadband and mobile speeds in July,
Speedtest ranked the United State No. 9 for broadband and No. 46
for mobile (Nos.1, respectively, Singapore and Norway. Last:
Venezuela and Iraq). Part of the issue for Americans: Many of us
still have home service based on copper wire, not fiber.
Craig Ganssle, chief executive of Camp3, which works on wireless
infrastructures, explains this difference: Copper service is based
on the speed of sound (generally about 1,125 feet per second if
it’s 68 degrees and the air is dry), and fiber is based on the
speed of light (about 984 million feet per second).”
With a few exceptions, most of us get our home Internet access
through a cable modem and the wires that connect our modems to our
ISPs are made of copper. Let’s assume you are streaming a Netflix
movie. The nearest Open Connect appliance, which Netflix uses to
host and deliver movies to customers (see Chapter 11, pg. 360), is
3 miles from your home. Let’s also assume you have already found
the movie to watch and is ready to start. You click on the Play
button, a one-bit signal is sent over the 3-mile copper wire to
reach the Open Connect appliance, which then starts sending the
digitized movie frames back to your home, also over the 3-mile
copper wire.
Questions:
a. Given the quoted speeds above (i.e., 1,125 feet per second vs.
984 million feet per second), from the moment you click the Play
button, to the moment the first frame of the movie appears on your
screen, how long will it take (round-trip time) over a copper wire?
Over a fiber optic cable?
Note: 1 mile = 5,280 feet
Round-trip time = (Distance / Speed) × 2
b. How does your calculated result over a copper wire compare to
your own experience of streaming movies on the Internet, excluding
any buffering time? Do you see any problem with what the expert in
the article above was saying? Hint: this expert did not get some
basic facts of physics right.
In: Computer Science
HTML WEBSITE WITH CSS LAYOUT
1. Create a studentregistration form with the following
fields:
> Email Address (Email)
> Desired Username (Text box)
> Password (Password)
> Family name (Text box)
> Middle Name/Initial (Text box)
> First name (Text box)
> Gender (Radio Button - Male or Female only!)
> ID Number (Text box)
> Mobile Number (Text box)
> Landline Number (Text box)
> Permanent Home Address (Text box)
> Degree/Course (Text box)
> Year Level (Drop down - year 1 to 5)
> Campus (Radio Button - Main Campus, Banilad Campus, LM Campus,
Mambaling Campus)
> Name of Father (Text box)
> Name of Mother (Text box)
> Name of Guardian (Text box)
> Hobbies (Checkbox, a user can select multiple hobbies, at
least 10 hoobies listed)
> Interests (Checkbox, a user can select multiple interest, at
least 10 interest listed)
> Civil Status (Dropdown - Single, Married, Separated,
Widow)
> Favorite Color (Color Picker)
> Date of Birth (Month, Day, Year - three textboxes)
> Describe yourself (Text area)
> Rate your satisfaction inside UC (Range input - ranging from 1
- 10)
> Submit button (Display "Registered" in a separate page when
the user click this button - this is only for display, no backend
scripts required to save the data)
> Clear button (Clear all the fields when user clicks)
2. Create a login form.
> Username
> Password
> Login Button
> Reset Button
* Arrange all your fields in a table format. You can also use the
fieldset element to arrange your fields.
* Make your design clean as possible.
* Make all your fonts readable.
* If you want to use/apply colors, use only 3 colors.
* Include the Registration and Login Links in the menu area.
* Maintain the layout of your page.
In: Computer Science