Questions
The use of list or any other data type not allowed only string and string methods...

The use of list or any other data type not allowed only string and string methods .Hint: Depending on how you plan to solve this problem, accumulator variable initialized as an empty string may help in this question. Write a function called weaveop, that takes a single string parameter (s) and returns a string. This function considers every pair of consecutive characters in s. It returns a string with the letters o and p inserted between every pair of consecutive characters of s, as follows. If the first character in the pair is uppercase, it inserts an uppercase O. If however, it is lowercase, it inserts the lowercase o. If the second character is uppercase, it inserts an uppercase P. If however, it is lowercase, it inserts the lowercase p. If at least one of the character is not a letter in the alphabet, it does not insert anything between that pair. Finally, if s has one or less characters, the function returns the same string as s. Do dir(str) and check out methods isalpha (by typing help(str.isalpha) in Python shell), and isupper

>>> weaveop("aa") 'aopa'

>>> weaveop("aB") 'aoPB'

>>> weaveop("ooo") 'oopoopo'

>>> weaveop("ax1") 'aopx1'

>>> weaveop("abcdef22") 'aopbopcopdopeopf22'

>>> weaveop("abcdef22x") 'aopbopcopdopeopf22x'

>>> weaveop("aBCdef22x") 'aoPBOPCOpdopeopf22x'

>>> weaveop("x") 'x'

>>> weaveop("123456") '123456'

In: Computer Science

Computer dynamics is a microcomputer software development company that has a 300-computer network. The company is...

Computer dynamics is a microcomputer software development company that has a 300-computer network. The company is located in three adjacent five-story buildings in an office park with about 100 computers in each building. The LANs in each building are similar, but one building has the data center in the second floor. There are no other office locations. Please refer to the network architecture components in Figure 6-1 of the textbook, and identify the key network architecture components in the design of the enterprise network. Refer to Chapter 6 and discuss how you would go about designing the physical network. You may assume that the campus does not need WAN connectivity.

Dear All,

This week; you are going to Design a "Real World" scenario Network as specified above.

Please start with a blue print design using "Visio" software Try first to think about the "Hardware-Devices" such as Wired Switches, Routers, Cables and Wireless Access Points, Wireless Repeaters (Extenders). See and estimate the number of users for your network, and put no more than 15 users/Access points for the Wireless connection, and select the wired switches to have X number of ports so that the over-ll wired users would be efficiently covered.

In: Computer Science

An array has an index of [5] at the starting address of 200. It has 3...

  1. An array has an index of [5] at the starting address of 200. It has 3 words per memory cell, determine loc[3],loc[4] and NE. (3 Marks: 1 mark for each)

  1. A 2-D array defined as A[10 , 5] requires 4 words of storage space for each element. Calculate the address of A[4,3] given the base address as 250
  • If the array is stored in Row-major form
  • If the array is stored in Column-major form

  1. Write a method for the following using the data structure Linked List.

void append(Node list1, Node list2)

       If the list1 is {22, 33, 44, 55} and list2 is {66, 77, 88, 99} then append(list1, list2) will change list1 to {22, 33, 44, 55, 66, 77, 88, 99}.   (5 Marks: 1mark for each correct step)

  1. Write a method for the following using the data structure Linked List.

int sum(Node list)

     If the list is {25, 45, 65, 85} then sum(list) will return 220.    (5 Marks: 1mark for each correct step)

                                                          

  1. Trace the following code showing the contents of the Linked List L after each call

      L.add(50);

      L.add(60);

      L.addFirst(10);

      L.addLast(100);

      L.set(1, 20);

      L.remove(1);

      L.remove(2);

      L.removeFirst();

      L.removeLast();    (10 Marks: 1 mark for each correct answer)

      L.addFirst(10);

  1. Compare and contrast the following data structures.

Array and Linked List

In: Computer Science

Please complete it in C++ Part 2: Queue Create a New Project and give your project...

Please complete it in C++

Part 2: Queue

  1. Create a New Project and give your project a name, say Lab6b.

  1. Download the given source files StackArr.h, StackArr.cpp, QueueArr.h and QueueArr.cpp from Canvas and save them to your Lab6b folder. Also import them to your project.

  1. Add a source file to your project, called QueueMain.cpp and implement your program according to the following:
    1. prompt the user to input a string;
    2. change each uppercase letter to lowercase;
    3. place each letter both in a queue and onto a stack;
    4. verify whether the input string is a palindrome (i.e. a set of letters or numbers that is the same whether read from left to right or right to left).

The following shows a number of program's sample input / output sessions.

Input a string: aibohphobia

aibohphobia is a palindrome

Input a string: level

level is a palindrome

