subject

When you are doing a Bare Bones program, feel free to use the following Bare Bones functions whenever it reduces your work:
COPY(X, Y) places the value of X into the value of Y without changing the value of X.
MOVE(X, Y) places the value of X into the value of Y and changes the value of X to 0.
It might be interesting and useful for you to try to write two Bare Bones programs that do these functions. That’s not part of this assignment, but it might be a good review for your final exam to do that. Yes, I think it would be.
A. Write a Bare Bones program that takes as input a value for X and places 4 times the valueof X into the value of Z. The value of X should be unchanged at the end of theprogram. Note that your program should NOT place a value into X to start. You mayassume that the value of X has already been set just before your program runs.
B. Write a Bare Bones program that takes as input two variables X and Y. (Again, assume these values are set before your program begins to execute.) Your program shouldplace a 0 in the variable Z if the variable X is less than or equal to Y, and yourprogram should place a 1 in the variable Z if the variable X is greater than Y.
C. Write a Bare Bones program that takes as input a variable X. (Again, you don’t set thatvalue. It’s just there when you start.) Your program should place into the variable Z thesum of all the integers from 1 to X. You may assume that X is greater than or equal to 1.
D. Here is a Bare Bones program. Using English, tell briefly what this program does. Thatis, describe the function of X and Y that this program calculates and places into Z. Besure to discuss any special cases that may occur.
copy X to Z;
copy Y to W;
while W not 0 do;
decr Z;
decr W;
end;
E. Is the following Bare Bones program self terminating? Remember carefully thedefinition of self terminating.
while X not 0 do;
end;
F. Explain why the following sentence is false: "We don’t know if the problems in NP aresolvable."
G Name a function that is both in P and in NP. (HINT: this problem is easier than you might think.)
H. Is every problem in P practical to solve on a computer? Why or why not?
I. Here are three functions of N. Assume that x^y means x raised to the yth power.
(4*N) + 1
(N^4)
(4^N)
First, tell which of those three functions is considered polynomial.
If you let N be any non-negative integer, any one of these three functions could be larger. Give a value of N for which each of these functions is larger than the others. (Be sure to label your answers clearly.) That is, give a value for N that makes the first function bigger than the other two. Then give a value for N so that the second function bigger than the other two. Finally, give a value for N so that the third function is bigger than the other two.
As N becomes larger, one of the functions begins to grow more quickly than the other two; as N becomes larger and larger, which one of the three is going to be the biggest by far? (Note: feel free to use a spreadsheet or a small program to help you find the answer to this question.)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:10
For each of the following claims, determine whether they are true or false. justify your determination (show your work). if the claim is false, state the correct asymptotic relationship as o, θ, or ω. unless otherwise specified, lg is log2.(a) (b) (c) (d) (e) (f) (g) (h) (i) (j)n+1 =22n =2n =1 =ln2 n =n2 +2n−4 =33n = 2n+1 =√n = 10100 =o(n4) o(2n)θ(2n+7 ) o(1/n)θ(lg2 n) ω(n2 )θ(9n ) θ(2n lg n )o(lg n) θ(1)
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
1. you have a small business that is divided into 3 departments: accounting, sales, and administration. these departments have the following number of devices (computers, printers, etc.): accounting-31, sales-28, and administration-13. using a class c private network, subnet the network so that each department will have their own subnet. you must show/explain how you arrived at your conclusion and also show the following: all available device addresses for each department, the broadcast address for each department, and the network address for each department. also, determine how many "wasted" (not usable) addresses resulted from your subnetting (enumerate them).
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
You know the right answer?
When you are doing a Bare Bones program, feel free to use the following Bare Bones functions wheneve...
Questions
question
Law, 10.02.2021 01:00
question
Mathematics, 10.02.2021 01:00
question
Chemistry, 10.02.2021 01:00
question
Mathematics, 10.02.2021 01:00
question
Chemistry, 10.02.2021 01:00
Questions on the website: 13722367