The following code segment is stored in memory starting at memory location 0x00445670.
What are the two possible values for the contents of the PC after the branch instruction has executed?
bgez $a0, skip # mem location: 0x00445670
subu $s2, $s1, $t0 # branch NOT taken (false)
ori $v0, $t1, 0x0003 #
skip:
addi $t0, $t1, 2 # branch taken (true)
if taken:
if not taken:
Hint: Remember how many bytes each instructions takes.
In: Computer Science
write a C/C++ program that implements the banker's algorithm. Verify your implementation using the data from the textbook as well as the attached, but unverified (meaning that it is possible the system is already in an unsafe state), file. The file format is as follows:
Line 1 contains a number of resources (m).
Line 2 contains the quantity for each resource (I.e., the resource vector.
Line 3 contains the number of processes (n).
Lines 4 through 3+n contain the Claim matrix. Each line contains the maximum resource requirements for one process.
Lines 4+n and beyond contain the Allocation matrix. Each line contains the current number of resources allocated to the process.
The Claim and Allocation of matrices are in the same process order.
In: Computer Science
Clearly explain the input-process-output mechanism in a wearable computer using appropriate example?
In: Computer Science
JavaScript Programming Assignment
PLEASE NOTE: You must create and call a main function, and if instructed include additional functions called by the main. Make sure to use ES6 style of keywords => instead of the older function and for local scope variables use the keyword let and not a keyword var. Make sure to follow the requirements and recheck before submitting.
PROJECT GOAL:
Create a program that simulates tossing a coin. This program should be titled flippingacoin.js and will require you to include two functions, one of them is called main and the other flip. The use of a loop is required for this program. Make sure the program includes a user prompt asking how many times to toss the coin. Program a function called flip which does not include parameters and randomly (using math library random) returns either a String called heads or one called tails. Call onto this function in main as many times as requested by using a loop. Make sure to report the results.
Example output:
How many times should I toss the coin? 4000
Results of 4000 tosses.
Heads: # 2635, Tails: 1365
NOTE: End users should be able to enter a higher number of tosses such as 300500020 and receive accurate results.
Thank you for your help with this project.
In: Computer Science
Discuss the best type of network and protocol to use in organizations to ensure protection of customer information. Justify your selection with specific reasons, facts, and examples.
In: Computer Science
Array-based implementations of stacks and queues require the knowing the location of data within the arrays. However, these two data structures store data differently. What is this difference and why does it exist? Could the stack-approach be used to store information within queues (or the other way around)? Why or why not? If it is possible, what would be the side effects of such an approach?
In: Computer Science
Describe the major differences between traditional waterfall and agile software developments. In your opinion, what are the most notable advantages and disadvantages of each methodology?
In: Computer Science
State if the given statements are true or false by reporting your answers (T for ``true’’ and F for ``false’’) in the last column of the following table.
(i) |
1000 bits equal one byte. |
|
(ii) |
Batch processing allows the creators of computing jobs to interact with the jobs during their completion. |
|
(iii) |
Multiprogramming assigns the same time interval to all computing jobs. |
|
(iv) |
1000 bytes equal one kilobyte. |
|
(v) |
Multiprogramming is used only in multi-user settings. |
|
(vi) |
1 terabyte equals more bits than 1 gigabyte. |
|
(vii) |
Batch processing is a kind of multitasking. |
|
(viii) |
Scaling in the context of operating systems is same as speeding up or slowing down the processes aimed at completion of computing jobs based on the deadlines given by the creators of the jobs. |
|
(ix) |
Load balancing in the context of operating systems means splitting the computer programs written in high-level programming languages into smaller programs, to make sure that all processors are assigned equal number of lines of code written in the high-level programming languages. |
|
(x) |
1 megabyte equals 8 terabytes. |
|
(xi) |
There are multiple criteria for classifying computer networks. |
|
(xii) |
The only way to create a larger computer network from bus networks is to connected them with a bridge. |
|
(xiii) |
File manager is a part of user interface. |
|
(xiv) |
Booting is the process of transferring the operating system from the main memory to the mass storage. |
|
(xv) |
1 exabyte equals 250 kilobytes. |
|
(xvi) |
Device drivers are a part of user interface. |
|
(xvii) |
Star networks are same as networks of computers used to process data about stars in the sky. |
|
(xviii) |
1 petabyte equals 253 bits. |
|
(xix) |
Auditing software in the context of operating systems is a software that creates a software during an attack on a computer/computers, to defend the computer/computers. |
|
(xx) |
A dispatcher in the context of operating systems chooses the activities to consider for execution. |
In: Computer Science
Does agile development work for every project? In your opinion, why might agile development not be suitable for companies all the time? What are some notable reasons why agile would not be the most effective or efficient methodology?
In: Computer Science
Hello i need someone to implement for me RADIX SORT IN JAVA for Characters NOT numbers
and i need the code super fast please
In: Computer Science
1) What are import libraries ? 2) What commands are found in the #include library that we will use ? 3) What is syntax ? 4) What does the computer do when it encounters a statement that Declares a variable ? 5) What are the byte sizes for int, double and char data types ? 6) Why is an int variable only able to store a range of values from approx -2.1 billion to +2.1 billion ? 7) What is PEMDAS ? How is it also important when doing math in a computer program ? 8) Is the ‘=’ sign the same for math and programming ? Explain your answer. 9) What happens when you Assign a value to a variable ? How does it work ? 10) What is variable Initialization, is it necessary in JAVA ?
In: Computer Science
DO IN JAVA
If you have downloaded this book’s source code (the companion Web site is available at www.pearsonhighered.com/gaddis), you will find the following files in the Chapter 07 folder:
GirlNames.txt – This file contains a list of the 200 most popular names given to girls born in the United States for the years 2000 through 2009.
BoyNames.txt – This file contains a list of the 200 most popular names given to boys born in the United States for the years 2000 through 2009.
Write a program that reads the contents of the two files into two separate arrays, or ArrayLists. The user should be able to enter a boy’s name, a girl’s name, or both, and the application will display messages indicating whether the names were among the most popular.
BoyNames:
Jacob
Michael
Joshua
Matthew
Daniel
Christopher
Andrew
Ethan
Joseph
William
Anthony
David
Alexander
Nicholas
Ryan
Tyler
James
John
Jonathan
Noah
Brandon
Christian
Dylan
Samuel
Benjamin
Zachary
Nathan
Logan
Justin
Gabriel
Jose
Austin
Kevin
Elijah
Caleb
Robert
Thomas
Jordan
Cameron
Jack
Hunter
Jackson
Angel
Isaiah
Evan
Isaac
Mason
Luke
Jason
Gavin
Jayden
Aaron
Connor
Aiden
Aidan
Kyle
Juan
Charles
Luis
Adam
Lucas
Brian
Eric
Adrian
Nathaniel
Sean
Alex
Carlos
Bryan
Ian
Owen
Jesus
Landon
Julian
Chase
Cole
Diego
Jeremiah
Steven
Sebastian
Xavier
Timothy
Carter
Wyatt
Brayden
Blake
Hayden
Devin
Cody
Richard
Seth
Dominic
Jaden
Antonio
Miguel
Liam
Patrick
Carson
Jesse
Tristan
Alejandro
Henry
Victor
Trevor
Bryce
Jake
Riley
Colin
Jared
Jeremy
Mark
Caden
Garrett
Parker
Marcus
Vincent
Kaleb
Kaden
Brady
Colton
Kenneth
Joel
Oscar
Josiah
Jorge
Cooper
Ashton
Tanner
Eduardo
Paul
Edward
Ivan
Preston
Maxwell
Alan
Levi
Stephen
Grant
Nicolas
Omar
Dakota
Alexis
George
Collin
Eli
Spencer
Gage
Max
Cristian
Ricardo
Derek
Micah
Brody
Francisco
Nolan
Ayden
Dalton
Shane
Peter
Damian
Jeffrey
Brendan
Travis
Fernando
Peyton
Conner
Andres
Javier
Giovanni
Shawn
Braden
Jonah
Cesar
Bradley
Emmanuel
Manuel
Edgar
Erik
Mario
Edwin
Johnathan
Devon
Erick
Wesley
Oliver
Trenton
Hector
Malachi
Jalen
Raymond
Gregory
Abraham
Elias
Leonardo
Sergio
Donovan
Colby
Marco
Bryson
Martin
GirlsNames:
Emily
Madison
Emma
Olivia
Hannah
Abigail
Isabella
Samantha
Elizabeth
Ashley
Alexis
Sarah
Sophia
Alyssa
Grace
Ava
Taylor
Brianna
Lauren
Chloe
Natalie
Kayla
Jessica
Anna
Victoria
Mia
Hailey
Sydney
Jasmine
Julia
Morgan
Destiny
Rachel
Ella
Kaitlyn
Megan
Katherine
Savannah
Jennifer
Alexandra
Allison
Haley
Maria
Kaylee
Lily
Makayla
Brooke
Mackenzie
Nicole
Addison
Stephanie
Lillian
Andrea
Zoe
Faith
Kimberly
Madeline
Alexa
Katelyn
Gabriella
Gabrielle
Trinity
Amanda
Kylie
Mary
Paige
Riley
Jenna
Leah
Sara
Rebecca
Michelle
Sofia
Vanessa
Jordan
Angelina
Caroline
Avery
Audrey
Evelyn
Maya
Claire
Autumn
Jocelyn
Ariana
Nevaeh
Arianna
Jada
Bailey
Brooklyn
Aaliyah
Amber
Isabel
Danielle
Mariah
Melanie
Sierra
Erin
Molly
Amelia
Isabelle
Madelyn
Melissa
Jacqueline
Marissa
Shelby
Angela
Leslie
Katie
Jade
Catherine
Diana
Aubrey
Mya
Amy
Briana
Sophie
Gabriela
Breanna
Gianna
Kennedy
Gracie
Peyton
Adriana
Christina
Courtney
Daniela
Kathryn
Lydia
Valeria
Layla
Alexandria
Natalia
Angel
Laura
Charlotte
Margaret
Cheyenne
Mikayla
Miranda
Naomi
Kelsey
Payton
Ana
Alicia
Jillian
Daisy
Mckenzie
Ashlyn
Caitlin
Sabrina
Summer
Ruby
Rylee
Valerie
Skylar
Lindsey
Kelly
Genesis
Zoey
Eva
Sadie
Alexia
Cassidy
Kylee
Kendall
Jordyn
Kate
Jayla
Karen
Tiffany
Cassandra
Juliana
Reagan
Caitlyn
Giselle
Serenity
Alondra
Lucy
Kiara
Bianca
Crystal
Erica
Angelica
Hope
Chelsea
Alana
Liliana
Brittany
Camila
Makenzie
Veronica
Lilly
Abby
Jazmin
Adrianna
Karina
Delaney
Ellie
Jasmin
In: Computer Science
Why is building security into the SDLC important?"
In: Computer Science
Implement a version of merge() that copies the second half of a[] to aux[] in decreasing order and then does the merge back to a[]. This change allows you to remove the code to test that each of the halves has been exhausted from the inner loop. Note: the resulting sort is not stable.
Algorithms Fourth Edition Exercise 2.2.10
In: Computer Science
Python Assignement
Programm Assignement 1
# Description: This program is a function which calculates pi per Leibniz
formula,based on the number of values passed to it.
def calculate_pi(n):
total, sign = 0, 1
for i in range(n):
term = 1 / (2 * i + 1)
total += term * sign
sign *= -1
total *= 4
return total
n = int(input("How many terms: "))
print(calculate_pi(n))
PRogramm Assignement2
# This program is to modify the program for Homewor
k Assignment 1
so that it includes exception
# handling, is
, and allows the user to execute the program
multiple times
# without exiting it.
def calculate_pi(n):
try:
total, sign = 0, 1
for i in range(n):
term = 1 / (2 * i + 1)
total += term * sign
sign *= -1
total *= 4
return total
except Exception as e:
print("Exception occurred..")
return 0
choice = "yes"
while(choice=="yes"):
n = int(input("How many terms: "))
print(calculate_pi(n))
choice = input("Want to run it again (yes/no)? "
)
PB
Divide the program for Assignment 2 into two modules: 1. A class module which contains a class based on the Leibniz formula, including a constructor for use with the class, and 2. A program module which creates an instance of the class defined in the class module and uses the class attribute to perform the functionality required in Assignement 2. Be sure to correct any issues found with Assignement 2.
In: Computer Science