Questions
Reading code that you haven't written is a skill you must develop. Many times you are...

Reading code that you haven't written is a skill you must develop. Many times you are correcting this code that you didn't write so you have to 1) read the code, 2) find the errors, and 3) correct them.

# Describe the error found in this function:

def get_grade():

grade = int(input("Enter your test score > ")

# Describe the error found in this function:

def all_As(test1, test2, test3):

if test1 > 89:

if test2 > 89:

if test3 > 89:

print("Wow! ", end="")

print("You scored 90 or above on all your exams!")

print("Keep up the As!")

print()

# Describe the error found in this function:

def calc_average(test1, test2, test3):

average = test1 + test2 + test3 / 3

return average

# Describe the error found in this function:

def letter_grade(grade):

if grade >= 90:

print("You earned an A")

if grade >= 80:

print("You earned an B")

if grade >= 70:

print("You earned an C")

if grade >= 60:

print("You earned an D")

if grade < 60:

print("You earned an F")

from grades import (

all_As,

calc_average,

get_grade,

letter_grade

)

# THERE ARE NO ERRORS IN THE MAIN

# YOU DO NOT NEED TO CHANGE THE MAIN

#-----main-----

print("Enter 3 test scores:")

first_test = get_grade()

second_test = get_grade()

third_test = get_grade()

print()

all_As(first_test, second_test, third_test)

average = calc_average(first_test, second_test, third_test)

print("Your test average is",average)

letter_grade(average)

When the program is correct, it should have output like this:

Enter 3 test scores:
Enter your test score >  100
Enter your test score >  90
Enter your test score >  91

Wow! You scored 90 or above on all your exams!
Keep up the As!

Your test average is 93.66666666666667
You earned an A

In: Computer Science

In PYTHON: Write a function that receives an encrypted string and decrypts it as follows. The...

In PYTHON:

Write a function that receives an encrypted string and decrypts it as follows. The decryption does not change the lowercase letters ‘e’, ‘w’, and ‘l’ (lowercase L). For any other character, we change it to a number using ord(). We then take the number to a power of 19, and then find the remainder after diving by 201. Finally, we take the character corresponding to the number we obtained (using chr()).

For example, assume that we receive the character ‘Â’, which corresponds to the number 194. We calculate the reminder when dividing 19419 by 201, obtaining 122. Using chr(), we find that this is the letter ‘z’.

Your function is not allowed to automatically replace every ‘Â’ with a ‘z’. Instead, it should separately perform the above calculation for each character in the encrypted text.

More details: Your function should handle one character at a time. For each character, turn it to a number, take it to the power of 19, find the remainder when dividing by 201, and turn back to a letter. Don’t forget the three lowercase letters that remain unchanged.

In: Computer Science

Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by...

Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a space.
Ex: If origList = {4, 5, 10, 12} and offsetAmount = {2, 4, 7, 3}, print:

6 9 17 15 

import java.util.Scanner;

public class VectorElementOperations {
public static void main (String [] args) {

final int NUM_VALS = 4;
int[] origList = new int[NUM_VALS];
int[] offsetAmount = new int[NUM_VALS];
int i;

origList[0] = 20;
origList[1] = 30;
origList[2] = 40;
origList[3] = 50;

offsetAmount[0] = 4;
offsetAmount[1] = 6;
offsetAmount[2] = 2;
offsetAmount[3] = 8;

*insert code*

System.out.println("");
}
}

In: Computer Science

Question about CyberForensic You are an expert witness in a court case. Explain to the jury...

Question about CyberForensic

  1. You are an expert witness in a court case. Explain to the jury what you did to recover the deleted images and documents. Be sure to provide a detailed description of each step taken (start to finish).

In: Computer Science

In C# Please Write an application named Perfect that displays every perfect number from 1 through...

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,...

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...

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...

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...

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:

  1. numerator: int type, private

  2. denominator: int type, private

and the following methods:

  1. one default constructor which will create a fraction of 1/1.

  2. one constructor that takes two parameters which will set the values of numerator and denominator to the specified parameters.

  3. int getNum() : retrieves the value of numerator

  4. int getDenom(): retrieves the value of the denominator

  5. Fraction add(Fraction frac): adds with another Fraction number and returns the result in a new Fraction object.

  6. Fraction sub(Fraction frac): is subtracted by another Fraction frac and returns the result in a new Fraction object.

  7. Fraction mult(Fraction frac): multiplies with another Fraction number and returns the result in a new Fraction object.

  8. Faction div(Fraction frac): is divided by another Fraction number and returns the result in a new Fraction object.

  9. 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...

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...

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...

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.

  • boolean
  • int
  • String
  • List
  • Optional
  • Point
  • Map

In: Computer Science

Write 6 paragraphs Describing the algorithms that are actually used by modern computers to add, subtract,...

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...

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...

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