Why is anonymity different in TWN and WLAN?
explain the 802.11 shared-key authentication process
In: Computer Science
For practice using exceptions, this exercise will use a try/catch block to validate integer input from a user. Write a brief program to test the user input. Use a try/catch block, request user entry of an integer, use Scanner to read the input, throw an InputMismatchException if the input is not valid, and display "This is an invalid entry, please enter an integer" when an exception is thrown. InputMismatchException is one of the existing Java exceptions thrown by the Scanner if the input does not match the type requested.
In: Computer Science
Goals Practice loops and conditional statements Description Create a game for elementary school students to practice multiplication. The application should display a greeting followed by a set of mathematical questions. In each set the player is asked to enter a number from 1 to 9 to test multiplication skills or to press ‘E’ to exit the game. The application checks if the number entered is indeed between 1 and 9 and if not displays a message inviting the player to try again. Upon receiving a number in a proper range the application starts displaying multiplication questions with that number being multiplied by 0,1,2,…,10. For example, if the player entered number 3, the first question will be: “3 x 0 = ?”, the second: “3 x 1 = ?”, and so on with the last question being “3 x 10 = ?” At any point the player can press ‘E’ to exit current set For each question if an incorrect result is entered the application prompts the player to try again. The player can choose to try again or bypass. The application provides up to 4 replay attempts to answer the same question. For each question, the maximum score is 5 points if answered correctly. If not, each replay attempt lowers the score by 1 point. For example, if the player answered a question wrong and then got it right on the first replay attempt, the score is 4 points. Once the set is finished, a score for the set is presented and the player is invited to try another set.
In: Computer Science
QUESTION 15
Which line coding technique represents logical “1s” as alternating voltage changes (e.g., 1,1 represented as +v, -v).
|
a. Non-return to zero (NRZ) |
||
|
b. Bipolar Alternative Mark Inversion (AMI) |
||
|
c. Manchester |
||
|
d. Bipolar with 8-zero substitution |
QUESTION 16
4B5B differs from line coding techniques in that is ensures that strings of consecutive “1s” and “0s” do not exist prior to being line coded. Select the correct statement(s) regarding 4B5B.
|
a. since 4B5B eliminates long string of logical “1s” and “0s”, simpler line coding techniques such as NRZ can be used. |
||
|
b. since one bit out of every five bits sent is not real information, the data link suffers from a 1/5 or 20% overhead cost (i.e., reduction in data throughput) |
||
|
c. only 80% of the data sent using 4B5B is real information |
||
|
d. all of the above are correct statements |
QUESTION 17
Analog-to-digital conversion (ADC) describes converting an analog signal into digital data. How is this accomplished?
|
a. analog signals are continuous and therefore can never be converted into a digital signal |
||
|
b. analog signals must undergo a line coding process |
||
|
c. analog signals mush be sampled and quantized |
||
|
d. analog signals are modulated onto digital carriers |
QUESTION 18
You want to capture a live music concert and covert it into digital format for transmission. The human ear has a frequency bandwidth of approximately 20,000 Hz. Select the best sampling rate and bit depth. (hint: use Nyquist and a bit-depth of 16)
|
a. fs=40,000 samples/s, Bit depth = 1 bit per sample |
||
|
b. fs=40,000 samples/s, Bit depth = 16 bit per sample |
||
|
c. fs=10,000 samples/s, Bit depth = 16 bit per sample |
||
|
d. fs=20,000 samples/s, Bit depth = 1 bit per sample |
QUESTION 19
When digitizing an analog signal, quantization errors will always be present regardless of bit-depth used.
True
False
QUESTION 20
What happens during an analog-to-digital conversion process, if you fail to follow the Nyquist formula?
|
a. signal aliasing occurs |
||
|
b. quantization errors are experienced |
||
|
c. nothing – your signal will be fine |
||
|
d. None of the above |
QUESTION 21
You digitize an analog signal that has a frequency bandwidth of 8kHz, using a bit depth of 4. What data rate must be supported?
|
a. 32 kpbs |
||
|
b. 64 kbps |
||
|
c. 128 kbps |
||
|
d. 256 kbps |
In: Computer Science
Write 2 pages on what is effective communication and follow up.
In: Computer Science
3. What are the Operating System (OS) functions to the computer and application software
In: Computer Science
The GroceryItem class must maintain the name of the item and its price (a double).
You must read the grocery data from file, and store each line's information in a single GroceryItem object. In other words, there should be one GroceryItem object created for each line in the file. Implement all standard and necessary getters and setters, as well as constructors. Also, implement a calculateWithTax method that takes a double parameter, and returns the price with the tax added.
The input file, input.txt is attached to this assignment. You
can assume each item has only one name without space (i.e., beef,
pork, chicken, salad are all acceptable, but roast beef, roast
chicken, honey ham, kale salad are not.)
Store all the objects of type GroceryItem in an ArrayList, and then in the main file, write a method that takes the ArrayList as a parameter, and prints out all the items with their pre- and post-tax prices.
The file I/O should take place in the GroceryItemDemo class, NOT the GroceryItem class.
**input.txt is as follows**
Tomatoes 1.99
Fudge 2.99
Bananas 1.99
Popcorn 0.99
Jerky 3.99
Milk 1.99
Two separate class files are required. We are using Netbeans with javaFX. I have input.txt in the correct place Im just confused on how to execute this.
In: Computer Science
Determine whether or not the following pairs are equivalent by constructing truth tables:
[(wx'+y')(w'y+z)] and [(wx'z+y'z)] [(wz'+xy)] and [(wxz'+xy+x'z')]
In: Computer Science
Is there anyway to solve below problem in Java?
Wherever there is int it gives an error! It's not only line 20! it give an runtime error everywhere get int after string! or even before read string!
cities[i] = sc.next(); //This way does not work!!!!
==============
input
San Francisco Las Vegas 8 San Diego Los Angeles San Francisco San Jose Sacramento Santa Barbara Las Vegas Pheonix 8 19 0 1 0 3 1 0 1 2 1 4 1 3 2 1 2 5 2 6 2 7 3 7 3 0 3 1 4 7 4 1 5 2 6 2 7 2 7 3
==============
Error:
==============
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Solution.main(myFuncs.java:20)
=======================
==============
import java.io.*;
import java.util.*;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class myFuncs{
public static void main(String arg[]) {
Scanner sc = new
Scanner(System.in);
String s1, s2;
s1 = sc.nextLine();
//first city
s2 = sc.nextLine();
//second city
int n = sc.nextInt();
//total number of cities
String cities[] = new
String[n];
for (int i = 0; i <
n; i++) {
cities[i] = sc.nextLine(); //getting each city and storing
them
}
n = sc.nextInt();
int e =
sc.nextInt();
int adj[][] = new
int[n][e];
for (int i = 0; i <
n; i++)
for (int j = 0; j < e; j++)
adj[i][j] = 0;
for (int i = 0; i <
e; i++) {
int c1 = sc.nextInt();
int c2 = sc.nextInt();
adj[c1][c2] = 1;
adj[c2][c1] = 1;
}
int index1 = -1, index2 = -1;
for (int i = 0; i
< n; i++) {
if (cities[i].equals(s1)) index1 = i; //storing the index of first
city
if (cities[i].equals(s2)) index2 = i; //storing the index of second
city
}
adj[index1][index2] =
0;
adj[index2][index1] =
0;
System.out.println(cities[index1] + " " + index1);
System.out.println(cities[index2] + " " + index2);
if (bfs(adj, index1,
index2, n)) System.out.println("true");
else
System.out.println("false");
}
public static boolean bfs(int adj[][], int source, int dest, int V) {
boolean visited[] = new boolean[V];
LinkedList < Integer > queue = new LinkedList < Integer > ();
visited[source] =
true;
//visited[dest]=true;
queue.add(source);
while (queue.size()
!= 0) {
int s = queue.poll();
if (queue.size() != 0)
queue.remove();
System.out.print(s + " ");
for (int i = s; i < V; i++) {
if (adj[s][i] == 1 && !visited[i]) {
visited[i] = true;
queue.add(i);
if (i == dest) return true;
}
}
}
return false;
}
}
In: Computer Science
TASK:
Using stack functions, write a program in C++ language that acts as a simple calculator, reading an infix algebraic expression with numbers and simple operations: +, -, *, / , (, and ). The program converts an infix expression into an equivalent postfix expression, and then evaluates the postfix expression, and then prints the result if input expression is correct otherwise prints error messages. Your program must interact with the user until the user quits.
REQUIREMENTS:
- Your simulator must work with both single digit operands and multiple digit operands.
- You must use your own stack template class or library <stack>.
- You must develop a design document to how your project works.
- Your program must produce a correct result if an input expression is correct, otherwise an error message should be given.
- You must put your functions and variables together to form a class—calculator.
In: Computer Science
Bellman-Ford and Dijkstra's algorithms solve the single-source shortest path (SSSP) problem. Explain the circumstances when you would use each of these algorithms.
In: Computer Science
Restaurant Selector
You have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You aren’t sure if any of them have dietary restrictions, but your restaurant choices are as follows:
Joe’s Gourmet Burgers –
Vegetarian: No,
Vegan: No,
Gluten-Free: No
Main Street Pizza Company –
Vegetarian: Yes,
Vegan: No,
Gluten-Free: Yes
Corner Café –
Vegetarian: Yes,
Vegan: Yes,
Gluten-Free: Yes
Mama’s Fine Italian –
Vegetarian: Yes,
Vegan: No,
Gluten-Free: No
The Chef’s Kitchen –
Vegetarian: Yes,
Vegan: Yes,
Gluten-Free: Yes
Write a program that asks whether any members of your party are vegetarian, vegan, or gluten-free, and then display only the restaurants that you may take the group to. Here is an example of the program’s output:
Is anyone in your party a vegetarian? yes[Enter] Is anyone in your party a vegan? no[Enter] Is anyone in your party gluten-free? yes[Enter] Here are your restaurant choices: Main Street Pizza Company Corner Cafe The Chef’s Kitchen
Here is another example of the program’s output:
Is anyone in your party a vegetarian? yes [Enter] Is anyone in your party a vegan? yes [Enter] Is anyone in your party gluten-free? yes [Enter] Here are your restaurant choices: Corner Cafe The Chef’s Kitchen
In: Computer Science
In Java, please create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines.
** Each method below, including main, should handle (catch) any
Exceptions that are thrown. ** ** If an Exception is thrown and
caught, print the Exception's message to the command line.
**
In: Computer Science
Write a for-each loop that prints all of the Student objects in an ArrayList<student> object called roster. Write this piece in Java.
Write the correct code to execute.
In: Computer Science
in C++.
Implement a structure to handle a college course information. You will also use functions to manipulate the structure. Follow the instructions step by step to complete the homework successfully.
(1) Create a structure course. The structure should include the following attributes:
Important! The names of the structure and each of its field must match exactly for the program to work and be graded correctly.
Before moving on with the exercise, it is recommended that you self-test your structure in the main function (create a structure, assign values and print them…). Just make sure to remove these changes from the main before you continue.
(2) function getCourseFromFile(). This function takes as argument the name of a file where course information is stored, reads the file, and returns a structure with that information.
The format of the file is the following:
<Course name> <Course code> <Course class size> <Student1> <Student2> <Student3> ...
In the function, open a file stream using the file name passed as argument. If the file is not opened successfully, print
Error! File not found.
Else, read the information from the file into a local structure variable (the variable to be returned). You can assume that the number of students in the file will not exceed the size of the array.
Note that the number of students enrolled is not know and has to be determined while reading the list of names in the file.
This function is tested using unit testing.
(3) function checkCourseSize(). This function takes as argument a course structure and returns true if the number of students enrolled is less or equal the class size, and false otherwise.
This function is tested using unit testing.
(4) function printRoster(). This function takes as argument a course structure and prints all the students to standard output, each one on a new line.
(5) function saveCourseSummary(). This function takes two arguments: a string with the desired output file name, and a course structure. Then saves in the output file the following course summary:
Course title: <title> Course code: <code> Class size: <size> Students enrolled: <enrolled>
Additionally, it uses the function checkCourseSize and if the function returns false (too many students enrolled), it adds to the file the following message:
Enrollment exceeds class size. Drop students or find bigger classroom.
In: Computer Science