Questions
1. Given the network 192.168.17.0 /24, calculate the broadcast, range and last host address for the...

1. Given the network 192.168.17.0 /24, calculate the broadcast, range and last host address for the fourth subnet, given that the all-zeros subnet is the first subnet if you have to create 15 subnets.

2. Given an IP network of 180.5.0.0 /16, calculate the subnet mask required to create 50 subnets with the maximum number of hosts. Then calculate the network address, the range of useable host addresses and the broadcast address of the LAST 3 subnets.

In: Computer Science

Ethic IT short topic: Research and discuss some of the most recent efforts of Facebook and...

Ethic IT short topic:

Research and discuss some of the most recent efforts of Facebook and other popular social media companies to reduce the number of bad actors who use their technology. Will these efforts be effective, or will bad actors always find a way to get by whatever Facebook and other platforms like it put in the way to stop them? Make suggestions as to how the efforts to stop bad social media behavior can be improved. Touch on the use of Fake News and the creation of accounts that don’t actually belong to a person.

In: Computer Science

Please assist with writing a program that does conversion but cannot use the built-in conversion in...

Please assist with writing a program that does conversion but cannot use the built-in conversion in java.
• Please use switch case
• Please include comments to understand
• Write in Java
• Please use JOptionPane

a) Binary to decimal
b) Decimal to Binary
c) Hex to Decimal
d) Decimal to Hex
e) Binary to Hex
f) Hex to Binary

In: Computer Science

Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Write a program...

Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Write a program named GetIDAndAge that continually prompts the user for an ID number and an age until a terminal 0 is entered for both. If the ID and age are both valid, display the message ID and Age OK.

Throw a DataEntryException if the ID is not in the range of valid ID numbers (0 through 999), or if the age is not in the range of valid ages (0 through 119). Catch any DataEntryException or InputMismatchException that is thrown, and display the message Invalid age or ID - DataEntryException - \, where \ is the value of the invalid input. For example:

Enter ID 1000
Enter age 40
Invalid age or ID - DataEntryException 

=============================================

public class DataEntryException extends Exception {
public DataEntryException(int num) {
}
}


==================================================

import java.util.*;
public class GetIDAndAge {
public static void main(String[] args) {
int id;
int age;
final int QUIT = 0;
int returnVal = QUIT + 1;
Scanner keyboard = new Scanner(System.in);
while (returnVal != QUIT) {
// Write your code here
}
}
public static int check(int idNum, int ageNum) throws DataEntryException {
// Write your code here
}
public static void showStatus(String msg) {
// Write your code here
}
}

In: Computer Science

The Rapid Response Refurbishment Company is a large company whose sole job is to refurbish consignments...

The Rapid Response Refurbishment Company is a large company whose sole job is to refurbish consignments of faulty electronics goods for major manufacturers. The Company currently operates 50 Refurb_Centers. The company is is overhauling its information system, a necessary step after the computer the records were held on died irrecoverably in April.

The new system will be created using a traditional relational database system. You have been called in as a contractor to design the database. Your first task is to create the conceptual design which will be a conceptual entity relationship diagram (ERD).

You will take the information presented herein and represent it as a set of entity types and their primary keys and some major attributes and the relationships between the entity types (not instances).

The following narrative was provided by the CEO Tractatus Querulous.

The company was formed in 1997 and has grown substantially. As you probably know we have 50Refurb_Centers. Basically one in every state even Alaska. We deal with large consignments of faulty goods. Manufacturers outsource the refurb Projects to us instead of having to set up new facilities to do the jobs themselves. We contract with manufacturers to take on refurbishment Projects.

Each Refurb_Centers handles multiple Projects and each Project is assigned exclusively to one specificRefurb_Center based on proximity to the manufacturer and current workload.

Each Project consists of multiple Items and each Item belongs to just one Project. To repair a single Item often requires many different Tasks (Disassembly, Diagnostics, repair, reassembly and so on). Each Task is uniquely identified and applies to a single Item.

Tasks of course require someone to do them, often several someones. Each Task may require the services of many Technicians and of course each Technician will do many Tasks. This is one of those problematic many to many relationships. For this exercise you are allowed to show many to many relationships.

Tasks of course also require tools, materials, or other equipment to do them, often several pieces. For simplicity we refer to all of these things as Kit. Each Task may require many bits of Kit and of course each bit of Kit may be used on many Tasks. This is another one of those annoying Many to Many relationships. For this exercise you are allowed to show many to many relationships.

Each bit of Kit has a single Supplier and each Supplier supplies us with many bits of Kit.

To keep our techs honest we assign each and every bit of Kit (down to reels of copper wire or packets of solder) to one specific Technician. Each technician will have many bits of kit assigned to them. We call Toby Esterhase "Sargent Solder" as he always has about a ton of the stuff on hand, but don't expect to borrow any of it from him, he is as tight as a gnats chuff.

