Questions
2.1) To the HighArray class in the highArray.java program, add a method called getMax() that returns...

2.1) To the HighArray class in the highArray.java program, add a method called getMax() that returns the value of the highest key in the array, or a -1 if the array is empty. Add some code in main() to exercise this method. You can assume all the keys are positive numbers.

2.2) Modify the method in Programming project 2.1 so that the item with the highest key is not only returned by the method but also removed from the array. Call the method removeMax().

// highArray.java

// demonstrates array class with high-level interface

// to run this program: C>java HighArrayApp

////////////////////////////////////////////////////////////////

class HighArray

{

private long[] a; // ref to array a

private int nElems; // number of data items

//-----------------------------------------------------------

public HighArray(int max) // constructor

{

a = new long[max]; // create the array

nElems = 0; // no items yet

}

//-----------------------------------------------------------

public boolean find(long searchKey)

{ // find specified value

int j;

for(j=0; j<nElems; j++) // for each element,

if(a[j] == searchKey) // found item?

break; // exit loop before end

if(j == nElems) // gone to end?

return false; // yes, can't find it

else

return true; // no, found it

} // end find()

//-----------------------------------------------------------

public void insert(long value) // put element into array

{

a[nElems] = value; // insert it

nElems++; // increment size

}

//-----------------------------------------------------------

public boolean delete(long value)

{

int j;

for(j=0; j<nElems; j++) // look for it

if( value == a[j] )

break;

if(j==nElems) // can't find it

return false;

else // found it

{

for(int k=j; k<nElems; k++) // move higher ones down

a[k] = a[k+1];

nElems--; // decrement size

return true;

}

} // end delete()

//-----------------------------------------------------------

public void display() // displays array contents

{

for(int j=0; j<nElems; j++) // for each element,

System.out.print(a[j] + " "); // display it

System.out.println("");

}

//-----------------------------------------------------------

} // end class HighArray

////////////////////////////////////////////////////////////////

class HighArrayApp

{

public static void main(String[] args)

{

int maxSize = 100; // array size

HighArray arr; // reference to array

arr = new HighArray(maxSize); // create the array

arr.insert(77); // insert 10 items

arr.insert(99);

arr.insert(44);

arr.insert(55);

arr.insert(22);

arr.insert(88);

arr.insert(11);

arr.insert(00);

arr.insert(66);

arr.insert(33);

arr.display(); // display items

int searchKey = 35; // search for item

if( arr.find(searchKey) )

System.out.println("Found " + searchKey);

else

System.out.println("Can't find " + searchKey);

arr.delete(00); // delete 3 items

arr.delete(55);

arr.delete(99);

arr.display(); // display items again

} // end main()

} // end class HighArrayApp

In: Computer Science

2. What do the IVK Corporation exhibits (1-1 through 1-6) tell you about the current state...

2. What do the IVK Corporation exhibits (1-1 through 1-6) tell you about the current state of the company? Given this information, what does IVK need from a new management team under CEO Carl William? (this is a reflection question from an adventure of an IT leader book I want the answer to be in Analytical way )

In: Computer Science

Scenario: 1) You are responsible for the design of a new order entry and sales analysis...

Scenario: 1) You are responsible for the design of a new order entry and sales analysis system for a national chain of auto part stores. 2) Each store has a PC that supports office functions. 3) The company also has regional managers who travel from store to store working with the local managers to promote sales. 4) There are four national offices for the regional managers, who each spend about 1 day a week in their office and 4 on the road. 5) Stores place orders to replenish stock daily, based on sales history and inventory levels. 6) The company uses the Internet to connect store PCs into the company’s main computer. 7) Each regional manager has a laptop computer to also connect with stores and the head office. Task: To recommend a technology architecture for supporting the business activities of the company. Should include the following: • Summary of the business and business requirements • Description of the major system’s components/document developments/tasks required during using the SDLC methodology • Identification of challenges and roadblocks that you would anticipate if implementing this project • Definition of how the systems’ analysts (you and your team) will interact with users, management, and other information systems professionals to develop this plan (i.e. questionnaires, interviews, etc.). • Summary of recommendation and justification as the best solution

In: Computer Science

You are creating a system to promote a chain of fancy restaurants around the world. Your...