Input a string: desmond

desmond is not a palindrome

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////StackArr.h

#ifndef STACKARR_H
#define STACKARR_H

class StackArr {
private:
   int maxTop;
   int stackTop;
   char *values;

public:
   StackArr(int);
   ~StackArr();
   bool isEmpty() const;
   bool isFull() const;
   char top() const;
   void push(const char& x);
   char pop();
   void displayStack() const;
};

#endif
#pragma once
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////StackArr.cpp

#include "StackArr.h"
#include <string>
#include <iostream>

using namespace std;

StackArr::StackArr(int size) {
   maxTop = size;
   values = new char[size];
   stackTop = -1;
}

StackArr::~StackArr() {
   delete[] values;
}

bool StackArr::isEmpty() const {


   return stackTop == -1;
}

bool StackArr::isFull() const {
   return stackTop == maxTop;
}

void StackArr::push(const char& x) {
   if (isFull())
       cout << "Error! The stack is full!" << endl;
   else
       values[++stackTop] = x;
}

char StackArr::pop() {
   if (isEmpty()) {
       cout << "Error! The stack is empty!" << endl;
       return -1;
   }
   else
       return values[stackTop--];
}

char StackArr::top() const {
   if (isEmpty()) {
       cout << "Error! The stack is empty!" << endl;
       return -1;
   }
   else
       return values[stackTop];
}

