Submit a java file. Write a program where you input 4 numbers and the output generates the average of the 4 numbers. The output may not be negative and <= 100. If any value is negative or >100, it should be replaced by the value of 30. For all such values, you will replace them with a value of 10. The program should produce the following output:
Today's average amount is: $xx.xx.
In: Computer Science
Subject: Computer Networks
Chapter:packets
2.0. Suppose the path from A to B has a single switch S in between: A───S───B. Each link has a propagation delay of 60 µsec and a bandwidth of 2 bytes/µsec.
(a). How long would it take to send a single 600-byte packet from A to B?
(b). How long would it take to send two back-to-back 300-byte packets from A to B?
(c). How long would it take to send three back-to-back 200-byte packets from A to B?
If there is a diagram please draw the diagram
In: Computer Science
Your network employs basic authentication that centers on usernames and passwords. However, you have two ongoing problems. The first is that usernames and passwords are frequently lost by negligent users. In addition, adversaries have, on occasion, fooled employees into giving up their authentication information via social engineering attacks. Discuss at least two things could you do to strengthen the use of basic username and password authentication, as discussed in the course textbook.
Your answer should be approximately 200-250 words in length.
It have to be your own words and no outside sources.
In: Computer Science
I am confused with Python I have to write a specification for an email address. In one string a valid email address and the other without a valid email address.
Ex:
print(text_match("My teacher’s email is [email protected]"))
print(text_match("My teacher has no email address"))
In: Computer Science
Please write simple python program with explanation
Problem statement:
Stock markets are venues where buyers and sellers of shares meet and decide on a price to trade.Eddard is very interested in trading in stock market and he started gathering information of one stock.He has projected market prices for that share over the next n months.Eddard wants to purchase and resell the share to earn profits.He is much worried about the loss that might occur so he wanted to calculate "Minimum loss" according to following rules :
1.The share cannot be sold at a price greater than or equal to the price it was purchased at(i.e. it must be resold at a loss).
2.The share cannot be resold within the same month it was purchased.
Find and print the minimum amount of money Eddard must lose if he buys the share and resells it within the next n months.
Input Format:
The first line contains an integer n,denoting the number of months of share data.
The second line contains n space separated long integers describing the respective values of p1,p2,...pn.
Constraints:
1<=n<=10^5
1<=pi<=10^16
All the market prices are distinct and valid answer exists.
Output Format:
Print a single integer denoting the minimum amount of money Eddard must lose if he buys the share and resells it within the next n months.
Sample Input1:
3
5 10 3
Sample Output1:
2
Explanation:
Eddard buys the stock in month1 at price p1=5 and sells it in month 3 at p3 for a minimal loss of 5-3 = 2 .
Sample Output2:
5
77 82 76 88 80
Sample Output2:
1
In: Computer Science
Which are more important to a successful technology troubleshooter, please answer the "why" and thoroughly explain for each:
In: Computer Science
Code for LinkList below
class LinkList { Node llist; LinkList( int sz ) { if ( sz <= 0 ) { llist = null; } else { // start with list of size 1 llist = new Node( "0", null ); Node current = llist; // temp node for loop // add further nodes for ( int i=1; i<sz; ++i ) { // create node and attach it to the list Node node2Add = new Node( Integer.toString(i), null ); current.setNext(node2Add); // add first node current=node2Add; } } } /** * Print all the elements of the list assuming that they are Strings */ public void print() { /* Print the list */ Node current = llist; // point to the first node while (current != null) { System.out.print((String)current.getElement() + " "); current = current.getNext(); // move to the next } System.out.println(); } public void deleteFirst() { if ( llist != null ) { llist = llist.getNext(); } } public void deleteLast() { if ( llist == null ) return; // no node Node prev = llist; Node current = prev.getNext(); if ( current == null ) { // only 1 node llist = null; return; } while ( current.getNext() != null ) { // more than 1 node prev = current; current = current.getNext(); } prev.setNext( null ); return; } // create and display a linked list public static void main(String [] args){ /* Create the list */ LinkList llist = new LinkList( 5 ); /* Print the list */ llist.print(); /* delete first and print */ llist.deleteFirst(); llist.print(); /* delete last and print 5 times */ for ( int i=0; i< 5; ++i ) { llist.deleteLast(); llist.print(); } } }
Code for GNODE below
public class GNode<E> { // Instance variables: private E element; private GNode<E> next; /** Creates a node with null references to its element and next node. */ public GNode() { this(null, null); } /** Creates a node with the given element and next node. */ public GNode(E e, GNode<E> n) { element = e; next = n; } // Accessor methods: public E getElement() { return element; } public GNode<E> getNext() { return next; } // Modifier methods: public void setElement(E newElem) { element = newElem; } public void setNext(GNode<E> newNext) { next = newNext; } }
In: Computer Science
These questions ONLY relate to the Cracking WPA
What vulnerabilities were demonstrated by using aircrack-ng?
What vulnerabilities were demonstrated by using aircrack-ng in Wireshark?
What would you tell the server administrator to do to mitigate the vulnerability from aircrack-ng?
What would you tell the server administrator to do to mitigate the vulnerability from Wireshark?
In: Computer Science
XML
1) Create an XML schema for a catalog of cars, where each car has the child elements make, model, year, color, engine, number_of_doors, transmission_type, and accessories. The engine element has the child elements number_of_cylinders and fuel_system (carbureted or fuel injected). The accessories element has the attributes radio, air_conditioning, power_windows, power_steering, and power_brakes, each of which is required and has the possible values yes and no.
2) Create an XML document with at least three instances of the car element defined in the XML schema of previous exercise. Process this document by using the previous XML schema, and produce a display of the raw XML document. Create a CSS style sheet for the XML document and use it to override the default styles of the XML document.
In: Computer Science
Subject: Computer networks and chapter :packets
1.0. Suppose a link has a propagation delay of 20 µsec and a bandwidth of 2 bytes/µsec.
(a). How long would it take to transmit a 600-byte packet over such a link?
(b). How long would it take to transmit the 600-byte packet over two such links, with a store-and-forward switch in between?
if there is a diagram please draw the diagram
In: Computer Science
In: Computer Science
-Using MySQL Workbench Data Modeler, create three (3) models
from the tables below. Show Table 1 in 3rd Normal Form. Show Table
2 in 3rd Normal Form. Merge the 3rd Normal Forms of Table 1 and
Table 2 into a single 3rd Normal Form model. Note that you only can
model table and column names and data types. The data shown is for
your reference to determine functional, partial, and transitive
dependencies.
-Provide a summary of the steps you took to achieve 3rd Normal
form. Include your rationale for new table creation, key selection
and grouping of attributes.
Table 1 | Table 2 | ||||||||||
Department | ProductCode | AisleNumber | Price | UnitofMeasure | Supplier | Product | Cost | Markup | Price | DeptCode | |
Produce | 4081 | 1 | $0.35 | lb | 21 – Very Veggie | 4108 – tomatoes, plum | $1.89 | 5% | $1.99 | PR | |
Produce | 4027 | 1 | $0.90 | ea | 32 – Fab Fruits | 4081 – bananas | $0.20 | 75% | $0.35 | PR | |
Produce | 4108 | 1 | $1.99 | lb | 32 – Fab Fruits | 4027 – grapefruit | $0.45 | 100% | $0.90 | PR | |
Butcher | 331100 | 5 | $1.50 | lb | 32 – Fab Fruits | 4851 – celery | $1.00 | 100% | $2.00 | PR | |
Butcher | 331105 | 5 | $2.40 | lb | 08 – Meats R Us | 331100 – chicken wings | $0.50 | 300% | $1.50 | BU | |
Butcher | 332110 | 5 | $5.00 | lb | 08 – Meats R Us | 331105 – lean ground beef | $0.60 | 400% | $2.40 | BU | |
Freezer | 411100 | 6 | $1.00 | ea | 08 – Meats R Us | 332110 – boneless chicken breasts | $2.50 | 100% | $5.00 | BU | |
Freezer | 521101 | 6 | $1.00 | ea | 10 – Jerry’s Juice | 411100 – orange juice | $0.25 | 400% | $1.00 | FR | |
Freezer | 866503 | 6 | $5.00 | ea | 10 – Jerry’s Juice | 521101 – apple juice | $0.25 | 400% | $1.00 | FR | |
Freezer | 866504 | 6 | $5.00 | ea | 45 – Icey Creams | 866503 – vanilla ice cream | $2.50 | 100% | $5.00 | FR | |
45 – Icey Creams | 866504 – chocolate ice cream | $2.50 | 100% | $5.00 | FR |
In: Computer Science
- Write a function with a parameter called A (which is between 1 and 10) and prints the multiplication table for 1 to A. • Note: Do not need to draw the horizontal and vertical lines. • Example for A = 10.
In: Computer Science
In Python write a program that prompts the user for a file name, make sure the file exists and if it does reads through the file, count the number of times each word appears and then output the word count in a sorted order from high to low.
The program should:
the - 7
in - 6
to - 5
and - 4
of - 4
Remember:
NYT2.txt file below:
Fact-Checking Trump’s Orlando Rally: Russia, the Wall and Tax Cuts President Trump delivered remarks in Florida in a formal start to his re-election effort. Deutsche Bank Faces Criminal Investigation for Potential Money-Laundering Lapses Federal authorities are focused on whether the bank complied with anti-money-laundering laws, including in its review of transactions linked to Jared Kushner. Five NY1 Anchorwomen Sue Cable Channel for Age and Gender Discrimination The women, including Roma Torre, say their careers were derailed after Charter Communications bought New York’s hometown news station in 2016. Hypersonic Missiles Are Unstoppable. And They’re Starting a New Global Arms Race. The new weapons — which could travel at more than 15 times the speed of sound with terrifying accuracy — threaten to change the nature of warfare. Nxivm’s Keith Raniere Convicted in Trial Exposing Sex Cult’s Inner Workings Mr. Raniere set up a harem of sexual “slaves” who were branded with his initials and kept in line by blackmail. Jamal Khashoggi Was My Fiancé. His Killers Are Roaming Free. Washington hasn’t done enough to bring the murdered Saudi columnist’s killers to justice.
In: Computer Science
Create a BMI calculator that reads the user’s weight and height (providing an option for the user to select which formula to use), and then calculates and displays the user’s body mass index. Also, display the BMI categories and their values from the National Heart Lung and Blood Institute: http://www.nhlbi.nih.gov/health/educational/lose_wt/BMI/bmicalc.htm (Links to an external site.) so the user can evaluate his/her BMI.
Java Version
In: Computer Science