Questions
Compare and contrast between the implementation of the security pillars on the IT cloud computing environment...

Compare and contrast between the implementation of the security pillars on the IT cloud computing environment Vs. the IT data center environment?

In: Computer Science

how do you write a bubble sort function in python that sorts a linked list and...

how do you write a bubble sort function in python that sorts a linked list and if any duplicate are placed bext ti each other?

In: Computer Science

Do Programming Exercise 1 (Day of the Week) – Page 151 Output should look like this.....

Do Programming Exercise 1 (Day of the Week) – Page 151 Output should look like this.. >>> =RESTART: C:/Users/gamada/AppData/Local/Programs/python/python36/week/py= what is your name? gamada Enter a number (1-7) for the day of the week: 3 you selected 3 which is wednesday

In: Computer Science

Your manager asked you to generate a Fibonacci sequence to be used in a data analysis...

Your manager asked you to generate a Fibonacci sequence to be used in a data analysis project. The Fibonacci sequence is a series of numbers in which the next number is found by adding up the two numbers before it (e.g., 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...).

Write a C++ program to generate a Fibonacci sequence of the first 20 numbers.

In: Computer Science

Write a code that takes the initial velocity and angle as an input and outputs the...

Write a code that takes the initial velocity and angle as an input and outputs the maximum height of the projectile and its air time.

Follow the pseudo code below. This will not be provided in as much detail in the future so you’ll have to provide pseudocode or a flowchart to showcase your logic. For this first assignment though, the logic is laid out below with some indented more detailed instructions.

PROGRAM Trajectory:
Establish the User Interface (Typically referred to as the UI);

INPUT INPUT

Solve
Solve
Print

Start with an explanation of activity

Ask the user for the initial velocity;

Ask the user for the initial angle;

Include descriptive requests for inputs so the user knows what information is required.

for the maximum height the ball reaches;

for the length of time the ball is in the air;

the answers for the user;

Include a description with that return so the user understands what the data is

Plot height versus time; Plot height versus distance;

Do not overwrite your previous figure! This is a new plot but you still want the old one.

Make it clear what the plots are. Label the plot axes with units, include a title, and use a marker for the plot points.

END

In: Computer Science

true or false C++ a.    (T or F)   A function or method cannot return a value of type...

true or false C++

a.    (T or F)   A function or method cannot return a value of type array.

b.    (T or F)   C++ throws an exception if you try to refer to element 47 in an array with 20 elements.

c.    (T or F)   I can copy one array to another by simply using an assignment statement which assigns the one array to the other.

d.    (T or F)  An exception is the occurrence of an erroneous or unexpected situation during the execution of a program.

e.    (T or F)  The try / catch structure is used to test for and catch occurrences of syntax errors.

In: Computer Science

In C Program The first 11 prime integers are 2, 3, 5, 7, 11, 13, 17,...

In C Program

The first 11 prime integers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31.

A positive integer between 1 and 1000 (inclusive), other than the first 11 prime integers, is prime if it is not divisible by 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31.

Write a program that prompts the user to enter a positive integer between 1 and 1000 (inclusive) and that outputs whether the number is prime.

If the number is not prime, then output all the numbers, from the list of the first 11 prime integers, which divide the number.

Example (Numbers with underscore indicate an input):

Enter an integer between 1 and 1000 (inclusive): 62
62 is divisible by 2, 31.
62 is not prime.

--------------------------------------------

Enter an integer between 1 and 1000 (inclusive): -1
You must enter a number between 1 and 1000 (inclusive).

--------------------------------------------

Enter an integer between 1 and 1000 (inclusive): 1206
You must enter a number between 1 and 1000 (inclusive).

In: Computer Science

java Goal: This lab will give you practice writing code that uses inheritance and Java interfaces....

java

