Consider which layer of the OSI-model is the most appropriate
for the
following functions and devices.
(a) Routing:
(b) SSH-connection for remote use:
(c) Ethernet-media repeater:
(d) Ethernet-switch:
(e) SNMP-based network management agent running in Ethernet
switch:
(f) Error Detection:
(g) Fiber cable:
In: Computer Science
While Base64 is a weak encryption standard it is still used to provide a basic means of encryption for email servers. Answer the following questions and provide a discussion about the Base64 Encryption Standard. Remember the initial posting is 100 words or more, and the replies are 60 words or more.
What is Base64?
Name two Services that use Base64?
Why is Base64 still used?
In: Computer Science
(a) How are rules for lexical analysis written? (b) What are these rules used for?
In: Computer Science
1.Why is important to understand dynamic multi-dimension arrays as “arrays of arrays?”
a.Each dimension requires another “pointer layer” which we have to build as arrays of pointers which in turn possibly point to arrays of pointers which eventually point to an array of the data type. Each array is allocated ‘where it fits’ at the time of creation, each of these arrays can be uniquely sized as well.
b.It just helps us organize the data in our head, in reality all the information is sequential anyway
c.Each dynamically allocated array is placed in memory ‘where it fits’ at the time of creation, meaning each pointer points to a single array of the data type.
d.none of these
.
2.When passing by pointer ... the pointer itself is passed by value. The value in this method is that we can use the pointer to make changes in memory.
a.true
b.false
.
3.Which of the following describes Passing by Reference?
a. The actual variable memory is passed into the function and any activity done to the parameter is reflected outside the function as well.
b.The address is passed through and needs to be de-referenced to work with the value contained within. Activity done to the de-referenced value is reflected outside the function. NULL is a valid value to pass and should be handled.
c.The value is passed in as a copy. Any activity done to the parameter stays local to the function and is not reflected outside. NULL is not valid to be passed.
d.A literal is passed to the function and the parameter is treated as a constant. No activity can be done on the parameter and nothing is reflected outside the function.
In: Computer Science
Consider the word CAT
a) What would the hexadecimal representation of this word be in ASCII?
c) If we rotated the bits that represent this word 8 bits to the right, what would the word become (in letters)?
d) If we rotated the bits that represent CAT 8 places to the left, what would the word become (in letters)?
e) What would the results be (in letters) if we XORed the bits that represent CAT with the hexadecimal value 20 20 20?
f) What would the results be (in letters) if we XORed the bits that represent CAT with the hexadecimal value 13 08 13?
In: Computer Science
relationship=input('Enter the relationship status: ') #taking
input from user
income=int(input('Enter the income of the user: '))
if relationship.lower()=="single":
income>=30000:
rate=0.25
else:
rate=0.1
if relationship.lower()=="married": #function to covert upper case
to lower case,in case user gives the input in caps
if income>=60000:
rate=0.25
else:
rate=0.1
tax=income*rate
print("Status: {}\nIncome: {}\nTax:
{}".format(relationship,income,tax))
Fix this code so it prit out married or single status and the user income
In: Computer Science
This is in C++ Write a program that reads a string consisting of a positive integer or a positive decimal number and converts the number to the numeric format. If the string consists of a decimal number, The program must use a stack to convert the decimal number to the numeric format. I keep getting an error around line 31 stating that there is an undefined function stObj.push(*it - 48); -- any help to fix my error would be helpful, thank you in advance.
Here is my code:
#include <iostream>
#include <string>
#include <stack>
#include <math.h>
using namespace std;
//main method
int main()
{
//Declare local variables
string input;
double number = 0;
int index = 0;
//declare the stack of type integer
stack<int> stObj;
//prompt and read the input number
//of type string
cout << "Enter a decimal number:";
cin >> input;
//declare iterator
string::iterator iterObj = input.begin();
//push the number into the stack
//increment the index of the stack
while (*iterObj != '.' && iterObj !=
input.end())
{
//push into the stack
stObj.push(*it - 48);
iterObj++;
index = index + 1;
}
//compute the integral part of the number
for (int i = 0; i < index; i++)
{
number = number +
(stObj.top()*pow(10, i));
stObj.pop();
}
//consider the fractional part
index = -1;
if (iterObj != input.end())
{
//increment the interator for the
memory address
iterObj++;
}
//compute the fractional part to number
while (iterObj != input.end())
{
number = number + ((*iterObj -
48)*pow(10, index));
index = index - 1;
iterObj++;
}
//Display the decimal number
cout << "The numeric format: " << number
<< endl;
}
In: Computer Science
Consider the language L over alphabets (a, b) that produces strings of the form aa* (a + b) b*a.
a) Construct a nondeterministic finite automata (NFA) for the language L given
b) Construct a deterministic finite automaton (DFA) for the NFA you have constructed
In: Computer Science
What are three incidences in which animations or transitions may be appropriate in a business presentation and then three cases in which you think they'd be too much?
In: Computer Science
Using c++
Im trying to figure out a good user validation for this loop. So that if a valid number is not input, it gives an error message. I have the error message printing but its creates an infinite loop. Need some help.
double get_fahrenheit(double c){
double f;
f = (c * 9.0) / 5.0 + 32;
return f;
}
#include "question2.h"
#include<iostream>
#include<string>
using std::cout; using std::cin; using std::string;
int main()
{
double c;
double f;
double user_exit = 444;
do{
cout<<"Enter Celsius (Enter 444 to exit)\n";
cin>>c;
if(cin.good()){
f = get_fahrenheit(c);
cout<<c<<" degrees celsius is "<<f<<" degrees fahrenheit. \n\n";
break;
}else {
cout<<"Invalid Input! Please input a numerical value. \n";
cin.clear();
}
}while(c != user_exit);
cout<<"Goodbye!";
return 0;
}
In: Computer Science
Can somebody explain me what this code does in a few or one sentence?
#include <iostream>
#include <vector>
using namespace std;
int main () {
const int NUM_ELEMENTS = 8;
vector<int> numbers(NUM_ELEMENTS);
int i = 0;
int tmpValue = 0;
cout << "Enter " << NUM_ELEMENTS
<< " integer values..." << endl;
for (i = 0; i < NUM_ELEMENTS; ++i) {
cout << "Enter Value#"
<< i+1 << ": ";
cin >> numbers.at(i);
}
for (i = 0; i < (NUM_ELEMENTS /2); ++i) {
tmpValue = numbers.at(i);
numbers.at(i) =
numbers.at(NUM_ELEMENTS - 1 - i);
numbers.at(NUM_ELEMENTS - 1 - i) =
tmpValue;
}
system ("pause");
return 0;
}
In: Computer Science
Write a C program to take two integer arrays in ascending order and combine them in a new array in descending order. Remove any duplicates in the final array, if any. Your code must store the arrays as a linked list of objects, each put in a “struct.” All operations should also be carried out using linked lists.
Input: 2 sorted arrays, each on a new line.
Output: An array sorted in descending order, without duplicates.
There is a single white space after each number, even after the last number. There is no new line at the end. Use the following struct as a reference:
struct ELEMENT {
int value;
struct ELEMENT *next;
};
=== Sample test case 1 ===
Input:
2 15 18 34 67 87 88
3 8 18 33 67 89 91
Output:
91 89 88 87 67 34 33 18 15 8 3 2
=== Sample test case 2 ===
Input:
28 36 57 59 68 69 420
17 37 57 59 68
Output:
420 69 68 59 57 37 36 28 17
In: Computer Science
1.Read the Lab6-Background.pdf first.2.Start the “Stack Queue”
applet.3.The purpose of this exercise is to see how you could
reverse a list of names. Push the three names “Alice,” “Bob,” and
“Charles” onto the stack. When you pop the stack 3 times, what do
you see in the text field next to “Pop”?4.Write an algorithm in
pseudo-codethat would describe how to use a stack to reversea
sequence (list)of letters and print them. For instance, if the
original sequence is COMPUTERthe output will be RETUPMOC. Review
pages 249-250 of the textbook(Chapter8)to see the related sample
pseudo-codes.5.A palindrome word is one that has the same sequence
of letters if you read it from right to left or left to right(e.g.,
radar or madam). Describe (in terms of a pseudo-code) how you could
use a stack in conjunction with the original listto determine if a
sequence is a palindrome.Hint:Given that the letters have been
already assigned to both stackand the queueand these two data
structures are ready to be processed (compared).
In: Computer Science
In: Computer Science