Show the major steps for computing X9 in “ADD X9, X10, X11” for the given values. Please indicate if there is an overflow and show the final content of X9 as a hexadecimal number. a) X10=0xCFFFFFFF and X11=0xC0000000 b) X10=0xCFFFFFFF and X11=0xA0000000
In: Computer Science
Convert 2.115 single-precision floating point binary format. Please show every single detail for upvote. Please do not answer otherwise.
In: Computer Science
Under normal conditions, commercial aircraft generally rise at
about 1,000 to 2,000
feet per minute (this is called the rate of climb) after take-off,
until they reach a
cruising altitude of 35,000 feet. Design the logic for a program
that allows the user to
enter the rate of climb as input, and then for every minute after
take-off until the
aircraft has reached cruising altitude, outputs the minute number,
and the height of the
plane after that minute. After that the program must output the
number of minutes that
have elapsed since take off, and the height at which the plane is
cruising (this may not
be exactly 35,000 feet).
In: Computer Science
Convert -10.5 single-precision floating point binary format.
Please show every single detail for upvote.
Please do not answer otherwise.
In: Computer Science
Task: Read the case study below and answer the following
questions.
Case Study: The Reveton Ransomware Attacks
In August 2012, the Internet Crime Complaint Center (IC3), a
partnership between the FBI and the National White Collar Crime
Center, was inundated with reports of a new type of cybercrime.
Victims across the United States reported that while searching the
Internet, their computers locked up, and they received the
following message, purportedly from the FBI: “This operating system
is locked due to the violation of the federal laws of the United
States of America! (Article 1, Section 8, Clause 8; Article 202;
Article 210 of the Criminal Code of U.S.A. provides for a
deprivation of liberty for four to twelve years.)” The message then
accused the victim either of visiting pornography Web sites or of
distributing copyrighted content. Victims were told they could
unlock their computers and avoid prosecution by paying a fine of
$200 within 72 hours of receiving the message. The message came
replete with the official FBI logo.
The incident pointed to a steep rise in ransomware attacks.
Ransomware is malware that disables a computer or smartphone until
the victim pays a fee, or ransom. Unlike other viruses, the Reveton
version of ransomware is not activated by opening a file or an
attachment. Rather it is an example of “drive-by malware,” viruses
that download automatically when a user visits an infected Web
site.
The FBI immediately issued an alert, but within a month,
cybersecurity experts had identified 16 variants of the ransomware.
These viruses had infected 68,000 unique IP addresses. It is
estimated that on an average day, about 170 victims paid the $200
fee and received valid unlock codes. The compromised computers
could not be fixed through the installation or updating of
antivirus software because the computer was locked. Because so many
home PC owners fail to back up their systems regularly, many
victims faced losing a significant amount of data. The $200 fee
itself was low enough to encourage payment. A visit to a
professional IT service to repair the damage could potentially cost
the same amount and take more time to resolve. A quick payment
through a prepaid money card system, such as MoneyPak, could save
the victim a lot of trouble.
The United States was not the first country to be hit by these
attacks. In early 2012, criminal gangs targeted France, Germany,
and the United Kingdom. Ransomware attacks first broke out in
Russia in 2009. Since that time, they have spread to almost every
country on the globe, hitting the United States and Japan
especially hard. Symantec, an IT security company, estimates that
gangs are extorting over $5 million per year from online victims.
The rise of ransomware attacks is, no doubt, due in part to their
success. In France, for example, almost 4 percent of victims
coughed up the ransom money during a non-Reveton scam.
The Reveton ransomware is delivered by the popular Russian-language
Citadel malware toolkit. The latest version of Citadel can also
grab passwords from Web browsers and change Web sites to trick
users into handing over their login information.
In December 2012, the United Kingdom arrested three people they
believed were involved in the Reveton ransomware attacks. Finding
the perpetrators, however, is unusual and is not the most effective
way to combat this crime. Law enforcement agencies and IT security
companies have urged the public to take measures to prevent
themselves from falling victim to such attacks—by keeping software
such as Java, Acrobat Reader, Adobe Flash, Windows, and their
browser software updated. An early Reveton ransomware attack made
use of a vulnerability in a version of Java that had just been
patched a month prior. Computer users can also avoid infections by
using security software that identifies suspicious Web sites, and
by not clicking online ads from dubious companies. Perhaps,
however, the best way to avoid the spread of these attacks is to
encourage victims to report the crime and to refuse to comply with
the ransom demands.
Questions for the Homework
1-Why are ransomware attacks on the rise?
2-What can you do to prevent ransomware attacks on your own
computer?
3-How do you think victims should respond to ransomware attacks?
4-Do the victims have an ethical obligation to future victims? If
yes, why? If no, why?
In: Computer Science
From a processors’ point of view, why is it important to know when the critical moisture content is reached?
In: Computer Science
You are to create a class called ManageDB. The ManageDB class will have a
2 input constructor
that has the following definition:
ManageDB(int number, String fileName)
The constructor will create an array of EmployeeDB objects of length
"number".
The constructor will read the file located at "fileName" and extract the
information from that
file to populate a database of EmployeeDB objects. The file contains
information on the
EmployeeDB objects. This information is contained in records.
The format of each record is as follows:
^ "index of employee" "name of field" = "value of field"
Each record will start with a '^' character.
The "index of employee" is always a 4 character field representing a
positive integer.
The "name of field" is the name of the field to be populated for a
EmployeeDB object.
There is a delimiter between the "name of field" and the "value of field"
which is '='.
The "value of field" is the character string representing the value of the
field specified in "name of field".
The valid "name of field" strings are:
"age"
"name"
"salary"
For each "name of field" the "value of field" will be of the following
type:
age - integer
name - String
salary - double
An example of a valid record is as follow:
^0002age=24
This record would set the 0002 indexed EmployeeDB object age to 24.
You can assume that a record is formatted correctly. That is there will
always be a ^, =, and a valid
"name of field". However, the "index of employee" may not have a valid
number (either out of range or
not a number). The "value of field" may also be invalid if a number is
specified. The name
"value of field" will always have a valid String value (there are no
errors for this field).
If there is an error in the "index of employee" or the "value of field"
portion then ignore the
record and decode the next record. If the "index of employee" portion is
out of range then ignore that
record.
The EmployeeDB class is provided for you. Use the EmployeeDB class to
create the EmployeeDB array and track
the information for each Employee.
You need to create 3 public methods for the ManageDB class.
public String getName(int i) // returns the name of Employee at i index
public int getAge(int i) // returns the age of Employee at i index
public double getSalary(int i) // returns the salary of Employee at i
index
Compile your program with the EmployeeDB class and the DBTester class
which are both supplied to you.
Your program must run to completion and pass all the test cases. Make sure
to handle all exception
that might occur so your program can successfully run. The file to read is
called "EmployeeData.txt"
which is provided to you. Place this file in the working directory of your
project (the base directory
of your package).
Add your name to the DBTester.java file at the top so your name is
displayed.
Capture a screen image of the program ouput with your name and the result
of the test cases.
Files provided:
EmployeeDB.java
DBTester.java
EmployeeData.txt
------------------------
public class DBTester
{
public static void main(String args[ ])
{
System.out.println("Homework 4 test case results by Your Name");
ManageDB m = new ManageDB(5, "EmployeeData.txt");
boolean result;
int testCount = 1; // used to track test numbers
result = isSame(23, m.getAge(0));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
if (m.getName(0).equals("Jane"))
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(1000000.98, m.getSalary(0));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(-1, m.getAge(1));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
if (m.getName(1).equals("Jerry"))
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(100000, m.getSalary(1));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(29, m.getAge(2));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
if (m.getName(2).equals("Joann"))
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(50000.8, m.getSalary(2));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(-1, m.getAge(3));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
if (m.getName(3).equals(""))
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(-1, m.getSalary(3));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(25, m.getAge(4));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
if (m.getName(4).equals("John"))
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
result = isSame(1177.22, m.getSalary(4));
if (result == true)
System.out.println("Test Case " + testCount + " Passed");
else
System.out.println("Test Case " + testCount + " Failed");
testCount++;
}
private static boolean isSame(double x, double y)
{
double error = .00001;
boolean rv = false;
if (((x + error) >= y) && ((x - error) <= y))
{
rv = true;
}
return rv;
}
}
-----------------------------
employeedata.txt
^0000age=23^0000name=Jane^0000salary=1000000.98^0005age=20^0005name=Joe^00
05salary=11888.22^0002age=29^0002name=Joann^0002salary=50000.8
^00a1age=36^0001name=Jerry^0001salary=100000^0004age=25^0003age=3q2^0004sa
lary=1177.22^0w03name=Joan
^0004name=John^0003salary=100a00a
----------------------------
class EmployeeDB
{
// Member variables
private int age;
private String name;
private double salary;
// Constructors
public EmployeeDB()
{
age = -1;
name = "";
salary = -1.0;
}
// Mutators
public void setName(String n)
{
name = n;
}
public void setAge(int a)
{
age = a;
}
public void setSalary(double s)
{
salary = s;
}
// Accessors
public String getName()
{
return name;
}
public int getAge()
{
return age;
}
public double getSalary()
{
return salary;
}
}
In: Computer Science
Perhaps you remember the popular TV show, Deal or No Deal, with Howie Mandel as the host, that ran several years ago. In honor of the show returning in its original form (and renewed for a fifth season in 2019!) this lab is called Stack or No Stack.
Imagine again a bag data structure into which we can insert and remove elements. This bag has two operations, defined as:
1 x | Insert an element (with value x) into the bag |
2 x | Take an element from the bag (the value x) |
This time the bag is somewhat mysterious. Given a sequence of inserts and removals, the bag may operate like a LIFO stack, or it may not.
Your program must guess whether or not the bag is operating as a stack given a series of operations and the corresponding return values.
Program Input
The input to your program will be a series of test cases in a file. Each test case begins with a line containing a single integer n (1 < n < 100). Following the operations defined in the above table, each of of the next n lines is either a type-1 command followed by an integer x (which inserts the value x) or a type-2 command followed by an integer x which means the command retrieves the value x. The value of x is always a positive integer not larger than 100. There will be no ambiguous test cases. In other words, you will be able to fully determine the output based on the input alone. The input is terminated by an end-of-file (EOF).
Your code may use anything in the standard C++ library -- including the STL stack container. This is, of course, optional.
Program Output
For each test case, output one of the following:
stack not stack
which will indicate whether or not the bag is determined to be operating as a stack, given the series of operations.
Your code should compile, run, and pass all of the below test cases.
Your program should output only 'stack' or 'not stack' once per line, with one line for each test case.
Sample Input
Create a file with the following lines and use it as input into your program. Please use at least these as your test cases before submitting your code in Canvas.
4 1 2 1 1 2 1 2 2 6 1 5 1 10 1 12 2 10 2 5 2 12 2 1 8 2 8
Sample Output
stack not stack stack
In: Computer Science
explain the format of the password hash, the number and type of hash used
Administrator:500:727E3576618FA1754A3B108F3FA6CB6D:92937945B518814341DE3F726500D4FF::: Alias:1003:NO PASSWORD*********************:NO PASSWORD*********************::: auser:1015:598DDCE2660D3193AAD3B435B51404EE:2D20D252A479F485CDF5E171D93985BF::: Guest:501:NO PASSWORD*********************:NO PASSWORD*********************::: HelpAssistant:1000:DA4A67F35D4F7632F5982BC1C2AC18AA:7E3A7C491CDC419A64A01666A4C17BE0::: luser:1014:AEBD4DE384C7EC43AAD3B435B51404EE:7A21990FCD3D759941E45C490F143D5F::: Mills_103114:1013:33C4469F9DEB5C58075D448A4570597D:6C9E099D02541C841C97AD6337229F5B::: SUPPORT_388945a0:1002:NO PASSWORD*********************:D5C7AC7253E6D0B1B429C3FA397960D0:::
In: Computer Science
In-class exercise 2
Objective and Overview:
The exercises in this document is on Lecture 3
Exercise 1:
(The Account class) Design a class named Account that contains:
1. A private int data field named id for the account (default 0).
2. A private double data field named balance for the account (default 0).
3. A private static double data field named annualInterestRate that stores the current interest rate (default 0). Assume that all accounts have the same interest rate.
4. A private static int data field named transactions, that stores the number of transactions for all accounts.
5. A no-arg (default) constructor that creates a default account.
6. An initialization constructor that creates an account with the specified id and initial balance.
7. A copy constructor that creates an Account and initializes its attribute to the values of another account.
8. The accessor and mutator methods for id, balance, annualInterestRate, and transactions. 9. A method named getMonthlyInterestRate() that returns the monthly interest rate.
10. A method named getMonthlyInterest() that returns the monthly interest.
11. A method named withdraw that withdraws a specified amount from the account.
12. A method named deposit that deposits a specified amount to the account.
13. a toString() method to display all account details and the number of transactions.
Draw the UML diagram for the class then implement the class.
(Hint: The method getMonthlyInterest() is to return monthly interest, not the interest rate. Monthly interest is balance * monthlyInterestRate.
monthlyInterestRate is annualInterestRate / 12.
Note annualInterestRate is a percentage, for example 4.5%. You need to divide it by 100.)
In: Computer Science
imporant note (the language of compiler and programming llanguage)
Q1:
A positive integer number n is said to be perfect if the number is equal the sum of its divisors excluding the number itself.
Ex:
6 is perfect since the divisors are 1, 2, 3 & 1+2+3 6
28 is perfect since the divisors are 1, 2, 4, 7, 14 & 1+2+4+7+14 = 28
The function “mod” is defined in Xlisp, but the function “div” is not.
>(mod 18 7)
> 4
(a) Write a function “div” which when given two integers n, m and returns n div m.
Ex: > (div 18 7)
> 2
(b) Write a function “perfect” which receives a positive integer n and returns 1 if n is perfect and 0 otherwise.
That is:
>(perfect 28)
>1
(perfect 14)
>0
Hint: I believe you may need to define other functions in addition to div.
Q2 )The McLaurin series for ex as follows:
Write a function “EeX” which receives a number x and returns the value ex.
That is:
> (EeX 1)
> 2.71
Note: you need to define two functions:
That is,
> ( power 3 2)
>9
That is,
> ( factorial 5)
>120
Note: Stop the recursion when (xn/n!) < 0.001
(comp439)
In: Computer Science
Can we use the convolution (or cross-correlation) operation to implement:
(a) the mean filter, (b) the median filter, (c) the Sobel operator and (d) the Laplacian operator?
In: Computer Science
write a complete C++ program that allows the user to choose from one of several options. The program will display a menu and each option will be in a separate function. The program will continue looping until the user chooses to quit. The module descriptions are given below.
1. Prompt for and take as input 3 floating point values (l, w, and h). The program will then calculate the volume (volume = l*h*w ). The program should then output to the monitor the volume.
2. In the main() function prompt for and read in three characters. Then call the function with the three characters as arguments. The function will print the characters out in alphabetic order.
3. Prompt for, input and sum a list of numbers until any one of the following conditions is true: the sum exceeds 100.0, a negative value is input, or a maximum of 25 numbers are input.
4. In the main() function prompt for and input an integer. Then call the function with the integer as an argument. The function will then add all integers from 1 to the user’s input.
In: Computer Science
In C++, pls comment code This assignment is adopted from Project Euler Question 13. Requirement - use file for the input (nums.txt) - (recommended) use only one linked list to hold intermediate answer and final answer. You may use another one to reverse the answer. - store the num reversely in the linked list. For example, the num 123 is stored as 3 (at first node), 2 (at second node) and 1 (at third node) in the linked list. - write a function that performs the addition of numbers. This function will be called in the main. - write a function that prints out the answer. The answer includes two parts: the total summation and the first 10 digits of the summation. - comment the code clearly, especially for the number addition mechanism.
nums.txt
37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 89261670696623633820136378418383684178734361726757 28112879812849979408065481931592621691275889832738 44274228917432520321923589422876796487670272189318 47451445736001306439091167216856844588711603153276 70386486105843025439939619828917593665686757934951 62176457141856560629502157223196586755079324193331 64906352462741904929101432445813822663347944758178 92575867718337217661963751590579239728245598838407 58203565325359399008402633568948830189458628227828 80181199384826282014278194139940567587151170094390 35398664372827112653829987240784473053190104293586 86515506006295864861532075273371959191420517255829 71693888707715466499115593487603532921714970056938 54370070576826684624621495650076471787294438377604 53282654108756828443191190634694037855217779295145 36123272525000296071075082563815656710885258350721 45876576172410976447339110607218265236877223636045 17423706905851860660448207621209813287860733969412 81142660418086830619328460811191061556940512689692 51934325451728388641918047049293215058642563049483 62467221648435076201727918039944693004732956340691 15732444386908125794514089057706229429197107928209 55037687525678773091862540744969844508330393682126 18336384825330154686196124348767681297534375946515 80386287592878490201521685554828717201219257766954 78182833757993103614740356856449095527097864797581 16726320100436897842553539920931837441497806860984 48403098129077791799088218795327364475675590848030 87086987551392711854517078544161852424320693150332 59959406895756536782107074926966537676326235447210 69793950679652694742597709739166693763042633987085 41052684708299085211399427365734116182760315001271 65378607361501080857009149939512557028198746004375 35829035317434717326932123578154982629742552737307 94953759765105305946966067683156574377167401875275 88902802571733229619176668713819931811048770190271 25267680276078003013678680992525463401061632866526 36270218540497705585629946580636237993140746255962 24074486908231174977792365466257246923322810917141 91430288197103288597806669760892938638285025333403 34413065578016127815921815005561868836468420090470 23053081172816430487623791969842487255036638784583 11487696932154902810424020138335124462181441773470 63783299490636259666498587618221225225512486764533 67720186971698544312419572409913959008952310058822 95548255300263520781532296796249481641953868218774 76085327132285723110424803456124867697064507995236 37774242535411291684276865538926205024910326572967 23701913275725675285653248258265463092207058596522 29798860272258331913126375147341994889534765745501 18495701454879288984856827726077713721403798879715 38298203783031473527721580348144513491373226651381 34829543829199918180278916522431027392251122869539 40957953066405232632538044100059654939159879593635 29746152185502371307642255121183693803580388584903 41698116222072977186158236678424689157993532961922 62467957194401269043877107275048102390895523597457 23189706772547915061505504953922979530901129967519 86188088225875314529584099251203829009407770775672 11306739708304724483816533873502340845647058077308 82959174767140363198008187129011875491310547126581 97623331044818386269515456334926366572897563400500 42846280183517070527831839425882145521227251250327 55121603546981200581762165212827652751691296897789 32238195734329339946437501907836945765883352399886 75506164965184775180738168837861091527357929701337 62177842752192623401942399639168044983993173312731 32924185707147349566916674687634660915035914677504 99518671430235219628894890102423325116913619626622 73267460800591547471830798392868535206946944540724 76841822524674417161514036427982273348055556214818 97142617910342598647204516893989422179826088076852 87783646182799346313767754307809363333018982642090 10848802521674670883215120185883543223812876952786 71329612474782464538636993009049310363619763878039 62184073572399794223406235393808339651327408011116 66627891981488087797941876876144230030984490851411 60661826293682836764744779239180335110989069790714 85786944089552990653640447425576083659976645795096 66024396409905389607120198219976047599490197230297 64913982680032973156037120041377903785566085089252 16730939319872750275468906903707539413042652315011 94809377245048795150954100921645863754710598436791 78639167021187492431995700641917969777599028300699 15368713711936614952811305876380278410754449733078 40789923115535562561142322423255033685442488917353 44889911501440648020369068063960672322193204149535 41503128880339536053299340368006977710650566631954 81234880673210146739058568557934581403627822703280 82616570773948327592232845941706525094512325230608 22918802058777319719839450180888072429661980811197 77158542502016545090413245809786882778948721859617 72107838435069186155435662884062257473692284509516 20849603980134001723930671666823555245252804609722 53503534226472524250874054075591789781264330331690
In: Computer Science