Goal: This lab will give you practice writing code that uses inheritance and
Java interfaces.
Please make sure you have a partner for this lab.
No code is provided with this lab. Write code to experimentally resolve the
following questions about Java. You will need to show your code to the TA or
lab assistant.
Part I: Assignments and Casting (1 point)
------------------------------------------
Let Y be a subclass of X, and let y and x be variables of classes Y and X
respectively. From lecture, you know that the assignment "x = y" is valid, but
the assignment "y = (Y) x" requires a cast to compile, and will cause a
run-time error if x references an object that isn’t a Y.
What about arrays of objects? Suppose xa is an array of X’s, and ya is an
array of Y’s.
(a) At compile-time, can we assign xa to ya, and vice versa? When is a cast
required?
(b) At run-time, if ya references an array of Y’s, can we assign it to xa?
Can we then assign it back from xa to ya?
(c) If xa references an array of X’s (that are not Y’s), can we assign it to
ya? Can we then assign it back from ya to xa? Does it make a difference
if the array of type X[] references objects that are all of class Y? Why
do you think this is the case?
Part II: Conflicting Declarations (1 point)
--------------------------------------------
Suppose a subclass inherits a method implementation from a superclass, and
implements a Java interface (that’s the "interface" keyword) that contains
a method with the same name and prototype.
(a) Will Java compile the result?
(b) What if the method declaration in the interface has a different return
type?
(c) What if the method declaration in the interface has the same return type,
but a signature with a different parameter type?
(d) What if the method declaration in the interface has the same return type,
and the same number of parameters and parameter types, but those
parameters have different names?
Part III: More Conflicting Declarations (1 point)
--------------------------------------------------
Suppose a subclass inherits a "public static final" constant from a superclass,
and implements a Java interface that contains a "public static final" constant
with the same name.
(a) Will Java compile the result? Does it make any difference whether the
constant in the superclass and the constant in the interface have the
same value?
(b) Write a main() method in the subclass that accesses the constant using the
same name used in the superclass and the Java interface. Will Java
compile the result? Does it make any difference whether the constant in
the superclass and the constant in the interface have the same value?
(c) Figure out how to modify your main() method so that it accesses and prints
one of the two conflicting values. (Look to the Lecture 9 notes for
clues.) Make sure your code compiles and runs without errors.
Part IV: Method Overriding (1 point)
-------------------------------------
Consider a subclass that has a method that overrides a method with the same
prototype in its superclass.
(a) Define a variable whose static type is the subclass and which references
an object of the subclass. If we cast the variable to the superclass type
before calling the overridden method
((Superclass) subclassvariable).method();
does Java call the superclass method or the subclass method?
(b) Define a variable whose static type is the superclass and which references
an object of the superclass (but not the subclass). If we cast the
variable to the subclass type before calling the method, does Java call
the superclass method or the subclass method?
(c) Suppose you have an object whose class is the subclass. Can you figure
out a way to call the superclass method on that object without having to
go through the subclass method of the same name?
Check-off
---------
Show your TA or Lab Assistant your code and, in some cases, its output.
1 point: Give your answers for Part I. Show the code with which you answered
Part I (c).
1 point: Give your answers for Part II.
1 point: Give your answers for Part III. Show _and_run_ the code with which
you answered Part III (c).
1 point: Give your answers for Part IV. Show the code with which you
answered Part IV (c).
Because this lab is on the long side, students who complete the first three
parts but don’t have time to complete the fourth part will get 4 points if they
promise to figure out the last part later.

In: Computer Science

Problem 2: There are no data errors that need to be checked as all the data...

  • Problem 2:

  • There are no data errors that need to be checked as all the data will be assumed correct.

  • You can use the array of the previous example to test your program, however, I

suggest that you also use other input arrays to validate the correctness and efficiency of your solution.

• Your program MUST be submitted only in source code form (.java file).

Write a program in Java to implement a recursive search functionint terSearch(int A[], int l, int r, int x)

that returns the location of x in a given sorted array of n integers A if x is present, otherwise -1.

The terSearch search function, unlike the binary search, must consider two dividing points

int d1 = l + (r - l)/3

int d2 = d1 + (r - l)/3

For the first call of your recursive search function terSearch you must consider l = 0 and r = A.length - 1.

Important Notes:

• For this problem you must add the main method in your program in order to test your implementation.

  • There are no data errors that need to be checked as all the data will be assumed correct.

  • Your program MUST be submitted only in source code form (.java file).

• A program that does not compile or does not run loses all correctness points.

In: Computer Science

2. Implement a drawing card game:using python 2.1 Build a class Card() that contains 2 variables:...

2. Implement a drawing card game:using python
2.1 Build a class Card() that contains 2 variables: rank and suits (10 points)