You are creating a system to promote a chain of fancy restaurants around the world. Your system will use an array of dynamically allocated restaurants and should allow adding, removing and modifying restaurants. Your array will contain up to 100 restaurants.

You will create an input .txt file with 20 command of your choice that will include:

  • Adding a restaurant, by searching the first not-null cell in the array.
  • Removing a restaurant, by searching the restaurant to be removed, deallocating its memory and setting the pointer to null (nullptr)
  • Searching a restaurant (and printing its detail)
  • Modifying something on a restaurant, by searching the restaurant and calling a setter() for the modification
  • Printing your array

Your command list (the input file) should be comprehensive and should contain all relevant scenarios. For example, after you remove one or more restaurants, have a command printing your restaurants to verify that your program works as expected. One of the commands should be QUIT to quit scanning.

You can refer to the assignments of Module 1 for ideas on commands you can use in your input file.

Make sure you deallocate your array before you exit the main() function.

Refer to the rubric to ensure that you have it all covered.

Please use C++ language for this programme.

rubric: 1)input text file Complete, comprehensive and shows all scenarios

2) adding a restaurant Adds a restaurant by searching the first not-null cell in the array and dynamically allocating memory for the new object

3)removing a restaurant Removes a restaurant by searching the restaurant to be removed, deallocating its memory and setting the pointer to null (nullptr)

4) searching The search returns null if the value is not found or the pointer to the restaurant found

5) modifying  Searches the restaurant. If found, calls the related setter() to change the value of the restaurant.

6) printing  Prints the array in a formatted way

In: Computer Science

Assume that a procedure is formalized as a Turing machine that can be represented as a...

Assume that a procedure is formalized as a Turing machine that can be represented as a finite length string from a finite alphabet. Thus any string over this alphabet is a Turing machine. Is the set of all Turing machines countable? Explain. Give an effective enumeration of all Turing machines (that is, show a “procedure” that will list all Turing machines).

In: Computer Science

**PYTHON** A new movie theatre has three different subscription packages for its customers: Package A: For...

**PYTHON**

A new movie theatre has three different subscription packages for its customers:

Package A: For $18.95 per month, the customer can watch 2 movies. Any additional movie requires an additional $2 per movie.

Package B: For $22.95 per month, the customer can watch 4 movies. Any additional movie requires an additional $1 per movie.

Package C: For $30.99 per month, the customer can watch an unlimited amount of movie.

Write a script that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package purchased (A, B, or C) and the number of movies watched.

Using that information, your program should display the total bill. Your program should also display an error message and stop if the user enters any invalid values.

Would appreciate any help. Stuck on how to solve this or even get started. Thank you

In: Computer Science

What are today’s primary ways through which machine learning tasks are tackled? Explain the concept of...

What are today’s primary ways through which machine learning tasks are tackled? Explain the concept of “deep learning” and how it differs from machine learning. How are organizations using deep learning to help make business decisions? Write your responses in detail with EXAMPLES. Be sure to identify the source AND REFERENCES of your example in your posting. Your initial post should be of a minimum of 350;.

In: Computer Science

This is a java assignment Write the body of the fileAverage() method. Have it open the...

This is a java assignment Write the body of the fileAverage() method. Have it open the file specified by the parameter, read in all of the floating point numbers in the file and return their average (rounded to 1 decimal place). For the testing system to work, don't change the class name nor the method name. Furthermore, you cannot add "throws IOException" to the fileAverage() header. Additionally, the file will have different contents during testing.

public class Main { public double fileAverage( String filename ){ } public static void main( String[] args ){ Main obj = new Main(); System.out.println( obj.fileAverage( "numbers.txt") ); } }

In: Computer Science

Computing Assignment 1 You must upload both your code (to Assignment 1 scripts/codes) and your report...

