how to solve the binary bomb phase 3.. what is the password
In: Computer Science
1 In Linux, when a timer expires, there is a context switch so that the CPU scheduler can run.
False
True
2 The operating system keeps track of CPU usage for all processes.
False
True
3 A system call that does not invoke the CPU scheduler executes in the same context as the process that makes the call.
False
True
4
A ____ synchronizes access to memory from devices that want to access it.
In UNIX, the system call to perform input from a device is named ___.
In: Computer Science
6. Write a function to count a tree’s height, which is the length of the longest path from the root to a leaf.
Please finish this question in python programming
In: Computer Science
1. Test the execution time of the program in Code 3. Make a screen capture which shows the execution time that has the unit of machine time unit.
Code3
SOURCE.CPP
# include<fstream>
# include "List.h"
# include <iostream>
using namespace std;
int main()
{
List temps;
int oneTemp;
ifstream inData;
ofstream outData;
inData.open("temp.dat");
if (!inData)
{
outData<<"Can't open file temp.dat" <<
endl;
return 1;
}
inData >> oneTemp;
while (inData && !temps.IsFull())
{
if (!temps.IsPresent(oneTemp))
temps.Insert(oneTemp);
inData >> oneTemp;
}
outData << "No. of uniqiue readings:" <<
temps.Length() << endl;
temps.Reset();
while (temps.HasNext())
{
oneTemp = temps.GetNextItem();
outData << oneTemp << endl;
}
temps.Delete(23);
outData << "Readings without value of 23." <<
endl;
temps.Reset();
while (temps.HasNext())
{
oneTemp = temps.GetNextItem();
outData << oneTemp << endl;
}
temps.SelSort();
outData << "Readings after the sort algorithm." <<
endl;
temps.Reset();
while (temps.HasNext())
{
oneTemp = temps.GetNextItem();
outData << oneTemp << endl;
}
inData.close();
outData.close();
system("pause");
return 0;
}
LIST.CPP
// Implementation file array-based list
// (“list.cpp”)
#include "List.h"
#include <iostream>
using namespace std;
List::List()
// Constructor
// Post: length == 0
{
length = 0;
}
int List::Length() const
// Post: Return value is length
{
return length;
}
bool List::IsFull() const
// Post: Return value is true
// if length is equal
// to MAX_LENGTH and false otherwise
{
return (length == MAX_LENGTH);
}
bool List::IsEmpty() const
// Post: Return value is true if length is equal
// to zero and false otherwise
{
return (length == 0);
}
void List::Insert(/* in */ ItemType item)
// Pre: length < MAX_LENGTH && item is assigned
// Post: data[length@entry] == item &&
// length == length@entry +
1
{
data[length] = item;
length++;
}
void List::Delete( /* in */ ItemType item)
// Pre: length > 0 && item is assigned
// Post: IF item is in data array at entry
// First occurrence of item is no longer
// in array
// && length == length@entry -
1
// ELSE
// length and data array are
unchanged
{
int index = 0;
while (index < length &&
item != data[index])
index++;
// IF item found, move last element into
// item’s place
if (index < length)
{
data[index] = data[length - 1];
length--;
}
}
ItemType List::GetNextItem()
// Pre: No transformer has been executed since last call
// Post:Return value is currentPos@entry
// Current position has been updated
// If last item returned, next call returns first
item
{
ItemType item;
item = data[currentPos];
if (currentPos == length )
currentPos = 0;
else
currentPos++;
return item;
}
bool List::IsPresent( /* in */ ItemType item) const
// Searches the list for item, reporting
// whether found
// Post: Function value is true, if item is in
// data[0 . . length-1] and is false otherwise
{
int index = 0;
while (index < length && item != data[index])
index++;
return (index < length);
}
void List::SelSort()
// Sorts list into ascending order
{
ItemType temp;
int passCount;
int sIndx;
int minIndx; // Index of minimum so far
for (passCount = 0; passCount < length - 1;
passCount++)
{
minIndx = passCount;
// Find index of smallest value left
for (sIndx = passCount + 1; sIndx < length;
sIndx++)
if (data[sIndx] < data[minIndx])
minIndx = sIndx;
temp = data[minIndx]; // Swap
data[minIndx] = data[passCount];
data[passCount] = temp;
}
}
void List::Reset()
{
currentPos = 0;
}
bool List::HasNext() const
{
return(currentPos != length);
}
LIST.H
#pragma once
#include<iostream>
using namespace std;
const int MAX_LENGTH = 110000;
typedef int ItemType;
class
List //
Declares a class data type
{
public:
//
Public member functions
List();
// constructor
bool IsEmpty() const;
bool IsFull() const;
int Length() const; // Returns length of list
void Insert(ItemType item);
void Delete(ItemType item);
bool IsPresent(ItemType item) const;
void Reset();
ItemType GetNextItem();
void SelSort();
bool HasNext() const;
private: // Private data members
int length; // Number of values currently stored
int currentPos; // Used in iteration
ItemType data[MAX_LENGTH];
};
In: Computer Science
Create an ER data model to reflect the process of a consumer opening a checking account at a bank. The data model should be created using the data modelling utility in MySQLWorkbench.The model should contain at least five (5) entities. Each entity should have at least three (3) attributes.
Please build using SQL Queries as per mysql.
Please help... Urgent
In: Computer Science
<HTML>
<Head>
</HEAD>
<BODY>
</BODY>
<CANVAS ID ="MyScreen" width="780" Height="640"
alt="Your browser does not support canvas"></CANVAS>
<SCRIPT>
var vertexShaderText =
[
'precision mediump float;',
'',
'attribute vec2 vertPosition;',
'attribute vec3 vertColor;',
'varying vec3 fragColor;',
'void main()',
'{',
'gl_pointsize = 10.0;',
'fragColor = vertColor;',
'gl_Position = vec4(vertPosition,0.0,1.0);',
'}'
].join("\n");
var fragmentShaderText =
[
'precision mediump float;',
'varying vec3 fragColor;',
'void main()',
'{',
'gl_FragColor = vec4(fragColor,1.0);',
'}'
].join('\n');
var c = document.getElementById("MyScreen");
//var ctx = c.getContext("2d");
//ctx.beginPath();
//ctx.arc(95,50,40,0,2*Math.PI);
//ctx.stroke();
var gl =
c.getContext("webgl")||c.getContext("experimental-webgl");
if(!gl)
{
alert("WEBGL IS NOT
AVAILABLE");
}
gl.viewport(0,0,c.width, c.height);
gl.clearColor(.5,.5,1.0,1.0);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);
//Setup shaders
var vertexShader =
gl.createShader(gl.VERTEX_SHADER);
var fragmentShader =
gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(vertexShader,vertexShaderText);
gl.shaderSource(fragmentShader,fragmentShaderText);
gl.compileShader(vertexShader);
if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS))
{
console.log("ERROR:
",gl.getShaderInfoLog(vertexShader));
}
gl.compileShader(fragmentShader);
if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS))
{
console.log("ERROR:
",gl.getShaderInfoLog(fragmentShader));
}
//Setup program
var program = gl.createProgram();
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
if(!gl.getProgramParameter(program,gl.LINK_STATUS))
{
console.error('ERROR',
gl.getShaderInfoLog(program));
}
gl.validateProgram(program);
if(!gl.getProgramParameter(program,gl.VALIDATE_STATUS))
{
console.error('ERROR',
gl.getShaderInfoLog(program));
}
//Create Buffer
var triangleVertices =
[//x and y R, G,
B
0.0,0.5, 1.0,0.0,0.0,
-0.5,-0.5, 0.0,1.0,0.0,
0.5,-0.5, 0.0,0.0,1.0
];
var triagnleVertexBufferObject =
gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER,triagnleVertexBufferObject);
gl.bufferData(gl.ARRAY_BUFFER, new
Float32Array(triangleVertices),gl.STATIC_DRAW);
var positionAttributeLcoation =
gl.getAttribLocation(program,'vertPosition');
var colorAttributeLcoation =
gl.getAttribLocation(program,'vertColor');
gl.vertexAttribPointer(
positionAttributeLcoation, //ATTRIBUTE LOCATION
2, //NUMBER of elements per attribute
gl.FLOAT, //TYPES OF ELEMENTS
gl.FALSE,
5*Float32Array.BYTES_PER_ELEMENT, //SIZE OF AN
INDIVIDUAL VERTEX
0 //OFFSET
);
gl.vertexAttribPointer(
colorAttributeLcoation, //ATTRIBUTE LOCATION
3, //NUMBER of elements per attribute
gl.FLOAT, //TYPES OF ELEMENTS
gl.FALSE,
5*Float32Array.BYTES_PER_ELEMENT, //SIZE OF AN
INDIVIDUAL VERTEX
2*Float32Array.BYTES_PER_ELEMENT //OFFSET
);
gl.enableVertexAttribArray(positionAttributeLcoation);
gl.enableVertexAttribArray(colorAttributeLcoation);
//Main Loop
gl.useProgram(program);
gl.drawArrays(gl.TRIANGLES,0,3);
</SCRIPT>
</HTML>
2.3At the lowest level of processing, we manipulate bits in the framebuffer. In WebGL, we can create a virtual framebuffer in our application as a two- dimensional array. You can experiment with simple raster algorithms, such as drawing lines or circles, through a function that generates a single value in the array. Write a small library that will allow you to work in a virtual frame- buffer that you create in memory. The core functions should be WritePixel and ReadPixel. Your library should allow you to set up and display your vir- tual framebuffer and to run a user program that reads and writes pixels using gl.POINTS in gl.drawArrays.
2.4 Turtle graphics is an alternative positioning system that is based on the concept of a turtle moving around the screen with a pen attached to the bottom of its shell. The turtle’s position can be described by a triplet (x, y, θ), giving the location of the center and the orientation of the turtle. A typical API for such a system includes functions such as the following: init(x,y,theta); // initialize position and orientation of turtle forward(distance); right(angle); left(angle); pen(up_down); Implement a turtle graphics library using WebGL. All this using Html file below and editing it
In: Computer Science
The administration of the Kasoa Government hospital wants to improve its quality of service by reducing the waiting time of travelers. For that purpose, they want to design what could be the best queuing strategy to have the minimum waiting time. You have been task to advice on the best queuing strategy in order to reduce the waiting time of patients before attended to. Discuss how you will address the problem
In: Computer Science
Access control can be considered as the central element of computer security. Question 4(a), 4(b), 4 (c) and 4(d) based on this information.
4 (a). Relate the principal objective of computer security with the function of access control.
4 (b). Briefly explain how access control being implemented in the machine.
4 (c). If Process A requires 500MB of memory space to perform calculation and Process B requires 100MB of memory space to perform graphics processing, identify the object, subject and access operation in this scenario. Provide explanation for your answer.
4 (d). Company RT wants to have different access levels for each of its users. A management level employee will have more privileges to files and operations. The executive level will have moderate privilege to the files but individual users will have their own level of control to the files they own. Which type of access control is suitable for this company and its employee? Clearly explain and justify your answer.
In: Computer Science
Goal: to write a Python program that will read a playlist from a CSV file and display it in the console in the form of a table.
https://s3.eu-west-2.amazonaws.com/bb-python-modules/Coursework/CW3/playlist_text_question.html
The following is a link to the question. It includes all instruction and a template file (with additional instructions) where the answer must be completed.
In: Computer Science
DRAW A K-MAP FOR THIS SIX VARIABLE .
THE OUTPUT VALUES ARE(1,2,3,4,5,6,7,8,16,17,19,20,22,23,24,25,26,29,30,31,32,33,35,38,39,40,42,45,48,50,51,52,54,55,57,58,59)
DRAW K-MAP
LAYOUT OF K -MAP
SOP
THANKYOU
In: Computer Science
Your objective is to write a well-documented simple program using classes, a loop, and nested ifs to simulate an ATM using JAVA.
1. Create an ATM class with class variables name, pin, and balance, a constructor with parameters to assign values to the three instance variables, methods to get the name, pin, and balance, and methods to handle validated deposits and withdrawals ( deposit and withdrawal amounts cannot be negative, and withdrawal amount must not be greater than the existing balance).
2. In the ATMTest class, read the names, 4 digit pin numbers, and account balances of two customers into two instances of the ATM class. Display the two customers names, pins, and balances formatted.
3. Now that you have all your customers’ information start your ATM to accomplish the following within an infinite loop,
a). Display a welcome screen with your bank’s information and prompt for and read the customer entered pin.
b). Use a nested if to match the entered pin with one of the two customers’ pins. If the entered pin number matches that of one of the customers, then:
i. Welcome the customer by name and display the balance.
ii. Display option to 1. DEPOSIT, 2. WITHDRAW or 3. EXIT.
iii. If option 1 is selected, then use the instance deposit method to prompt for deposit amount, read, and add a valid deposit amount to the customer’s balance
iv. If option 2 is selected, then use the instance withdrawal method to subtract a valid withdrawal amount from the customers balance
v. If option 3 is selected, go to step a.
4. Should the entered pin number not match either of the two customers, notify the customer that the entered pin is not valid and go to step a.
5. Selection of the EXIT option must display welcome/login screen (step a).
6. Should an incorrect option be entered, notify the user and display the original welcome/login screen (step a).
Please lists the IDE you used for the project.
In: Computer Science
This question has been answered before. I need a new, slightly modified code for the following:
A palindrome is a word that it reads the same left to right and right to left. For this programming assignment, you need to write a C++ program that does the following:
Please provide new code along with screenshot of output.
In: Computer Science
Explain how Apple Inc. customers will place an order, how the order will be delivered and how the process for complaints will be handled.
In: Computer Science
This question has been answered already however, I'd like some new examples.
Task: In C#, create a minimum of three try/catch statements that would handle potential input errors. Thank you.
In: Computer Science
Java questions. Please answer everything. It mean the world to me. Thank you very much
1: ArrayList<String> list = new ArrayList<String>(); 2: list.add( "Denver" ); 3: list.add( "Austin" ); 4: list.add( new java.util.Date() ); 5: String city = list.get( 0 ); 6: list.set( 2, "Dallas" ); 7: System.out.println( list.get(2) );
1: ArrayList<Integer> list = new ArrayList<Integer>(); 2: list.add(1); 3: list.add(2); 4: list.add(3); 5: list.remove(1); 6: System.out.println( list );
1: class Test { 2: public static void main ( String [] args ) { 3: Count myCount = new Count(); 4: int times = 0; 5: for ( int i = 0; i < 100; i++ ) 6: increment( myCount, times ); 7: System.out.println( "count is " + myCount.count ); 8: System.out.println( "times is " + times ); 9: } 10: public static void increment ( Count c, int times ) { 11: c.count++; 12: times++; 13: } 14: } 15: 16: class Count { 17: public int count; 18: public Count ( int c ) { 19: count = c; 20: } 21: public Count () { 22: count = 1; 23: } 24: }
1: public class Test { 2: public static void main ( String [] args ) { 3: java.util.Date[] dates = new java.util.Date[10]; 4: System.out.println( dates[0] ); 5: System.out.println( dates[0].toString() ); 6: } 7: }
1: public class C { 2: private int p; 3: 4: public C () { 5: System.out.println( "C's no-arg constructor invoked" ); 6: this(0); 7: } 8: 9: public C ( int p ) { 10: p = p; 11: } 12: 13: public void setP ( int p ) { 14: p = p; 15: } 16: }
1: public class Test { 2: private int id; 3: public void m1 () { 4: this.id = 45; 5: } 6: public void m2 () { 7: Test.id = 45; 8: } 9: }
In: Computer Science