2.2 Build a Deck that contains 52 cards with ranks and suits. (20 points)
2.3 Two players will take turn to draw two cards from a shuffle decks. (30 points)
 You must implement a function call playerTurn(deck) to handle a player turn.
 playerTurn(deck) should include these features:


2.3.1 Draw 2 cards from the Deck created in 2.2
 2.3.2 Display ranks and suits of these cards


2.3.3 Return the sum of ranks of these cards. Notice that: ‘J’ = 11, ‘Q’ = 12, ‘K’ = 13, and ‘A’ = 1

2.4 The sum results will be compared between 2 players and who gets the larger in total will win that round. Notice that the game needs to keep track total number of player’s win round. (10 points)

2.5 Players have option to repeat as many times as they want. If the users choose ‘Y’, they will continue to draw from the original deck. (The deck will not be shuffled or added during the whole game. In other word, a card cannot be drawn twice during a game). (10 points)

In: Computer Science

Convert decimal 3,712 and 4,132 to both BCD and ASCII codes. For ASCII, an even parity...

Convert decimal 3,712 and 4,132 to both BCD and ASCII codes. For ASCII, an even parity bit is to be apppended at the left.

In: Computer Science

Problem: Given seven 8-mers as listed below ATCGATAG GGCCAATT CGATATCG AAGCAAGC AGCGTACG CCGCATTA ATCCATCG 1) Create...

Problem: Given seven 8-mers as listed below

ATCGATAG

GGCCAATT

CGATATCG

AAGCAAGC

AGCGTACG

CCGCATTA

ATCCATCG

1) Create the profile matrix; 2) Derive the consensus; 3) Calculate the consensus score; 4) Calculate the total distance between the 8-mers and the consensus.

In: Computer Science

Your company has asked you to develop a report detailing payroll information with the following format:...

Your company has asked you to develop a report detailing payroll information with the following format:

Acme Corporation

Number of Employees: 3
Average Salary: 70,530.70
Annual Total: 211,592.09

Name Rank Salary
Gator, Allie A2 48,000.00
Mander, Sally A1 61,123.89
Zah, Pete A1 102,468.20

Develop an Employee class that contains first name, last name, rank, and salary. The class should have the following methods:

parameterized constructor
getters necessary for printing the report
formatName() method that returns a String with the name in the format last, first

Employee information is stored in a sequential text file named employees.txt. The file has the format:

employees.txt file: text file with the following fields separated by spaces:
Fields Description
First Name string
Last Name string
Rank string
Salary double
Note: Names will not contain spaces.

Write a program named Prog5 that reads employee information from the file and places a corresponding Employee object into an array. After the file has been read, print the report shown above using proper formatting.

Challenge

For those who would like a challenge to increase the difficulty of the assignment, implement the following static methods to be used to print the average salary and annual total, both of which receive an array of doubles and the number of elements in the array:

averageSalary( Employee arr[], int numreturns the average salary of employees in the array
totalSalary( Employee arr[], int num ) returns the sum of all salaries of employees in the array

Note: This is not required and should not be attempted until you have the basic assignment completed.


Requirements

• Your source code should follow the Java programming standards for the course.
• Your source code should be documented using Javadoc style according to the course standards.
• Use the default package in your project; do not specify a package in your code.
• Use any file and class names specified in the assignment.

In: Computer Science

Using the following list and a “for” loop, display differences of all consecutive pairs of numbers...

Using the following list and a “for” loop, display differences of all consecutive pairs of numbers in the list. our_list = [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12] The output should look like this: 1 3 1 … 4.

Using a “while loop” ask the user for a number and add it to a list if number is even and to a different list if number is odd. Keep asking the user for a number until he says “I’m bored” and doesn't want to give you any more numbers.

5. For the following list, print each element in the list an it’s type. list5 = ['a','b',1,2,[1,2,3,4],'hello',(4,5,6),7,True,"False",2.3]

In: Computer Science

In Matlab , Write a script that will print a side-ways triangle pattern of stars in...

In Matlab , Write a script that will print a side-ways triangle pattern of stars in

the command window. The script should ask the user how many stars will be

between the center of the triangle at the base and the tip of the

triangle

In: Computer Science