=======================================================
//Class header definition
public class DisArray {
//First method with int array as parameter
public static void convert2D(int[] oneD) {
//1. First calculate the number of columns
//a. get the length of the one dimensional array
int arraylength = oneD.length;
//b. find the square root of the length and typecast it into a float
float squareroot = (float) Math.sqrt(arraylength);
//c. round off the result and save in a variable called row
int row = Math.round(squareroot);
//2. Secondly, calculate the number of columns
//a. if the square of the number of rows is greater than or equal to the
//length of the one dimensional array,
//then to minimize padding, the number of
//columns is the same as the number of rows.
//b. otherwise, the number of columns in one more than the
// number of rows
int col = ((row * row) >= arraylength) ? row : row + 1;
//3. Create a 2D int array with the number of rows and cols
int [ ][ ] twoD = new int [row][col];
//4. Place the elements in the one dimensional array into
//the two dimensional array.
//a. First create a variable counter to control the cycle through the one
// dimensional array.
int counter = 0;
//b. Create two for loops to loop through the rows and columns of the
// two dimensional array.
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
//if counter is less then the length of the one dimensional array,
//then copy the element at that position into the two dimensional
//array. And also increment counter by one.
if (counter < oneD.length) {
twoD[i][j] = oneD[counter];
counter++;
}
//Otherwise, just pad the array with zeros
else {
twoD[i][j] = 0;
}
}
}
//You might want to create another pair of loop to print the elements
//in the populated two dimensional array as follows
for (int i = 0; i < twoD.length; i++) {
for (int j = 0; j < twoD[i].length; j++) {
System.out.print(twoD[i][j] + " ");
}
System.out.println("");
}
} //End of first method
//Second method with String array as parameter
public static void convert2D(String[] oneD) {
//1. First calculate the number of columns
//a. get the length of the one dimensional array
int arraylength = oneD.length;
//b. find the square root of the length and typecast it into a float
float squareroot = (float) Math.sqrt(arraylength);
//c. round off the result and save in a variable called row
int row = Math.round(squareroot);
//2. Secondly, calculate the number of columns
//a. if the square of the number of rows is greater than or equal to the length of
//the one dimensional array, then to minimize padding, the number of
//columns is the same as the number of rows.
//b. otherwise, the number of columns in one more than the
//number of rows.
int col = (row * row >= arraylength) ? row : row + 1;
//3. Create a 2D String array with the number of rows and cols
String[][] twoD = new String[row][col];
//4. Place the elements in the one dimensional array into the two
// dimensional array.
//a. First create a variable counter to control the cycle through the one
// dimensional array.
int counter = 0;
//b. Create two for loops to loop through the rows and columns of the
//two dimensional array.
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
//if counter is less then the length of the one dimensional array,
//then copy the element at that position into the two dimensional
//array. And also increment counter by one.
if (counter < oneD.length) {
twoD[i][j] = oneD[counter];
counter++;
}
//Otherwise, just pad the array with null values
else {
twoD[i][j] = null;
}
}
}
//You might want to create another pair of loop to print the elements
//in the populated two dimensional array as follows:
for (int i = 0; i < twoD.length; i++) {
for (int j = 0; j < twoD[i].length; j++) {
System.out.print(twoD[i][j] + " ");
}
System.out.println("");
}
} // End of the second method
//Create the main method
public static void main(String[] args) {
//1. Create an arbitrary one dimensional int array
int[] x = {23, 3, 4, 3, 2, 4, 3, 3, 5, 6, 5, 3, 5, 5, 6, 3};
//2. Create an arbitrary two dimensional String array
String[] names = {"abc", "john", "dow", "doe", "xyz"};
//Call the respective methods
convert2D(x);
System.out.println("");
convert2D(names);
} // End of the main method
} // End of class definition
=========================================================
==========================================================
Sample Output23 3 4 3
2 4 3 3
5 6 5 3
5 5 6 3
abc john dow
doe xyz null
==========================================================
Explanation:The above code has been written in Java and it contains comments explaining each line of the code. Please go through the comments. The actual executable lines of code are written in bold-face to distinguish them from the comments.
Write Scheme functions to do the following. You are only allowed to use the functions introduced in our lecture notes and the helper functions written by yourself. (a) Return all rotations of a given list. For example, (rotate ’(a b c d e)) should return ((a b c d e) (b c d e a) (c d e a b) (d e a b c) (e a b c d)) (in some order). (b) Return a list containing all elements of a given list that satisfy a given predicate. For example, (filter (lambda (x) (< x 5)) ’(3 9 5 8 2 4 7)) should return (3 2 4).
Answer:
Check the explanation
Explanation:
solution a:
def Rotate(string) :
n = len(string)
temp = string + string
for i in range(n) :
for j in range(n) :
print(temp[i + j], end = "")
print()
string = ("abcde")
Rotate(string)
solution b:
nums = [3,9,5,8,2,4,7]
res = list(filter(lambda n : n < 5, nums))
print(res)
Reggie receives a phone call from a computer user at his company who says that his computer would not turn on this morning. After asking questions, Reggie realizes that the computer seems to turn on because the user can hear fans spinning and the indicator light comes on and flashes during the boot. The Num Lock key is on, but there is no video on the monitor. Reggie also learns that the computer has a new video card. The night before the computer was working fine, according to the user. Reggie tests the video cord and the monitor. When Reggie reattaches the video cable to the video card port, the computer appears to be working. What might be the problem?
Answer:
The Integrated video may not be working properly well or functioning well.
Explanation:
Solution:
In this case, it is known that the computer was working fine a night before the problem.
If the video cable is connected to a wrong video port, then the computer was unable to work previous night.the integrated video cord has not seated because most times it occurs, due to the heat sink in the card. after restoring the video cable to the video card port, it works.
If the video was disabled in BIOS/UEFI, it does not show video, even after restoring the cable.
In this question, we give two implementations for the function: def intersection_list(lst1, lst2) This function is given two lists of integers lst1 and lst2. When called, it will create and return a list containing all the elements that appear in both lists. For example, the call: intersection_list([3, 9, 2, 7, 1], [4, 1, 8, 2])could create and return the list [2, 1]. Note: You may assume that each list does not contain duplicate items. a) Give an implementation for intersection_list with the best worst-case runtime. b) Give an implementation for intersection_list with the best average-case runtime.
Answer:
see explaination
Explanation:
a)Worst Case-time complexity=O(n)
def intersection_list(lst1, lst2):
lst3 = [value for value in lst1 if value in lst2]
return lst3
lst1 = []
lst2 = []
n1 = int(input("Enter number of elements for list1 : "))
for i in range(0, n1):
ele = int(input())
lst1.append(ele) # adding the element
n2 = int(input("Enter number of elements for list2 : "))
for i in range(0, n2):
ele = int(input())
lst2.append(ele) # adding the element
print(intersection_list(lst1, lst2))
b)Average case-time complexity=O(min(len(lst1), len(lst2))
def intersection_list(lst1, lst2):
return list(set(lst1) & set(lst2))
lst1 = []
lst2 = []
n1 = int(input("Enter number of elements for list1 : "))
for i in range(0, n1):
ele = int(input())
lst1.append(ele)
n2 = int(input("Enter number of elements for list2 : "))
for i in range(0, n2):
ele = int(input())
lst2.append(ele)
print(intersection_list(lst1, lst2))
"Write pseudocode that outputs the contents of parallel arrays. You do NOT have to write the entire program. The first array will hold phone numbers The second array will hold company names You do NOT need to load the arrays. Your code can assume they are already loaded with data. The arrays are named phone[ ] and company[ ] Output the phone number and associated company name for every entry in the array."
Answer:
Check the explanation
Explanation:
PSEUDO CODE:
for(int i=0,j=0;i<phone.length,j<company.length;i++,j++)
{
print(phone[i]," - ",company[j]);
}
this for loop will print each phone number associated with the company names.
Which of the following is an example of the rewards & consequences characteristic of an organization?
OOO
pay raise
time sheets
pay check
pay scale
Answer:
Pay raise is an example of the rewards & consequences characteristic of an organization.
2. (8 points) When creating the Academic Database, there were several instances of data
validation. Data types were assigned to each field in the table to stop undesirable values from
being placed into certain fields. A presence check was used on fields that were listed as NOT
NULL, requiring some data to be input. Uniqueness validation was automatically assigned for
fields that were primary keys. Describe at least one field in the Academic Database a table
where range validation could have been used and describe at least one field in the Academic
Database where choice validation could have been used. Your answer should be addressed in
100 to 150 words.
Answer:
See explaination
Explanation:
An Academic Database deals with the information pertaining to the records of students of an institute. The various fields which can be associated with a student are Name, Unique Identification Number, Marks in various subjects, Grades, Courses Taken and so on. Most of the fields mentioned above have some or other form of validation that is required for the DB to be consistent and follow the basic properties of a database.
One field where range validation can be used is MARKS. In the marks field, the range of marks will be say 0 to 100 and anything below 0 or above 100 must be reported to the database administrator. Another field where we can apply a range validation is AGE in which the range of age allowed could greater than say 10, if it is a college and maximum age could be say 60. Thus, the range check on the AGE field is 10 to 60.
One field where choice validation can be used is GENDER. In the gender field, there could be multiple choices like Male, Female and Others. Thus, out of the available choices we have to select only the available choice and only one choice must be selected where we can apply choice validation. Another field is COURSE, where we can have a list of courses a student can opt for and out of the available courses can select one.
Thus, there are multiple fields where we can apply various types of validation and it is important to explore the area for which the DB has been created understanding all the scenarios and attributes of the problems that are associated with that area.
A cloud provider is deploying a new SaaS product comprised of a cloud service. As part of the deployment, the cloud provider wants to publish a service level agreement (SLA) that provides an availability rating based on its estimated availability over the next 12 months. First, the cloud provider estimates that, based on historical data of the cloud environment, there is a 25% chance that the physical server hosting the cloud service will crash and that such a crash would take 2 days before the cloud service could be restored. It is further estimated that, over the course of a 12 month period, there will be various attacks on the cloud service, resulting in a total of 24 hours of downtime. Based on these estimates, what is the availability rating of the cloud service that should be published in the SLA?
Answer:
99.6
Explanation:
The cloud provider provides the certain modules of the cloud service like infrastructure as a service , software as a service ,etc to other companies .The cloud provider implements a new SaaS service that includes a cloud platform also the cloud provider intends to disclose the Service Level Agreement that is score based on its approximate accessibility during the next 12 months.
The Cloud providers predict that, depending on past cloud system data, it is a 25 % risk that a physical server holding the cloud platform will fail therefore such a failure will require 2 days to recover the cloud service so 99.6 is the Cloud storage accessibility ranking, to be released in the SLA.
Define a function CoordTransform() that transforms the function's first two input parameters xVal and yVal into two output parameters xValNew and yValNew. The function returns void. The transformation is new = (old + 1) * 2. Ex: If xVal = 3 and yVal = 4, then xValNew is 8 and yValNew is 10.
Answer:
Check the explanation
Explanation:
#include <iostream>
using namespace std;
void CoordTransform(int x, int y, int& xValNew,int& yValNew){
xValNew = (x+1)*2;
yValNew = (y+1)*2;
}
int main() {
int xValNew = 0;
int yValNew = 0;
CoordTransform(3, 4, xValNew, yValNew);
cout << "(3, 4) becomes " << "(" << xValNew << ", " << yValNew << ")" << endl;
return 0;
}
An organization’s SOC analyst, through examination of the company’s SIEM, discovers what she believes is Chinese-state sponsored espionage activity on the company’s network. Management agrees with her initial findings given the forensic artifacts she presents are characteristics of malware, but management is unclear on why the analyst thought it was Chinese-state sponsored. You have been brought in as a consultant to help determine 1) whether the systems have been compromised and 2) whether the analyst’s assertion has valid grounds to believe it is Chinese state-sponsored. What steps would you take to answer these questions given that you have been provided a MD5 hashes, two call back domains, and an email that is believed to have been used to conduct a spearphishing attack associated with the corresponding MD5 hash. What other threat intelligence can be generated from this information and how would that help shape your assessment?
Answer: Provided in the explanation segment
Explanation:
Below is a detailed explanation to make this problem more clearer to understand.
(1). We are asked to determine whether the systems have been compromised;
Ans: (YES) From the question given, We can see that the System is compromised. This is so because the plan of communication has different details of scenarios where incidents occur. This communication plan has a well read table of contents that lists specific type of incidents, where each incident has a brief description of the event.
(2). Whether the analyst’s assertion has valid grounds to believe it is Chinese state-sponsored.
Ans: I can say that the analyst uses several different internet protocol address located in so as to conduct its operations, in one instance, a log file recovered form an open indexed server revealed tham an IP address located is used to administer the command control node that was communicating with the malware.
(3). What other threat intelligence can be generated from this information?
Ans: The threat that can be generated from this include; Custom backdoors, Strategic web compromises, and also Web Server exploitation.
(4). How would that help shape your assessment?
Ans: This helps in such a way where information is gathered and transferred out of the target network which involve movement of files through multiple systems.
Files also gotten from networks as well as using tools (archival) to compress and also encrypt data with effectiveness of their data theft.
cheers i hope this helped!!!
Design a program for the Hollywood Movie Rating Guide, which can be installed in a kiosk in theaters. Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the Rating Guide's featured movie of the week. If a user enters a star value that does not fall in the correct range, prompt the user continuously until a correct value is entered. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, display the average star rating for the movie.
Answer:
The program in cpp is given below.
#include <iostream>
using namespace std;
int main()
{
//variables declared to hold sum, count and average of movie ratings
int sum=0;
int count=0;
int rating;
double avg;
//audience is prompted to enter ratings
do{
std::cout << "Enter the rating (0 to 4): ";
cin>>rating;
if(rating>4)
std::cout << "Invalid rating. Please enter correct rating again." << std::endl;
if(rating>=0 && rating<=4)
{
sum=sum+rating;
count++;
}
if(rating<0)
break;
}while(rating>=0);
//average rating is computed
avg=sum/count;
std::cout << "The average rating for the movie is " << avg << std::endl;
return 0;
}
OUTPUT
Enter the rating (0 to 4): 1
Enter the rating (0 to 4): 2
Enter the rating (0 to 4): 0
Enter the rating (0 to 4): 5
Invalid rating. Please enter correct rating again.
Enter the rating (0 to 4): 1
Enter the rating (0 to 4): -1
The average rating for the movie is 1
Explanation:
1. Variables are declared to hold the rating, count of rating, sum of all ratings and average of all the user entered ratings.
2. The variables for sum and count are initialized to 0.
3. Inside do-while loop, user is prompted to enter the rating for the movie.
4. In case the user enters a rating which is out of range, the user is prompted again to enter a rating anywhere from 0 to 4.
5. The loop executes until a negative number is entered.
6. Inside the loop, the running total sum of all the valid ratings is computed and the count variable is incremented by 1 for each valid rating.
7. Outside the loop, the average is computed by dividing the total rating by count of ratings.
8. The average rating is then displayed to the console.
9. The program is written in cpp due to simplicity since all the code is written inside main().
Write a program that uses the map template class to compute a histogram of positive numbers entered by the user. The map’s key should be the number that is entered, and the value should be a counter of the number of times the key has been entered so far. Use –1 as a sentinel value to signal the end of user input.512355321-1Then the program should output the followings:The number 3 occurs 2 timesThe number 5 occurs 3 timesThe number 12 occurs 1 timesThe
Answer:
See explaination
Explanation:
#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main()
{
map<int, int> histogram;
int a=0;
while(a>=0)
{
cout << " enter value of a" ;
cin >>a;
histogram[a]++;
}
map<int,int>::iterator it;
for ( it=histogram.begin() ; it != histogram.end(); it++ )
{
cout << (*it).first << " occurs " << setw(3) << (*it).second << (((*it).second == 1) ? " time." : " times.") <<endl;
}
return 0;
}
How we can earn from an app
Answer:
Hewo, Here are some ways in which apps earn money :-
AdvertisementSubscriptionsIn-App purchasesMerchandisePhysical purchasesSponsorshiphope it helps!
customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft PowerPoint application for the purpose of practicing presentation skills. As a salesperson what size hard disc would you recommend and why?
Explanation:
The most reliable hard drives are those whose most common size is 3.5 inches, their advantages are their storage capacity and their speed and a disadvantage is that they usually make more noise.
For greater speed, it is ideal to opt for two smaller hard disks, since large disks are slower, but are partitioned so that there are no problems with file loss.
For a person who needs to use content creation programs, it is ideal to opt for a hard drive that has reliability.
Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program should display “correct input” if the input is within the given range else it should display “wrong input”.
Python Code with Explanation:
# create a function named func to implement the required logic
def func():
# get the input from the user and store it in a variable named number
number = int(input("Please enter an integer between 1 to 10 inclusive\n"))
# if the input number is equal or greater than 1 and equal to 10 or less then the input is correct
if number>=1 and number<=10:
# print correct input
return print("Correct input")
# else the input is wrong
else:
# print wrong input
return print("Wrong input")
# call the function func
func()
Output:
Test 1:
Please enter an integer between 1 to 10 inclusive
4
Correct input
Test 2:
Please enter an integer between 1 to 10 inclusive
0
Wrong input
Test 3:
Please enter an integer between 1 to 10 inclusive
11
Wrong input
Answer:
dont know if it works!
Explanation:
input=(input("enter number")
if input > 1
print("correct input")
if input <10
print("correct input")
else
print("wrong input")
Describe the series of connections that would be made, equipment and protocol changes, if you connected your laptop to a wireless hotspot and opened your email program and sent an email to someone. Think of all the layers and the round trip the information will likely make.
Answer:
Check Explanation.
Explanation:
Immediately there is a connection between your laptop and the wireless hotspot, data will be transferred via the Physical layer that will be used for encoding of the network and the modulation of the network and that layer is called the OSI MODEL.
Another Important layer is the APPLICATION LAYER in which its main aim and objectives is for support that is to say it is used in software supporting.
The next layer is the PRESENTATION LAYER which is used during the process of sending the e-mail. This layer is a very important layer because it helps to back up your data and it is also been used to make connections of sessions between servers of different computers
3. Write a project named Money that prompts for and reads a double value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assume that a ten-dollar bill is the maximum size need). For example, if the value entered is 47.63 (forty-seven dollars and sixty-three cents), then the program should print the equivalent amount as:
Answer: Provided in the explanation segment
Explanation:
The following code provides answers to the given problem.
import java.util.*;
public class untitled{
public static void main(String[] args)
{int tens,fives,ones,quarters,dimes,nickles,pennies,amt;
double amount;
Scanner in = new Scanner(System.in);
System.out.println("What do you need to find the change for?");
amount=in.nextDouble();
System.out.println("Your change is");
amt=(int)(amount*100);
tens=amt/1000;
amt%=1000;
fives=amt/500;
amt%=500;
ones=amt/100;
amt%=100;
quarters=amt/25;
amt%=25;
dimes=amt/10;
amt%=10;
nickles=amt/5;
pennies=amt%5;
System.out.println(tens +" ten dollar bills");
System.out.println(fives +" five dollar bills");
System.out.println(ones +" one dollar bills");
System.out.println(quarters +" quarters");
System.out.println(dimes +" dimes");
System.out.println(nickles +" nickles");
System.out.println(pennies +" pennies");
}
}
cheers i hope this helped !!
Create a Binary Expressions Tree Class and create a menu driven programyour program should be able to read multiple expressions from a file and create expression trees for each expression, one at a timethe expression in the file must be in "math" notation, for example x+y*a/b.display the preorder traversal of a binary tree as a sequence of strings each separated by a tabdisplay the postorder traversal of a binary tree in the same form as aboveWrite a function to display the inorder traversal of a binary tree and place a (before each subtree and a )after each subtree. Don’t display anything for an empty subtree. For example, the expression tree should would be represented as ( (x) + ( ( (y)*(a) )/(b) ) )
Answer:
Explanation:
Program:
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
//check for operator
bool isOperator(char c)
{
switch(c)
{
case '+': case '-': case '/': case '*': case '^':
return true;
}
return false;
}
//Converter class
class Converter
{
private:
string str;
public:
//constructor
Converter(string s):str(s){}
//convert from infix to postfix expression
string toPostFix(string str)
{
stack <char> as;
int i, pre1, pre2;
string result="";
as.push('(');
str = str + ")";
for (i = 0; i < str.size(); i++)
{
char ch = str[i];
if(ch==' ') continue;
if (ch == '(')
as.push(ch);
else if (ch == ')')
{
while (as.size() != 0 && as.top() != '('){
result = result + as.top() + " ";
as.pop();
}
as.pop();
}
else if(isOperator(ch))
{
while (as.size() != 0 && as.top() != '(')
{
pre1 = precedence(ch);
pre2 = precedence(as.top());
if (pre2 >= pre1){
result = result + as.top() + " ";
as.pop();
}
else break;
}
as.push(ch);
}
else
{
result = result + ch;
}
}
while(as.size() != 0 && as.top() != '(') {
result += as.top() + " ";
as.pop();
}
return result;
}
//return the precedence of an operator
int precedence(char ch)
{
int choice = 0;
switch (ch) {
case '+':
choice = 0;
break;
case '-':
choice = 0;
break;
case '*':
choice = 1;
break;
case '/':
choice = 1;
break;
case '^':
choice = 2;
default:
choice = -999;
}
return choice;
}
};
//Node class
class Node
{
public:
string element;
Node *leftChild;
Node *rightChild;
//constructors
Node (string s):element(s),leftChild(nullptr),rightChild(nullptr) {}
Node (string s, Node* l, Node* r):element(s),leftChild(l),rightChild(r) {}
};
//ExpressionTree class
class ExpressionTree
{
public:
//expression tree construction
Node* covert(string postfix)
{
stack <Node*> stk;
Node *t = nullptr;
for(int i=0; i<postfix.size(); i++)
{
if(postfix[i]==' ') continue;
string s(1, postfix[i]);
t = new Node(s);
if(!isOperator(postfix[i]))
{
stk.push(t);
}
else
{
Node *r = nullptr, *l = nullptr;
if(!stk.empty()){
r = stk.top();
stk.pop();
}
if(!stk.empty()){
l = stk.top();
stk.pop();
}
t->leftChild = l;
t->rightChild = r;
stk.push(t);
}
}
return stk.top();
}
//inorder traversal
void infix(Node *root)
{
if(root!=nullptr)
{
cout<< "(";
infix(root->leftChild);
cout<<root->element;
infix(root->rightChild);
cout<<")";
}
}
//postorder traversal
void postfix(Node *root)
{
if(root!=nullptr)
{
postfix(root->leftChild);
postfix(root->rightChild);
cout << root->element << " ";
}
}
//preorder traversal
void prefix(Node *root)
{
if(root!=nullptr)
{
cout<< root->element << " ";
prefix(root->leftChild);
prefix(root->rightChild);
}
}
};
//main method
int main()
{
string infix;
cout<<"Enter the expression: ";
cin >> infix;
Converter conv(infix);
string postfix = conv.toPostFix(infix);
cout<<"Postfix Expression: " << postfix<<endl;
if(postfix == "")
{
cout<<"Invalid expression";
return 1;
}
ExpressionTree etree;
Node *root = etree.covert(postfix);
cout<<"Infix: ";
etree.infix(root);
cout<<endl;
cout<<"Prefix: ";
etree.prefix(root);
cout<<endl;
cout<< "Postfix: ";
etree.postfix(root);
cout<<endl;
return 0;
}
Perform a Google search, using the Google hacking keywords to locate a page that has the word passwd (note the spelling) on the page but has the phrase "Index of" in the title. First, what was your search term. Second, what is the first URL in your list of results. Third, what exactly would you use this search to find?
Answer:
Following are the step to this question:
i) search "intitle passwd" in google search engine.
ii) Open first link of the page.
iii) use commands to access data.
Explanation:
Google Hacking operates as follows of web engines like google and yahoo to find web pages and sensitive information, that are insecure. It builds on the idea that web pages index a large number of public pages and files and make their discovery easy to create the correct query.
In which, we search the above-given keyword, that will provide many links. In these links we select the first one and open it, it will provide an index, and search in this we use the search command in the database.D-H public key exchange Please calculate the key for both Alice and Bob.
Alice Public area Bob
Alice and Bob publicly agree to make
N = 50, P = 41
Alice chooses her Bob
picks his
Private # A = 19 private #
B= ?
------------------------------------------------------------------------------------------------------------------------------------------
I am on Alice site, I choose my private # A = 19.
You are on Bob site, you pick up the private B, B and N should have no common factor, except 1.
(Suggest to choose B as a prime #) Please calculate all the steps, and find the key made by Alice and Bob.
The ppt file of D-H cryptography is uploaded. You can follow the steps listed in the ppt file.
Show all steps.
Answer:
See explaination
Explanation:
Please kindly check attachment for the step by step solution of the given problem.
Which of the following should be the first page of a report?
O Title page
Introduction
O Table of contents
Terms of reference
Answer:
Title page should be the first page of a report.
hope it helps!
Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600 MHz. Computer B has a CPI of 2.5 and can be run at a clock rate of 750 MHz. We have a particular program we wish to run. When compiled for computer A, this program has exactly 100,000 instructions. How many instructions would the program need to have when compiled for Computer B, in order for the two computers to have exactly the same execution time for this program
Answer:
Check the explanation
Explanation:
CPI means Clock cycle per Instruction
given Clock rate 600 MHz then clock time is Cー 1.67nSec clockrate 600M
Execution time is given by following Formula.
Execution Time(CPU time) = CPI*Instruction Count * clock time = [tex]\frac{CPI*Instruction Count}{ClockRate}[/tex]
a)
for system A CPU time is 1.3 * 100, 000 600 106
= 216.67 micro sec.
b)
for system B CPU time is [tex]=\frac{2.5*100,000}{750*10^6}[/tex]
= 333.33 micro sec
c) Since the system B is slower than system A, So the system A executes the given program in less time
Hence take CPU execution time of system B as CPU time of System A.
therefore
216.67 micro = =[tex]\frac{2.5*Instruction}{750*10^6}[/tex]
Instructions = 216.67*750/2.5
= 65001
hence 65001 instruction are needed for executing program By system B. to complete the program as fast as system A
The number of instructions that the program would need to have when compiled for Computer B is; 65000 instructions
What is the execution time?
Formula for Execution time is;
Execution time = (CPI × Instruction Count)/Clock Time
We are given;
CPI for computer A = 1.3
Instruction Count = 100000
Clock time = 600 MHz = 600 × 10⁶ Hz
Thus;
Execution time = (1.3 * 100000)/(600 × 10⁶)
Execution time(CPU Time) = 216.67 * 10⁻⁶ second
For CPU B;
CPU Time = (2.5 * 100000)/(750 × 10⁶)
CPU Time = 333.33 * 10⁻⁶ seconds
Thus, instructions for computer B for the two computers to have same execution time is;
216.67 * 10⁻⁶ = (2.5 * I)/(750 × 10⁶)
I = (216.67 * 10⁻⁶ * 750 × 10⁶)/2.5
I = 65000 instructions
Read more about programming instructions at; https://brainly.com/question/15683939
Your job as a researcher for a college is going well. You have gained confidence and skill at pulling data and you are not making as many rookie mistakes. The college executives are begging to take notice of your skills. The college has had serious problems with reporting in the past for several reasons. One problem is there was no centralized department for numbers. Human Resources did some reporting, financial aid another, and the rest was covered by the registrar’s office. It was difficult to determine simple things like number of students enrolled in the fall semester because different departments would generate different. The higher ups want one consistent number they can rely on and they think your department should be in charge of generating that number.
As the first report as the official office numbers they want you to generate a report that tracks student demographics over time (a longitudinal study). Your college has a large percentage of its student body who are affiliated with the military (active duty military, retired military, military spouse, military dependent). For this study the college executives want to see how they stack up to other colleges that have a large percentage of military students.
After doing some research you find a field in the database that named mil_status. The documentation you have on the field says this is the field you are looking for. Since you need to determine when the student was in the military to generate this report you look for a start and end date associated with mil_status. Sure enough the table also has a mil_status_start and a mil_status_end field. These fields when combined with enrollment data allow you to determine if a student was in the military when they were a student. You query the data to check for bad dates and discover a serious issue. Most of the start dates and end dates are NULL. You once again make some quick phone calls to find out what’s going on. It seems this field is not populated unless the college receives official paperwork from the military listing the soldier’s enlistment date. In addition to this you find out that students are not required to update their information ever semester. This means once their mil status is set it is unlikely to ever change. Based on this information prepare a post that addresses the following:
1) What recommendation(s) would you make to the college’s executives to address this issue?
2) Collecting this data will have tangible and intangible costs associated with it. For example requiring official paper work adds an extra burden on registration and on the student. Students may decide to go elsewhere instead of supplying the paperwork or may stop identifying themselves as military. The executives want the data but they don’t want its collection to impact enrollment or place an undue burden on registration (the line is long enough already). How would you respond to these concerns?
3) You noticed something odd in the mil_Status field. The possible values are "Active Duty Military", "Military spouse", "Retired military", "Military Reserves", and "Military dependent". In what way is this field problematic? How could you fix it?
Answer:
Check the explanation
Explanation:
Following are the things to be implemented immediately
Database should be maintained centralized manner so that any one can access data. Number should be given at the time of admission it should contain year of admission,course of admission …etc in the form of code eg. 2015FW1001 means year 2015 Fashion studies Winter admission no 1001. At the time of admission only they have to give the details of military status. Department which taking care of this issue should only have the permission to modify and delete the data. All the departments should be connected to the server by internet/intranet/network. Students should be given user id and password
Same database should be connected and given access through internet also with limited privileges so that user can update their status of military by submitting proof. By these information uploaded centralized administrative department update the status if they satisfied with the documents uploaded.
We can overcome the problem of mil status by giving the freedom to the student update their military status by uploading the documents.
Write a program named RectangleArea to calculate the area of a rectangle with a length of 15.8 and a width of 7.9. The program should have two classes, one is the RectangleArea holding the Main(), and the other one is Rectangle. The Rectangle class has three members: a property of length, a property of width, and a method with a name of CalArea() to calculate the area. You can invoke the auto-provided constructor or write a self-defined constructor to initialize the rectangle. Calculate and display the area of the rectangle by first initialize an object named myRectangle and then calculate its area using the CalArea() method.
Answer:
public class RectangleArea {
public static void main(String[] args) {
Rectangle myRectangle = new Rectangle(15.8, 7.9);
double calArea = myRectangle.calcArea(15.8, 7.9);
System.out.println("The area is "+ calArea);
}
}
class Rectangle{
private double length;
private double width;
//Defined Constructor
public Rectangle(double length, double width) {
this.length = length;
this.width = width;
}
public double calcArea(double len, double wi){
return len* wi;
}
}
Explanation:
This is solved with Java programming languageStart by creating both classes RectangleArea and and RectangleSInce both classes are in the same file, only one can be publicClass Rectangle contains the three members are decribed by the questionprivate double length, private double width and the method calcArea(). It also has a sefl-declared constructor.In the class RectangleArea, an object of Rectangle is created and initialized.The method calcArea is called using the created object and the value is printed.What is the best thing to do if you only want your close friends to be able to see your posts?
A
Avoid posting details about your life.
B
Check your privacy settings.
C
Choose your posts carefully.
D
Only post photos instead of comments.
Answer:
check privacy settings. There will be a filter i am pretty sure :)
You're asked to implement classes to manage personnels at a hospital. Create a class diagram that includes classes (and some variables and methods) that manage employees and patients in a hospital management program. Use interfaces and inheritance to create a hierarchy of all employees including doctors, nurses, and patients. Then, write the code outline of these classes. You don't have to implement any of the methods or a main method. Just add a simple comment or println statement describing what the method would do.
Answer:
Check the explanation
Explanation:
Kindly check the attached image below to see the step by step explanation to the question above.
The relationship between the temperature of a fluid (t, in seconds), temperature (T, in degrees Celsius), is dependent upon the initial temperature of the liquid (T0, in degrees Celsius), the ambient temperature of the surroundings (TA, in degrees Celsius) and the cooling constant (k, in hertz); the relationship is given by: ???? ???? ???????? ???? ???????????? ???? ???????????? ???????????????? Ask the user the following questions: From a menu, choose fluid ABC, FGH, or MNO. Enter the initial fluid temperature, in units of degrees Celsius. Enter the time, in units of minutes. Enter the ambient air temperature, in units of degrees Celsius. Enter the following data into the program. The vector contains the cooling constant (k, units of hertz) corresponding to the menu entries. K Values = [0.01, 0.03, 0.02] Create a formatted output statement for the user in the Command Window similar to the following. The decimal places must match. ABC has temp 83.2 degrees Celsius after 3 minutes. In
Answer:
See explaination
Explanation:
clc;
clear all;
close all;
x=input(' choose abc or fgh or mno:','s');
to=input('enter intial fluid temperature in celcius:');
t1=input('enter time in minutes:');
ta=input('enter ambient temperature in celcius:');
abc=1;
fgh=2;
mno=3;
if x==1
k=0.01;
elseif x==2
k=0.03;
else
k=0.02;
end
t=ta+((to-ta)*exp((-k)*t1));
X = sprintf('%s has temp %f degrees celcius after %d minutes.',x,t,t1);
disp(X);
Select the correct navigational path to create the function syntax to use the IF function.
Click the Formula tab on the ribbon and look in the ???
'gallery
Select the range of cells.
Then, begin the formula with the ????? click ?????. and click OK.
Add the arguments into the boxes for Logical Test, Value_if_True, and Value_if_False.
Answer:
1. Logical
2.=
3.IF
Explanation:
just did the assignment
Explain the following as used in Tally Accounting Software:
Journal entry
Accounting period
Chart of accounts
Posting
Business transactions
In this lab, you use the flowchart and pseudocode found in the figures below to add code to a partially created C++ program. When completed, college admissions officers should be able to use the C++ program to determine whether to accept or reject a student, based on his or her test score and class rank.
// HouseSign.cpp - This program calculates prices for custom made signs.
#include
#include
using namespace std;
int main()
{
// This is the work done in the housekeeping() function
// Declare and initialize variables here
// Charge for this sign
// Color of characters in sign
// Number of characters in sign
// Type of wood
// This is the work done in the detailLoop() function
// Write assignment and if statements here
// This is the work done in the endOfJob() function
// Output charge for this sign
cout << "The charge for this sign is $" << charge << endl;
return(0);
}
Here is the complete question.
In this lab, you use the flowchart and pseudocode found in the figures below to add code to a partially created C++ program. When completed, college admissions officers should be able to use the C++ program to determine whether to accept or reject a student, based on his or her test score and class rank.
start input testScore,
classRank if testScore >= 90 then if classRank >= 25 then output "Accept"
else output "Reject" endif else if testScore >= 80
then if classRank >= 50 then output "Accept" else output "Reject" endif
else if testScore >= 70
then if classRank >= 75 then output "Accept"
else output "Reject"
endif else output "Reject"
endif
endif
endif
stop
Study the pseudocode in picture above. Write the interactive input statements to retrieve: A student’s test score (testScore) A student's class rank (classRank) The rest of the program is written for you. Execute the program by clicking "Run Code." Enter 87 for the test score and 60 for the class rank. Execute the program by entering 60 for the test score and 87 for the class rank.
[comment]: <> (3. Write the statements to convert the string representation of a student’s test score and class rank to the integer data type (testScore and classRank, respectively).)
Function: This program determines if a student will be admitted or rejected. Input: Interactive Output: Accept or Reject
*/ #include using namespace std; int main() { // Declare variables
// Prompt for and get user input
// Test using admission requirements and print Accept or Reject
if(testScore >= 90)
{ if(classRank >= 25)
{ cout << "Accept" << endl; }
else
cout << "Reject" << endl; }
else { if(testScore >= 80)
{ if(classRank >= 50)
cout << "Accept" << endl;
else cout << "Reject" << endl; }
else { if(testScore >= 70)
{ if(classRank >=75) cout << "Accept" << endl;
else cout << "Reject" << endl; }
else cout << "Reject" << endl; } } } //End of main() function
Answer:
Explanation:
The objective here is to use the flowchart and pseudocode found in the figures below to add code to a partially created C++ program. When completed, college admissions officers should be able to use the C++ program to determine whether to accept or reject a student, based on his or her test score and class rank.
PROGRAM:
#include<iostream>
using namespace std;
int main(){
// Declare variables
int testScore, classRank;
// Prompt for and get user input
cout<<"Enter test score: ";
cin>>testScore;
cout<<"Enter class rank: ";
cin>>classRank;
// Test using admission requirements and print Accept or Reject
if(testScore >= 90)
{ if(classRank >= 25)
{ cout << "Accept" << endl; }
else
cout << "Reject" << endl;
}
else { if(testScore >= 80)
{ if(classRank >= 50)
cout << "Accept" << endl;
else cout << "Reject" << endl; }
else { if(testScore >= 70)
{ if(classRank >=75) cout << "Accept" << endl;
else cout << "Reject" << endl;
}
else cout << "Reject" << endl; }
}
return 0;
} //End of main() function
OUTPUT:
See the attached file below:
User documentation _____. Group of answer choices allows users to prepare overall documentation, such as process descriptions and report layouts, early in the software development life cycle (SDLC) describes a system’s functions and how they are implemented contains all the information needed for users to process and distribute online and printed output consists of instructions and information to users who will interact with the system
Answer:
And user documentation consists of instructions and information to users who will interact with the system
Explanation:
user documentation will not allow user to prepare overall documentation because it is already prepared so not A.
user documentation does not need implementation, So not B.
user documentation may not be a printed one . So not C
And user documentation consists of instructions and information to users who will interact with the system, so D is the right option