void StackArr::displayStack() const {
   cout << "Top -->";
   for (int i = stackTop; i >= 0; i--)
       cout << "\t|\t" << values[i] << "\t|" << endl;
   cout << "\t|---------------|" << endl << endl;
  
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////QueueArr.h

#ifndef QUEUEARR_H
#define QUEUEARR_H

class QueueArr {

private:
   int front;
   int back;
   int counter;
   int maxSize;
   char* values;

public:
   QueueArr(int);
   ~QueueArr();

   bool isEmpty() const;
   bool isFull() const;
   bool enqueue(char x);
   char dequeue();
   void displayQueue() const;
};

#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////QueueArr.cpp

#include "QueueArr.h"
#include <string>
#include <iostream>

using namespace std;

QueueArr::QueueArr(int size) {

   values = new char[size];
   maxSize = size;
   front = 0;
   back = -1;
   counter = 0;
}

QueueArr::~QueueArr() {
   delete[] values;
}

bool QueueArr::isEmpty() const {
  
   if (counter)
       return false;
   else
       return true;
}

bool QueueArr::isFull() const {
   if (counter < maxSize)
       return false;
   else
       return true;
}

bool QueueArr::enqueue(char x) {
   if (isFull()) {
       cout << "Error! The queue is full." << endl;
       return false;
   }
   else {
       back = (back + 1) % maxSize;
       values[back] = x;
       counter++;
       return true;
   }
}

char QueueArr::dequeue() {
   char x = -1;
   if (isEmpty()) {
       cout << "Error! The queue is empty." << endl;
       return -1;
   }
   else {
       x = values[front];
       front = (front + 1) % maxSize;
       counter--;
       return x;
   }
}

void QueueArr::displayQueue() const {
   cout << "Front -->";
   for (int i = 0; i < counter; i++) {
       if (i == 0)
           cout << "\t";
       else
           cout << "\t\t";
       cout << values[(front + i) % maxSize];
       if (i != counter - 1)
           cout << endl;
       else
           cout << "\t<--Back" << endl;
   }
   cout << endl;
}

In: Computer Science

C++ Question Create two circular linked lists and find their maximum numbers. Merge the two circular...

C++ Question

Create two circular linked lists and find their maximum numbers. Merge the two circular linked lists such that the maximum number of 2nd circular linked list immediately follows the maximum number of the 1st circular linked list.

Input:

12 -> 28 -> 18 -> 25 -> 19-> NULL

5 -> 24 -> 12 -> 6 -> 15-> NULL

Output:

28 -> 24-> 25 -> 15 -> 19 -> 15->5-> 18 -> 25 -> 19->NULL

Note:- Code should work on MS-Visual studio 2017 and provide output along with code

In: Computer Science

Apply following to header and footer sections of page: center text background color rgb(254,198,179) padding should...

Apply following to header and footer sections of page:

center text

background color rgb(254,198,179)

padding should be 20px

In: Computer Science

Describe/define/explain a. The relationship between Java's Iterable and Iterator interfaces b. An inner class c. An...

Describe/define/explain
a. The relationship between Java's Iterable and Iterator interfaces
b. An inner class
c. An anonymous inner class
d. The functionality of an Iterator remove method

In: Computer Science

Assignment details What did you find the most challenging and how did you overcome that challenge?...

Assignment details

  1. What did you find the most challenging and how did you overcome that challenge?
  2. What did you find the most interesting and how can you use what you learned in your degree program and future career

In: Computer Science

True False The enqueue and dequeue operations in a priority queue take O(lg n) time, while...

True False

The enqueue and dequeue operations in a priority queue take O(lg n) time, while linked list and array implementations take O(1) time.

A binary heap is a (nearly) complete binary tree.

Heaps usually use a linked node structure for implementation.

When implementing heaps as arrays, you can leave a blank space at the front. If you do, the parent of a node at index i can be found at index floor(i/2).

When implementing heaps as arrays, if you don't leave a space at the front, you can find the children of the node at index i at 2i and 2i+1.

The heap order property states that each node must contain a value greater than its left child and less than its right child.

Insertion in a heap is done by adding at the end of the array and "percolating up".

The average case for insertion in a heap is O(lg n). The worst case is O(n).

Deletion in a heap requires removing the root item and shifting all other items over one space.

Building a heap by adding values one at a time is an O(n) operation. Building a heap "all at once" with the heapify() method (called buildHeap() in the textbook) is O(n lg n).

In: Computer Science

I need to implement a code in python to guess a random number. The number must...

I need to implement a code in python to guess a random number. The number
must be an integer between 1 and 50 inclusive, using the module random function randint. The user will have four options to guess the number. For each one of the failed attempts, the program
it should let the user know whether is with a lower or higher number and how many tries they have left. If the user guess the number, the program must congratulate the user and tell him how much he won. If you are a user, hit on the 1st attempt
He wins first $ 100, on the second $ 75, on the third $ 50, on the fourth $ 25. If the user misses all four opportunities, the program must inform the user that he owes money  $ 60 and what was the number that the computer generates randomly.

In: Computer Science

Explain the diagram of Computer System which includes (Hardware, OS, application program and users).

Explain the diagram of Computer System which includes (Hardware, OS, application program and users).

In: Computer Science

create an array with a bunch of animal

create an array with a bunch of animal

In: Computer Science

The five major activities of an operating system in regard to process management are?

The five major activities of an operating system in regard to process management are?

In: Computer Science

You have decided to enter a South African Innovative App Competition. The competition requires you (and...

You have decided to enter a South African Innovative App Competition. The competition requires you (and your team) to think of an innovative idea that could lead to the development of an App aimed at assisting and benefiting South African citizens in government services

Some fundamental assumptions and project requirements:
• Preferably, the system approach/project information system approach is to be followed;
• Budget is limited to R500 000;
• A minimum of five team members must be involved in the running of the project from start
to finish. You are expected to conduct your own research regarding the product, project
team selection and developing a project schedule and management;
• Project duration must not exceed 10 months;
• Additional assumptions and requirements must be adequately added.

This question may be completed using any suitable application software, including Microsoft Word.

Create a Project Activity List for your chosen project using the following format. The Activity List should include but is not limited to the following information:

Task | Task Name | Duration | Start Time | Finish Time | Predecessors | Budget Number

The solution should include the following tasks:
 An activity list of no less than 40 activities for the chosen project;
 Identify all activities:
o Number each task;
o Name each task;
o Provide the duration of each task;
o Schedule, and sequence project accordingly;
 Use phases, summary tasks, deliverables, and work packages;
 Use at least (minimum) of four team members as resources;
 Use at least (minimum) of six milestones;
 Estimate the cost of each task;
 Project summary;
 Show the total cost (budget) of the project.

PROJECT ACTIVITY LIST
Activity list +/‐ 40 activities for the chosen project; Duration of each of the identified activities;
Scheduling (including resources) of each of the identified activities;
Sequencing (including numbering, predecessors, etc.) of each of the identified activities;
Use phases, summary tasks and deliverables;
Use at least (minimum) of four (4) team members;
Use at least (minimum) of six (6) milestones;
Budget of the project

In: Computer Science

def main(): phrase = input('Enter a phrase: ') # take a phrase from user acronym =...

def main():
phrase = input('Enter a phrase: ') # take a phrase from user
acronym = '' # initialize empty acronym
for word in phrase.split(): # for each word in phrase
acronym += word[0].upper() # add uppercase version of first letter to acronym
print('Acronym for ' + phrase + ' is ' + acronym) # print results

main()

The program should then open the input file, treat whatever is on each line as a phrase and make its acronym using the function you wrote. It should print the acronyms, one per line to the output file. Assume that the input file will be already present in your default Python folder. The output file will be expected to get saved to the same folder. See below for an example input file input.txt and its corresponding output file output.txt that the program should generate.

Input: personal computer

Output:PC

In: Computer Science