write a two-to-three-page paper describing cyberwarfare and ways our government protects our own national infrastructure.
In: Computer Science
Write down a C program which will create a list (simple linear linked list) of nodes. Each node consists of two fields. The first field is a pointer to a structure that contains a student id (integer) and a grade-point average (float). The second field is a link. The data are to be read from a text file. Your program should read a file of 10 students (with student id and grade point average) and test the function you wrote (by printing student’s information on screen). (Please comment the codes)
In: Computer Science
You have been asked to build a database for a pet foster and adoption shelter. The agency is a non-profit that takes in stray or abandoned pets and places them with foster care givers until the pet is adopted. Foster care givers are volunteers, though they must first be screened. The database needs to track all animals in its care, their species, breed, name and condition. It also needs to track all approved foster care givers and which animals are currently in their care. Foster care givers are also supposed to turn in monthly reports on the animals in their care. The database also needs to track the adoptions of the animals. Currently, volunteers come into the shelter and fill out a paper form. After a background check they are added to a file. Some volunteers complain that they are never contacted again. The shelter staff admits, they tend to go with foster care givers they know and some people get forgotten in the file. The shelter has also occasionally lost track of an animal in foster care when the care giver failed to turn in the monthly reports. Another recurring problem is that when someone comes into the shelter looking to adopt, it is not always easy or even possible to let them know about all the animals available for adoption. Ideally the shelter would like people to be able to register as a volunteer on-line. They would like to be able to call up a list of all available foster volunteers. They also would be like to be able to pull up all the animals of the kind a potential adopter is interested in and know exactly where those animals are and who is caring for them.
Would animals be stakeholders in this database? Explain why or
why not.
What might be some of the shelter database security issues?
In: Computer Science
#include<iostream>
#include<string>
#include<fstream>
#include<vector>
/*HW: Create two more functions,
Modify the posted grade example that uses dynamic arrays and file I/O to include the following:
-Use vectors
-read from values from the file and store them in the vector.
Modify the function getGrades
Extend the program to also include the following features:
-A menu option that allows the user to add more students and
there grades. Assume the number of quizzes stay the same based on
the value read from the file
-A menu option that allows the user to display all students that
were added and their grades. As well as, the average of the quizzes
and the average of the student
-A menu option to search for a student by ID, the program must
display the student ID, and the student grades
-An option to exit.
Make sure the new students added to the vector are stored in the original file that you read from. Hence, if you exit the program and run it again, the new students added will show in your new run of the program.*/
using namespace std;
//Don't forget to pass sid and grade by reference
void getGrades(ifstream &fin, vector<string> &sid, vector<vector<double>> &grade, int num_stud, int NUM_Q)
{
for (int i = 0; i<num_stud; i++)
{
string tempId;
double sgradetemp;
fin >> tempId;
sid.push_back(tempId);
vector<double>sgradetempv;
fin >> sid[i];
for (int j = 0; j < NUM_Q; j++)
{
fin >> sgradetemp;
//Vector of values
sgradetempv.push_back (sgradetemp);
}
//Vector of a vector
grade.push_back(sgradetempv);
}
}
void compute_st_ave(vector<vector<double>> grade, vector<double> &st_ave, int num_stud, int NUM_Q)
{
for (int s = 0; s<num_stud; s++)
{
double sum = 0;
for (int q = 0; q<NUM_Q; q++)
{
sum = sum + grade[s][q];
}
st_ave.push_back (s = sum / NUM_Q);
}
}
void compute_q_ave(vector<vector<double>>grade, vector<double>quiz_ave, int num_stud, int NUM_Q)
{
for (int q = 0; q<NUM_Q; q++)
{
double sum = 0;
for (int s = 0; s<num_stud; s++)
{
sum = sum + grade[s][q];
}
quiz_ave.push_back(q = sum / num_stud);
}
}
void saveToFile(vector<string> sid, vector<vector<double>>grade, vector<double>st_ave, vector<double>quiz_ave, int num_stud, int NUM_Q)
{
ofstream fout("results.txt");
fout << "Dispalying the results" << endl;
fout << "\t\t\t\tAverage" << "\t\t" << "Quizzes\n";
for (int s = 0; s<num_stud; s++)
{
fout << "Student " << sid[s] << ":\t" << st_ave[s] << " \t\t";
for (int q = 0; q<NUM_Q; q++)
{
fout << grade[s][q] << "\t";
}
fout << endl;
}
fout << "Quiz Average: \t\t\t";
for (int q = 0; q<NUM_Q; q++)
{
fout << "\t" << quiz_ave[q] << " ";
}
fout << endl;
fout.flush();
fout.close();
}
int main()
{
int NUM_STUD, NUM_Q;
ifstream fin("grades.txt");
fin >> NUM_STUD >> NUM_Q;
/*
string *sid = new string[NUM_STUD];
double **grade = new double *[NUM_STUD];
for (int i = 0; i < NUM_STUD; i++)
{
grade[i] = new double[NUM_Q];
}
double *st_ave = new double[NUM_STUD];
double *quiz_ave = new double[NUM_Q];
*/
vector<string>sid;
vector<vector<double>>grade;
vector<double> st_ave;
vector<double>quize_ave;
getGrades(fin, sid, grade, NUM_STUD, NUM_Q);
compute_st_ave(grade, st_ave, NUM_STUD, NUM_Q);
compute_q_ave(grade, quiz_ave, NUM_STUD, NUM_Q);
saveToFile(sid, grade, st_ave, quiz_ave, NUM_STUD, NUM_Q);
fin.close();
system("pause");
return 0;
}
In: Computer Science
Test Your Understanding
Create a JAVA package by name ClassEx2 and in the main() method
of
the class, assign your name to a String object and your father name
to a
different String object and do the following;
Concatenate your name and your father name.
Get the length of your full name.
Find the index of any character in your full name.
Replace the occurrence of any lower case character in your
full
name to capital character.
Compare your first name with your father name , display
message
indicating which name is first lexicographically.
In: Computer Science
In Python write a function that simulates the throwing of any even numbered dice which will be passed on as a parameter: customDice(sides). The function will return a random number rolled for that particular type of dice. Write the program that will utilize the customDice function with the following specification: Ask the user to pick which even-sided dice to use. The program will then roll the dice twice. If the total of both rolls is greater than the number of die sides+1, then they lose. If not, they win. Write statements that prompt the user for the type of dice to use, print the value from the two rolls and a message whether they win or lose. If the user enters an odd number, ask for the input again.
Sample dialogs:
Please choose an even-sided dice: 3
Sorry, it must be an even-sided dice.
Please choose an even-sided dice: 10
Roll 1: 3
Roll 2: 10
Total: 13
You lose (13 > 11)!
Please choose an even-sided dice: 8
Roll 1: 3
Roll 2: 2
Total: 5
You win (5 < 9)!
In: Computer Science
Consider a circuit-switching scenario in which Ncs users, must share a link of capacity 150 Mbps. Each user alternates between periods of activity when the user generates data at a constant rate of 20 Mbps and periods of inactivity when he generates no data. Suppose further that he is active only 20% of the time. Assume a circuit switched TDM. What is the maximum number of circuit-switched users that can be supported? Assume packet switching is used for the remaining parts of this question. Suppose there are 13 packet- switching users (i.e., Nps = 13). Can this many users be supported under circuit-switching? Explain. What is the probability that a given (specific) user is transmitting, and the remaining users are not transmitting? What is the probability that one user (any one among the 13 users) is transmitting, and the remaining users are not transmitting? When one user is transmitting, what fraction of the link capacity will be used by this user? What is the probability that any 7 users (of the total 13 users) are transmitting and the remaining users are not transmitting? (Hint: you will need to use the binomial distribution.) What is the probability that more than 7 users are transmitting? Comment on what this implies about the number of users supportable under circuit switching and packet switching. What is the probability that more than 7 users are transmitting? Comment on what this implies about the number of users supportable under circuit switching and packet switching.
In: Computer Science
I am struggling to write a python script that
calculates the average length ,max length shortest length and
overall average length of of a snake and ladder game. I use python
3
The length is the number the dice is rolled until the max is
reached
We need a python script that calculates the number of moves it will take for a single player to reach 100. We have to simulate a snake and ladder game using python language. So one person plays the game several times and will compare the number of moves per each played game for us to be able to come up with the required data
In: Computer Science
describe and discuss the Software Development Life Cycle as it relates to creating software that will calculate the totals and dispense change for a cash register at a local grocery store
In: Computer Science
Ask the user to enter test scores. Once they have entered -1, print out the highest grade. Ensure that the grade entered is an integer.(Using Java Language)
Enter integers between 0 and 100, -1 when finished.
Enter a test score: [asdf]
Enter an integer.
Enter a test score: [32.5]
Enter an integer.
Enter a test score: [42]
Enter a test score: [99]
Enter a test score: [87]
Enter a test score: [x]
Enter an integer.
Enter a test score: [-1]
The max grade is: 99
In: Computer Science
c++
For your program, you will choose either the Selection Sort algorithm or the Insertion Sort algorithm and create a recursive implementation of that algorithm. Your program should:
In: Computer Science
In C language
Write a program that includes a function search() that finds the index of the first element of an input array that contains the value specified. n is the size of the array. If no element of the array contains the value, then the function should return -1. The program takes an int array, the number of elements in the array, and the value that it searches for. The main function takes input, calls the search()function, and displays the output. Name program part1.c
int search(int a[], int n, int value);
Example 1:
Enter length of array: 4
Enter elements of array: 8 2 3 9
Enter the value for searching: 2
Output: 1
Example 2:
Enter the length of the array: 6
Enter the elements of the array: 4 6 1 0 2 9
Enter the value for searching: 5
Output: -1
2. Modify the part 1 program so that it deletes all instances of the value from the array. As part of the solution, write and call the function delete() with the following prototype. n is the size of the array. The function returns the new size of the array after deletion (The array after deletion will be the same size as before but the actual elements are the elements from index 0 to new_size-1). In writing function delete(), you may include calls to function search(). The main function takes input, calls the delete()function, and displays the output. Name your program part2.c.
int delete(int a[], int n, int value);
Example 1:
Enter the length of the array: 6
Enter the elements of the array: 4 3 1 0 3 9
Enter the value for deleting: 3
Output array:
4 1 0 9
In: Computer Science
There are several typical cube computation methods such as Multi-Way, BUC, and Star-cubing. Briefly describe each one of these methods outlining the key points.
In: Computer Science
(dominoes N) which returns a list containing the (N+1)(N+2)/2 tiles in a double-N domino set, with each tile represented as a dotted pair (an improper list).
(dominoes 2) ⇒ ((2 . 2) (2 . 1) (2 . 0) (1 . 1) (1 . 0) (0 . 0))
using the programming language scheme
i need the question to be answered using the programming language Scheme
In: Computer Science
c++
Please read the whole question and instrucions.
The instructor wants a function to convert string to int to perform the bitwise operations then convert int to string back again to show results.
Question:Write a program that produces the
bitwise OR, bitwise AND, and bitwise XOR of the bit strings
1001 0011 1011 and 1111 1010 0000.
Thank you in advance.
In: Computer Science