Computing Assignment 1
You must upload both your code (to Assignment 1 scripts/codes) and your report (to Assignment
1 computing report). The assignment is due at 11:00pm. I have set the due time in Canvas to
11:05pm and if Canvas indicates that you submitted late, you will be given 0 on the assignment.
Your computing report must be exactly 1 page. There will be a penalty given if your report is
longer than one page.
• Please read the Guidelines for Assignments first.
• Keep in mind that Canvas discussions are open forums.
• Acknowledge any collaborations and assistance from colleagues/TAs/instructor.
Computing Assignment { Floating Point Arithmetic
Required submission: 1 page PDF document and Matlab scripts uploaded to Canvas.
1. Part 1 - warmup
Use Matlab and issue the following two commands on the command line: sin(0); sin(π). State
your answer and explain the answer you see. This should be done in one or two sentences at
the beginning of your report.
2. Part 2
Let 8 ≤ x ≤ 10 be an arbitrary number and n a nonnegative integer. In exact arithmetic, the
following computation leaves x unchanged:
1 for i=1:n

2 x=5 log(x);

3 end

4

5 for i=1:n

6 x=exp(x/5.0);

7 end

However, in finite-precision arithmetic the results may be dramatically different for large n.
The purpose of this assignment is to investigate the output of this computation in Matlab for
various values of n and for x in the range 8 ≤ x ≤ 10.
Your conclusions should be explained in a one-page report. Your report must include the
following:
(a) Representative plots of the output as a function of x, with each plot corresponding to a
different value of n.
(b) A discussion of the smallest value of n after which the result of the finite-precision
computation begins to differ from exact arithmetic computation.
1
(c) A discussion of the limiting behaviour for large n.
(d) A brief explanation as to why computing in floating point arithmetic leads to the results
you have found.
Partial code for this assignment can be found in the file FloatPt.m on Canvas. I suggest
using this as your starting point. If you have questions about Matlab or other aspects of
the assignment or course, then I strongly encourage you to attend the tutorials and drop-in
workshops.

----------------Codes given----------------------

% MACM 316 - Homework 1
% Floating Point Arithmetic with logarithm function
% Description: Performs n-fold logarithm followed by n-fold exponentiation
% File name: FloatPt_log.m

clear
%format long; %this changes the number of decimal digits that DISPLAY
n=30;
st=0.001; % Define a stepsize
x=8:st:10; % x is a row vector of numbers between 1.3 and 2.3 of increments st
y=x;

for i=1:n
    y=5*log(y);
end
%y(1) %this is how you print the 1st element of y to the screen
%y(11)
%y(101)
%y(1001)
%pause %this stops your program until you press a key
for i=1:n
    y=exp(y/5.0); 
end
%y(1)
%y(11)
%y(101)
%y(1001)
% Plot the output y versus the input x
plot(x,y) %you can change the title and axis labels in this manner
title(['Output of the Computation with n = ' num2str(n)],'fontsize',14)
xlabel(['Input x'],'fontsize',12)
ylabel(['Output y'],'fontsize',12)

In: Computer Science

Summarize two articles on IT sourcing and compare and contrast the sourcing approaches in each article....

Summarize two articles on IT sourcing and compare and contrast the sourcing approaches in each article. Identify the factors that were important in each sourcing strategy and whether the sourcing decision was strategic for the long term or tactical for the short term. Which strategy did you think was more effective and why?

In: Computer Science

We consider the dining philosophers problem. If all philosophers pick up their left fork, that causes...

We consider the dining philosophers problem. If all philosophers pick up their left fork, that causes deadlock.

Question: If one (and only one) of the philosophers instead tries to pick up their right fork first, can this system still deadlock? Why/ why not?

In: Computer Science

Question 1 Argue any SIX (6) factors that will cause the unsuccessful of Sahana software project...

Question 1

Argue any SIX (6) factors that will cause the unsuccessful of Sahana software project in offering an effective timely access to comprehensive, relevant and reliable information for humanitarian operations today.

In: Computer Science

Create a table called product containing a product number, company name, model number, product name. What...

Create a table called product containing a product number, company name, model number, product name. What is my primary key? Which datatypes should I use? Please submit a printout of the commands used for creating the above table and the results of your queries/commands.

PLEASE USE JAVA & H2DATABASE

In: Computer Science

Python Q1. def silly(stuff, more_stuff=None): data = [] for i, thing in enumerate(stuff): if thing >=...

Python
Q1.
def silly(stuff, more_stuff=None):
    data = []
    for i, thing in enumerate(stuff):
        if thing >= 0 or i < 2:
            data.append(thing + i)
    print(len(stuff))
    if more_stuff is not None:
        data += more_stuff
    print(data)

Write a Python statement that calls silly and results in the output (from within silly):

4
[5, 3, 1, 5, -3]

stuff = [5, 2, 0, 2]
more_stuff = [-3]
silly(stuff, more_stuff)

Q2.

Function silly2 is defined as:

def silly2(nums, indices, extra=None):
    print(len(nums), len(indices))

    new_indices = []
    for i in indices:
        if i >= 0 and i < len(nums):
            new_indices.append(i)

    if extra:
        new_indices.append(extra)

    try:
        for index in new_indices:
            if index < len(nums):
                print(nums[index])
    except IndexError:
        print("We're dead, Fred")

Write a single Python statement that calls silly2 and results in the output:

2 2
We're dead, Fred

In: Computer Science

The Department of Administrative Services (DAS) provides a number of services to other departments in an...

The Department of Administrative Services (DAS) provides a number of services to other departments in an Australian State Government. These services include HR and personnel management, payroll, contract tendering management, contractor management, and procurement. These services have all been provided from the Department’s own data centres.

As a result of a change in Government policy, DAS is moving to a “Shared Services” approach. This approach will mean that DAS will centralise a number of services for the whole of Government (WofG). The result of this move will be that each Department or Agency that runs one of these services for its own users, will be required to migrate its data to DAS so that it can be consolidated into one of the DAS centralised databases. DAS will then provide these consolidated services to all other Departments and Agencies within the Government.

Another Government policy mandates a “Cloud first” approach to the process of updating or acquiring software or services. Following these strategic policy changes from Government, DAS has decided to:

  • Purchase a HR and personnel management application from a US based company that provides a SaaS solution.
    • The application will provide DAS with a HR suite that will provide a complete HR suite which will also include performance management. The application provider has advised that the company’s main database is located in a Cloud datacentre based in California in the United States, with a replica database located in a cloud datacentre in Dublin, Ireland. However, all data processing, configuration, maintenance, updates and feature releases are provided from the application provider’s processing centre in Bangalore, India.
    • Employee data will be uploaded from DAS daily at 12:00 AEST. This will be initially transferred to Bangalore in India for processing before being loaded into the main provider database in California.
    • Employees will be able to access their HR and Performance Management information through a link placed on the DAS intranet. Each employee will use their internal agency digital ID to authenticate to the HR and Performance management system. The internal digital ID is generated by each agency’s Active Directory instance and is used for internal authentication and authorisation.
  • Move the DAS payroll to a COTS (Commercial Off The Shelf) application that it will manage in a public cloud;

Tasks

After your successful engagement to provide a security and privacy risk assessment for the DAS, you have again been engaged to consider some additional questions that DAS management has raised.

Prepare a presentation for DAS Management using the TRA you recently completed on the security and privacy of employee data. Your presentation is to show:

  1. Discuss how the operational solution using an SaaS application, and the location(s) of the SaaS provider for HR management may affect the security posture of DAS.
  2. Explain if either the operational solution, or the operational location(s), or both, increase or mitigate the threats and risks identified for the security and privacy of employee data?
  3. Discuss the security and privacy implications for DAS of the data processing location?
  4. Discuss any issues of data sensitivity that you think should be considered with either the chosen solution or the storage/processing locations?
  5. Discuss any issues of data sovereignty that should be considered?

Your presentation is to be completed in either PowerPoint or Google slides. Your presentation must not exceed 25 slides of content.

  • The presentation should be a maximum of 25 slides, including introduction, conclusions and recommendations.
  • Each slide should have speaking notes in the Notes section which expand on the information in the slide.
  • Images and quotations used in slides must be referenced on that slide.
  • The slide deck does require a reference list. References are to be included on a Reference list slide(s), but these are not counted as part of the slide deck limit.

Your presentation should highlight the significant points of your argument, but you should include the detail in the speaking notes section of your slides.

Rationale

back to top

This assessment task will assess the following learning outcome/s:

  • be able to examine the legal, business and privacy requirements for a cloud deployment model.
  • be able to evaluate the risk management requirements for a cloud deployment model.
  • be able to critically analyse the legal, ethical and business concerns for the security and privacy of data to be deployed to the cloud.

In: Computer Science