In C# Please Write an application named Perfect that displays every perfect number from 1 through 10,000. A number is perfect if it equals the sum of all the smaller positive integers that divide evenly into it. For example, 6 is perfect because 1, 2, and 3 divide evenly into it and their sum is 6.
Starting code.
using static System.Console;
class Perfect
{
static void Main()
{
// Write your main here.
}
}
In: Computer Science
question 1 ) Security funding and planning decisions should involve three distinct groups of decision makers, or communities of interest. What are they briefly explain.
question 2 ) . Explain the specialised areas of security for an organisation.
question 3) Describe the CNSS security model. What are its three dimensions?
question 4) List and briefly explain any five types of threats to information security.
question 5) The extended characteristics of information security are known as the SIX P’s. What are they?
question 6) What are the types of InfoSec plans? Explain with examples.
question 7) The set of organisational guidelines that dictates certain behaviour within the organisation is called policy. What are the three general policy categories?
In: Computer Science
From your own experience or the reading assignments to this point in this course, or your research, list the steps you'd use to build, configure, and install a network server. Be as detailed as possible. It's up to you which operating system you choose, but be sure your process covers all network services of the server.
In: Computer Science
In bash how can I read an input file and create
variables for specific lines and columns from the input
file?
For example I have
Q W E R
T Y U I
A S D F
So if I wanted to make a variable where
Variable = U, how would I create it.
In: Computer Science
Java
The whole idea is for me to gain a better understanding of the logic. If possible, can you go off of what I have started and not just give me a whole new written program?
Also, don't simplify result.
Implement a class named “Fraction” with the following properties:
numerator: int type, private
denominator: int type, private
and the following methods:
one default constructor which will create a fraction of 1/1.
one constructor that takes two parameters which will set the values of numerator and denominator to the specified parameters.
int getNum() : retrieves the value of numerator
int getDenom(): retrieves the value of the denominator
Fraction add(Fraction frac): adds with another Fraction number and returns the result in a new Fraction object.
Fraction sub(Fraction frac): is subtracted by another Fraction frac and returns the result in a new Fraction object.
Fraction mult(Fraction frac): multiplies with another Fraction number and returns the result in a new Fraction object.
Faction div(Fraction frac): is divided by another Fraction number and returns the result in a new Fraction object.
void print(): prints the Fraction number out
This is what I have so far, but I am getting hung up..
import java.util.Scanner;
public class Fraction {
private int numerator;
private int denominator;
//Default constructor that sets 1/1 fraction
Fraction(){
numerator=1;
denominator=1;
}
//Constructor that creates fraction with specified parameters
Fraction(int newNumerator, int newDenominator){
numerator = newNumerator;
denominator = newDenominator;
}
//Retreives value of numerator
public int getNum(){
return numerator;
}
//Retreives value of denominator
public int getDenom(){
return denominator;
}
//Adds fraction with another and returns value as Fraction
object
public Fraction add(Fraction frac){
if(frac.denominator==denominator){
int num= frac.numerator+numerator;
int denom = denominator;
}else{
int denom = this.getDenom() * frac.getDenom();
int num = this.getNum()*frac.getDenom() +
frac.getNum()*this.getDenom();
}
return new Fraction(num,denom);
}
//Subtracts fraction with another and returns value as Fraction
object
public Fraction sub(Fraction frac){
int num = frac.numerator+numerator;
int denom= frac.denominator-denominator;
return new Fraction(num,denom);
}
//Multiplies fraction with another and returns value as Fraction
object
public Fraction mult(Fraction frac){
int num = frac.getNum()*numerator;
int denom = frac.getDenom()*denominator;
return new Fraction(num,denom);
}
//Divides fraction with another and returns value as Fraction
object
public Fraction div(Fraction frac){
int num = frac.getDenom()*numerator;
int denom = frac.getNum()*denominator;
return new Fraction(num,denom);
}
public void print(){
System.out.print(numerator + "/" + denominator);
}
In: Computer Science
We can use breadth-first search to find the length of longest
simple path in the BFS tree
starting at s by the simple method of checking each v.d value at
the end of the algorithm. BFS is
Θ(|V | + |E| and this adds only Θ(|V |) work.
Find an even easier approach that adds only constant time (Θ(1))
work via a simple modification to
the BFS algorithm.
In: Computer Science
For each of the following situations: ! Pick the search that is most appropriate, be specific about visited and expanded list ! Give a one sentence reason why you picked it. (advantage and disadvantages). 1. We need to find the least cost path to find the goal. Best search algorithm chosen: _______________________________________________ reason:__________________________________________________________________ ________________________________________________________________________ 2. We need a search algorithm that is fast and memory efficient, repeating the work is not an issue. Best search algorithm chosen: _______________________________________________ reason:__________________________________________________________________ ________________________________________________________________________ 3. We have a space and we search the tree from both the start and the goal at the same time. Best search algorithm chosen: _______________________________________________ reason:__________________________________________________________________ ________________________________________________________________________ 4. We need a search algorithm that is complete and optimal without considering the number of steps involved. Best search algorithm chosen: _______________________________________________ reason:__________________________________________________________________ ________________________________________________________________________
In: Computer Science
1) List the three steps of test driven development and explain,
in detail, why these three steps are used.
2) Explain why the order of the steps is so
important.
3) For each of the following data types, explain what boundaries might be relevant to testing. Also, explain what values you would consider testing for parameters of this type. Justfiy your answers.
In: Computer Science
Write 6 paragraphs Describing the algorithms that are actually used by modern computers to add, subtract, multiply and divide positive integers.
In: Computer Science
Write an application named DisplayMultiplicationTable that displays a table of the products of every combination of two integers from 1 through 10
Beginning Code. Please answer in C#
using static System.Console;
class DisplayMultiplicationTable
{
static void Main()
{
// Write your main here.
}
}
}
In: Computer Science
a. Celsius and Fahrenheit scales have zero values. Why are they not ratio scales?
b. Provide an example of an interval scale not mentioned in the text that is not a ratio scale. If you scale has a zero element, briefly explain why the zero element does not make it a ratio scale.
c. Provide an example of a ratio scale not mentioned in the text. Briefly explain why the zero element of your scale makes it a ratio scale.
In: Computer Science
Consider a modification to the DFS procedure such that it
returns for an undirected graph
G, the connected components of G. To do this, you will modify the
DFS procedure to
• maintain a counter i, initially set in 1, that counts how many
connected components we found so
far; and
• on each vertex v ∈ G.V maintain an attribute component indicating
to which connected component
number v belong to. That is, when DFS terminates, v.component
indicates the component number
1, 2, . . . i that v belongs to.
Answer the following questions:
(a) Write the pseudocode for this slightly modified version of the
DFS algorithm
(b) Explain why your algorithm is correct and its running time. You
do not need to provide a formal
argument for correctness, but be sure to explain in clear
terms.
In: Computer Science
You have been given a task to differentiate between the images of a cat and a dog. You have been given a dataset of 50000 coloured images of size 40x40 which contains either a cat or a dog. Being as specific as you can, please detail the procedure of how you are going to solve this problem.
In: Computer Science
We are working on Public Key Crypto, RSA, Extended Euclidean algo
Let n = 2419 = 41 ∗ 59 and e = 7. (1) Find the private key d. (2) Encrypt the message 6. (3) Sign the message 10. Assume RSA is used. Use the egcd.py program at the lecture attachments folder, described in section 10.3.3, to compute d. For parts 2 and 3, you only need to show the formula; there is no need to calculate the final results.
egcd.py
#!/usr/bin/python3
def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:
g, x, y = egcd(b % a, a)
return (g, y - (b // a) * x, x)
print ('This program gets two integers and calculates their
gcd')
print ('Example: input e=18 phi=24, output gcd(18,24)=6 d=-1
y=1')
e = int(input('Input a number for e: '))
phi = int(input('Input a number for phi: '))
g, x, y = egcd(e, phi)
print ('gcd = ', g)
print ('d = ', x)
print ('y = ', y)
In: Computer Science
1) Compare and contrast the decorator and the strategy patterns. How are they similar? How are they different?
2) Why are referential equality and the instance of operators a problem for decorators?
In: Computer Science