To make sure our techs are both properly skilled and up to date about the items they refurbish we make sure they all attend 2 or 3 Training_Courses per year. Each Training_Course involves between 5 and 20 Techs and each Tech as mentioned attends several courses. Guess what this is? Yep, tis yet another many to many relationships. For this exercise you are allowed to show many to many relationships.

Part One

You will create a conceptual ERD. The ERD will show a rectangle for each entity type which will be split in two. The top half will include the Entity type name as a singular noun so Technician not Technicians (points will be deducted for every mistake) .

The bottom half will list the attribute(s) used to create the primary key (guarantee uniqueness for each instance). As the CEO has given you few clues you may exercise your creativity, if you can find a natural set of attributes that guarantee uniqueness use them if not define your own primary key.

Relationships between entities will be shown by a line with a relationship name and an arrow

pointing towards the "possessed" or object entity for instance

Part two

The ERD is the first part - the second part is a list of important non-key attributes for each entity (plus the primary key), for instance for an entity called Necromancer you might list it thusly…

Necromancer

Necromancer_ID{PK}

Fname

Sname

Dateofbirth

Datewentinsane

Dateofdeath

Dateofreturn

Street

City

State

Country

Planet

However, for this exercise have no more than about 6 non-key attributes for each entity type (plus the primary key {pk} as above, but you must list some attributes for all entity types if you come up with an entity type and you cannot think of any attributes for it that's a big hint that it probably is not a terrific entity type after all. The challenge here is to come up with a set of important attributes that we will want to know about each entity instance

As this is a conceptual ERD do not create Foreign Keys

You may use any diagramming tool to create the ERD and attributes lists as long as I can read them.

Far and away the easiest tool for this job is creaky old PowerPoint which can draw rectangles, lines, triangles, and text boxes dead easy and stuff can be easily scaled. PP Hints coming soon…

A Huge helpful Hint

Long before you even draw the first box in PowerPoint (or whatever you use) you are strongly advised to scope out your design on paper, yes good old wood pulp, cleaned, bleached, compressed, dried then shaped into very thin rectangles…

In: Computer Science

// TASK #2 Add an import statement for the Scanner class // TASK #2(Alternate) // Add...

// TASK #2 Add an import statement for the Scanner class
// TASK #2(Alternate)
// Add an import statement for the JOptionPane class

/**
This program demonstrates how numeric types and
operators behave in Java.
*/

public class NumericTypes
{
public static void main (String [] args)
{
// TASK #2 Create a Scanner object here
// (not used for alternate)

// Identifier declarations
final int NUMBER = 2 ; // Number of scores
final int SCORE1 = 100; // First test score
final int SCORE2 = 95; // Second test score
final int BOILING_IN_F = 212; // Boiling temperature
int fToC; // Temperature Celsius
double average; // Arithmetic average
String output; // Line of output

// TASK #2 declare variables used here
// TASK #3 declare variables used here
// TASK #4 declare variables used here

// Find an arithmetic average.
average = (SCORE1 + SCORE2) / NUMBER;
output = SCORE1 + " and " + SCORE2 +
" have an average of " + average;
System.out.println(output);

// Convert Fahrenheit temperature to Celsius.
fToC = 5/9 * (BOILING_IN_F - 32);
output = BOILING_IN_F + " in Fahrenheit is " +
fToC + " in Celsius.";
System.out.println(output);
System.out.println(); // To leave a blank line

// ADD LINES FOR TASK #2 HERE
// Prompt the user for first name
// Read the user's first name
// Prompt the user for last name
// Read the user's last name
// Concatenate the user's first and last names
// Print out the user's full name

System.out.println(); // To leave a blank line

// ADD LINES FOR TASK #3 HERE
// Get the first character from the user's first name
// Print out the user's first initial
// Convert the user's full name to uppercase
// Print out the user's full name in uppercase

System.out.println(); // To leave a blank line

// ADD LINES FOR TASK #4 HERE
// Prompt the user for a diameter of a sphere
// Read the diameter
// Calculate the radius
// Calculate the volume
// Print out the volume
}
}

Task #2a Using the Scanner Class for User Input (4 pts)
⦁   Add an import statement above the class declaration to make the Scanner class available to your program.
⦁   In the main method, create a Scanner object and connect it to the System.in object.
⦁   Prompt the user to enter his or her first name.
⦁   Read the name from the keyboard using the nextLine method and store it into a variable called firstName (you will need to declare any variables you use).
⦁   Prompt the user to enter his or her last name.
⦁   Read the name from the keyboard and store it in a variable called lastName.
⦁   Concatenate the firstName and lastName with a space between them and store the result in a variable called fullName.
⦁   Print out the fullName.
⦁   Compile, debug, and run, using your name as test data.
⦁   Since we are adding on to the same program, each time we run the program we will get the output from the previous tasks before the output of the current task.
Task #2b (alternate) Using Dialog Boxes for User Input (4 pts)
⦁   Add an import statement above the class declaration to make the JOptionPane class available to your program.
⦁   In the main method, prompt the user to enter his or her first name by displaying an input dialog box and storing the user input in a variable called firstName (you will need to declare any variables you use).
⦁   Prompt the user to enter his or her last name by displaying an input dialog box and storing the user input in a variable called lastName.
⦁   Concatenate the firstName and lastName with a space between them and store the result in a variable called fullName.
⦁   Display the fullName using a message dialog box.
⦁   Compile, debug, and run, using your name as test data.
⦁   Since we are adding on to the same program, each time we run the program we will get the output from the previous tasks before the output of the current task.

Task #3 Working with Strings (4 pts)
⦁   Use the charAt method to get the first character in firstName and store it in a variable called firstInitial (you will need to declare any variables that you use).
⦁   Print out the user’s first initial.
⦁   Use the toUpperCase method to change the fullName to uppercase and store it back into the fullName variable.
⦁   Add a line that prints out the value of fullName and how many characters (including the space) are in the string stored in fullName (use the length method to obtain that information).
⦁   Compile, debug, and run. The new output added on after the output from the previous tasks should have your initials and your full name in uppercase.
Task #4 Using Predefined Math Functions (4 pts)
⦁   Add a line that prompts the user to enter the diameter of a sphere.
⦁   Read in and store the number into a variable called diameter (you will need to declare any variables that you use).
⦁   The diameter is twice as long as the radius, so calculate and store the radius in an appropriately named variable.
⦁   The formula for the volume of a sphere is:
r3
Convert the formula to Java code and add a line which calculates and stores the value of volume in an appropriately named variable. Use Math.PI for and Math.pow to cube the radius.
⦁   Print your results to the screen with an appropriate message.
⦁   Compile, debug, and run using the following test data and record the results.

Diameter   Volume (hand calculated)   Volume (resulting output)
2      
25.4      
875,000      
Task #5 Create a program from scratch (4 pts)
In this task you will create a new program that calculates gas mileage in miles per gallon. You will use string expressions, assignment statements, input and output statements to communicate with the user.

⦁   Create a new file in your IDE or text editor.
⦁   Create the shell for your first program by entering:
public class Mileage
{
   public static void main(String[] args)
   {
       // Add your declaration and code here.
   }
}
⦁   Save the file as Mileage.java.
⦁   Translate the algorithm below into Java code. Don’t forget to declare variables before they are used. Each variable must be one word only (no spaces).
Print a line indicating this program will calculate mileage
Print prompt to user asking for miles driven
Read in miles driven
Print prompt to user asking for gallons used
Read in gallons used
Calculate miles per gallon by dividing miles driven by gallons used
Print miles per gallon along with appropriate labels
⦁   Compile the program and debug, repeating until it compiles successfully.
⦁   Run the program and test it using the following sets of data and record the results:

Miles driven   Gallons used   Miles per gallon (hand calculated)   Miles per gallon
(resulting output)
2000   100      
500   25.5      
241.5   10      
100   0      

⦁   The last set of data caused the computer to divide 100 by 0, which resulted in what is called a runtime error. Notice that runtime can occur on programs which compile and run on many other sets of data. This emphasizes the need to thoroughly test you program with all possible kinds of data.
Task #6 Documenting a Java Program (2 pts)
⦁   Compare the code listings of NumericTypes.java with Mileage.java. You will see that NumericTypes.java has lines which have information about what the program is doing. These lines are called comments and are designated by the // at the beginning of the line. Any comment that starts with /** and ends with */ is considered a documentation comment. These are typically written just before a class header, giving a brief description of the class. They are also used for documenting methods in the same way.
⦁   Write a documentation comment at the top of the program which indicates the purpose of the program, your name, and today’s date.
⦁   Add comment lines after each variable declaration, indicating what each variable represents.
⦁   Add comment lines for each section of the program, indicating what is done in that section.
⦁   Finally add a comment line indicating the purpose of the calculation.

In: Computer Science

Let A[1..n] be an array of distinct positive integers, and let t be a positive integer....

  1. Let A[1..n] be an array of distinct positive integers, and let t be a positive integer.

    (a) Assuming that A is sorted, show that in O(n) time it can be decided if A contains two distinct elements x and y such that x + y = t.
    (b) Use part (a) to show that the following problem, re- ferred to as the 3-Sum problem, can be solved in O(n2) time:
    1. 3-Sum

      Given an array A[1..n] of distinct positive integers, and a positive integer t, determine whether or not there are three distinct elements x, y, z in A such that x+y+z = t.


If applicable, please give the algorithm (pseudocode/description) and analyze its running time to show that it meets the required bound.

In: Computer Science

A big problem of the blocking behavior of /dev/random is that blocking can lead to denial...

A big problem of the blocking behavior of /dev/random is that blocking can lead to denial of service attacks. Therefore, it is recommended that we use /dev/urandom to get random numbers. To do that in our program, we just need to read directly from this device file. The following code snippet shows how:

#define LEN 16 // 128 bits
unsigned char *key = (unsigned char *) malloc(sizeof(unsigned char)*LEN);

FILE* random = fopen("/dev/urandom", "r"); fread(key, sizeof(unsigned char)*LEN, 1, random);

fclose(random);

Please modify the above code snippet to generate a 256-bit encryption key. Please compile and run your code; print out the numbers and include the screenshot in the report.

In: Computer Science

Develop the following code in such a manner that it shoulde be having extra 3 attempts(for...

Develop the following code in such a manner that it shoulde be having extra 3 attempts(for wrong answrs) for all questions if the user entered wrong answer · for ex: If the user entered correct answer for first question #then 3 attempts will be carried to next questions. If the user entered 3 times wrong answer in 1st question itself means it sholud display as no more attempts and you got o out of 3

code....................

score=0
total_attempts=3
def question1(total_attempts,score):
print('What colors are apples?\na) Red/Green\nb) Orange\n')
answer1=input('enter answer: ')
if(answer1=='a'):
score=score+1
else:
print('try again')
attempts-=1
if attempts<=0:
print(' No More Attempts')
else:
question1(total_attempts,score)
return attempts,score
def question2 (total_attempts,score):
print('What colors are bananas?\na) Red/Green\nb) Yellow\n')
answer1=input('enter answer: ')
if(answer1=='b'):
score=score+1
else:
print('try again')
attempts-=1
if attempts<=0:
print(' No More Attempts')
else:
question2(attempts,score)
return attempts,score
def question3 (total_attempts,score):
print('What is the color of your hair?\na) Red/Green\nb) Black\n')
answer1=input('enter answer: ')
if(answer1=='b'):
score=score+1
else:
print('try again')
attempts-=1
if attempts<=0:
print(' No More Attempts')
else:
question3(total_attempts,score)
return attempts,score
def questions():
kk=question1(total_attempts,score)
if attempts>0:
hh=question2(kk[0],kk[1])
if attempts>0:
q=question3(hh[0],hh[1])
print('score= ',q[1])

python

In: Computer Science

Provide an in-depth and detailed explanation describing how the virtual page size of a memory system...

Provide an in-depth and detailed explanation describing how the virtual page size of a memory system might affect the performance of cache when the virtual page size is very large and then when it is very small.

In: Computer Science

Java Program 1Use a loop to add up the odd numbers between 100 and 200. 2Use...

Java Program

1Use a loop to add up the odd numbers between 100 and 200.

2Use a loop to determine if a number is prime. Recall: a number is prime if its only factors are 1 and itself.

3. Nested Loops:

}Write a nested loop that finds the largest prime number smaller than 125.

In: Computer Science

In Java create a simple class named student with the following properties: id age gpa credit...

In Java create a simple class named student with the following properties:

  • id

  • age

  • gpa

  • credit hours accomplished

Also, create the following methods:

  • Constructors

  • Getters and setters

In: Computer Science

Write a program (polygon.py) that asks the user to enter the number of sides in a...

Write a program (polygon.py) that asks the user to enter the number of sides in a regular polygon. For example, an equilateral triangle is a regular 3-sided polygon, a square is a regular 4-sided polygon, and a pentagon is a regular 5-sided polygon. If a user enters a number of sides between 3 and 25, inclusive, draw the polygon and wait for the user to click on the screen to quit the program. If the user enters a number less than 3 or greater than 25, tell them the number of sides must be between 3 and 25, and quit the program

Python.

In: Computer Science

-create a magic 8 ball program in JavaScript - use a loop to ask for the...

-create a magic 8 ball program in JavaScript
- use a loop to ask for the question
- use a random number to get the answer let randAnswer=Math.round(Math.round()*10);
- must have at least 10 different answers
-Must use either elseif or switch statement for answer
-must output both answer and user input to console
- the program should repeat indefinitely until either blank input, or cancel is selected

Bug in jsbin.com

Please don't use HTML thanks

In: Computer Science

What is the foreign key that creates a relationship between the Book and Publisher entities?

What is the foreign key that creates a relationship between the Book and Publisher entities?

In: Computer Science