Questions
##### answer in python #####picture of output and input Create customer information system as follows: Ask...

##### answer in python

#####picture of output and input

  1. Create customer information system as follows:

Ask the user to enter name, phonenumber, email for each customer. Build a dictionary of dictionaries to hold 10 customers with each customer having a unique customer id. (random number generated)

  1. Take the keys of the above mentioned dictionary which are customer ids and make a list. Ask the use to enter a customer id and do a binary search to find if the customer exist in the list.
  2. Sort the above mentioned list by insertion sort. (Write insertion sort code)

In: Computer Science

Is quicksort a stable sorting algorithm? If yes, prove it, if not, give an example

Is quicksort a stable sorting algorithm? If yes, prove it, if not, give an example

In: Computer Science

13. (10 pts) The address space of a process is the set of addresses to which...

13. (10 pts) The address space of a process is the set of addresses to which it has access.

(a) In modern systems, the address spaces of most processes are sparse. What does this mean?

(b) Referencing an address not in the address space results in a:

(c) Referencing a valid address that is not currently in main memory results in a:

(d) Referencing a valid address but without proper permissions (e.g., writing to a read-only location) results in a:

(e) Referencing a kernel address while executing in user mode results in a:

In: Computer Science

Include<stdio.h> Write a program that prompts the user to input the elapsed time for an event...

Include<stdio.h>

Write a program that prompts the user to input the elapsed time for an event in seconds.

The program then outputs the elapsed time in hours, minutes, and seconds.

For example:

Enter the elapsed time in second: 9630

The elapsed time in seconds = 9630

The equivalent time in hours:minutes:seconds = 02:40:30

In: Computer Science

Summarize the challenges of key management.

Summarize the challenges of key management.

In: Computer Science

For each of the following six program fragments give an analysis of the running time (Big-Oh...

For each of the following six program fragments give an analysis of the running time (Big-Oh will do). (25,very 5 mark)

(a)sum = 0;
for( i=0; i<n; i++ )
for( j=0; j<n; j++ )
sum++;
(b)
sum = 0;
for( i=0; i<n; i++ )
for( j=0; j<n*n; j++ )
sum++;

(c)
sum = 0;
for( i=0; i<n; i++ )
for( j=0; j<i; j++ )
sum++;
(d)
sum =0;
for( i=1; i<n; i++ )
for( j=1; j<i*i; j++ )
if( j%1 == 0 )
for( k=0; k<j; k++ )
sum++;

In: Computer Science

1.Briefly describe the traditional connection process for getting and displaying an HTML page. 2.Which of these...

1.Briefly describe the traditional connection process for getting and displaying an HTML page.

2.Which of these statements is most correct?(please give some reasons)

a) Browsers create a link with the server for displaying images

b) Browser provides an environment for displaying HTML and running JS

c) Browsers allow a page to have style and layout

d) Browsers provide an environment for running JS and displaying CSS

3. HTML uses ________ to create areas that obey display criteria and can further define that    behaviour through ________(please give some reasons)

a) Elements / Attributes

b) CSS / JavaScript

c) Elements / JavaScript

d) Attributes / CSS

4.HTML contains two major sections in HEAD and BODY. Briefly describe the purpose of each section and give an example of a tag you would expect to find in each.

5.Within the provided body tags replicate the provided text with the necessary HTML to mimic the visual appearance. Your HTML should follow strict tag guidelines

Formatting in HTML

• Sometimes in HTML you need to use bold text

• Sometimes in HTML you need to use italic text

• Sometimes in HTML you need to use both

6.The div and span tags are the two primary element tags for sectioning an HTML document. What is the primary difference between the two attributes?

In: Computer Science

Use rules of inference to show that the hypotheses “Every student in Computer science major needs...

Use rules of inference to show that the hypotheses “Every student in Computer science major needs to take CSCI2000,” “Every student who takes CSCI2000 knows how to program in JAVA” imply the conclusion “Every student in Computer science major knows how to program in JAVA.”

In: Computer Science

Write a C program to implement a queue (FIFO) of characters in a one-way, circular, linked...

Write a C program to implement a queue (FIFO) of characters in a one-way, circular, linked list. One way means that each node has only one pointer, Q, (not both a rear and a front pointer), so the program must use pointers-to-pointers. Include functions to insert(), remove(), for use in main() where the user is prompted "Enter "i" to insert a new element, "r" to remove an element, "q" to quit:"

In: Computer Science

C++ Hello .I need to convert this code into template and then test the template with...

C++

Hello .I need to convert this code into template and then test the template with dynamic array of strings also if you can help me move the function out of the class that would be great.also There is a bug where the memory was being freed without using new operator. I cant seem to find it thanks in advance

#include
using namespace std;

class DynamicStringArray
{
   private:
       string *dynamicArray;
       int size;
   public:
       DynamicStringArray(DynamicStringArray &A)
       {
           dynamicArray=A.dynamicArray;
           size=A.size;
       }
       ~DynamicStringArray()
       {
           delete []dynamicArray;
       }
       DynamicStringArray &operator =(DynamicStringArray &A)
       {
           dynamicArray=new string[A.size];
           for(int i=0; i            {
               dynamicArray[i]=A.getEntry(i);
           }
       }
       DynamicStringArray()
           {
               dynamicArray=NULL;
               size=0;
           }
       void addEntry(string input)
       {
           string *temp=new string[size+1];
           for(int i=0; i            {
               temp[i]=dynamicArray[i];
           }
           temp[size]=input;
           size++;
           delete []dynamicArray;
           dynamicArray=temp;
          
       }
       bool deleteEntry(string input)
       {
           bool found=false;
           for(int i=0; i            {
               if(dynamicArray[i]==input)
               {
                   found=true;
                   break;
               }
           }
           if(!found)
           {
               return false;
           }
           else
           {
           string *temp=new string[size-1];
           int j=0;
           for(int i=0; i            {
               if(dynamicArray[i]!=input)
               {
                   temp[j]=dynamicArray[i];
                   j++;
               }
           }
           size--;
           delete []dynamicArray;
           dynamicArray=temp;
           }
       }
       string getEntry(int index)
       {
           if(index<0 || index>=size)
           {
               cout<<"Index out of range"<                return "";
           }
           return dynamicArray[index];
       }
       int getSize()
       {
           return size;
       }
      
  
};
int main()
{
DynamicStringArray names;

// List of names
names.addEntry("Frank");
names.addEntry("Wiggum");
names.addEntry("Nahasapeemapetilon");
names.addEntry("Quimby");
names.addEntry("Flanders");
// Output list
cout << "List of names:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

// Add and remove some names
names.addEntry("Spuckler");
cout << "After adding a name:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

names.deleteEntry("Nahasapeemapetilon");
cout << "After removing a name:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

names.deleteEntry("Skinner");
cout << "After removing a name that isn't on the list:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

names.addEntry("Muntz");
cout << "After adding another name:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

// Remove all of the names by repeatedly deleting the last one
while (names.getSize() > 0) {
names.deleteEntry(names.getEntry(names.getSize() - 1));
}

cout << "After removing all of the names:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

names.addEntry("Olivia");
cout << "After adding a name:" << endl;
for (int i = 0; i < names.getSize(); i++)
cout << names.getEntry(i) << endl;
cout << endl;

cout << "Testing copy constructor" << endl;
DynamicStringArray names2(names);
// Remove Olivia from names
names.deleteEntry("Olivia");
cout << "Copied names:" << endl;
for (int i = 0; i < names2.getSize(); i++)
cout << names2.getEntry(i) << endl;
cout << endl;

cout << "Testing assignment" << endl;
DynamicStringArray names3 = names2;
// Remove Olivia from names2
names2.deleteEntry("Olivia");
cout << "Copied names:" << endl;
for (int i = 0; i < names3.getSize(); i++)
cout << names3.getEntry(i) << endl;
cout << endl;

cout << "Enter a character to exit." << endl;
char wait;
cin >> wait;
return 0;
}

In: Computer Science

PROBLEM In the Hotel management domain, we have the following concepts: Hotel Hotel chain Hotel room  ...

PROBLEM

In the Hotel management domain, we have the following concepts:
Hotel Hotel chain Hotel room      
Reservation Hilton Hilton San Diego Bayfront
Meeting room Ballroom Guest Room
Catering Service Internet Service       TV Service
Guest Parking Service       Item on bill      

You are asked to design a model, using a UML class diagram to relate the abovementioned concepts:

Correctly use UML notations for relations such as generalization, association, aggregation, composition. Be careful to distinguish objects from classes.


You may introduce additional concepts into the picture to make your model more appropriate.
For each Class in your diagram, you should define at least one attribute and one operation.


Use multiplicity whenever appropriate.


Note that if you are not sure about a concept, you should do research on the problem domain.

In: Computer Science

Design a class that holds the following data regarding a music album: artist, title, number of...

Design a class that holds the following data regarding a music album: artist, title, number of tracks, and year released. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. Each instance will hold information about a different music album. Make sure to display all of the information for all three albums to the screen in an organized manner.

**Using python**

In: Computer Science

Suppose that you have a program that can read through all posts within a given time...

  1. Suppose that you have a program that can read through all posts within a given time period (e.g. the last 7 days) on a social network web site (e.g., Facebook), and generate a list of pairs (ui, pi) representing texts in all posts found, where i=1, 2, ..., and ui and pi represent the author username and the text content of the i-th post found, respectively. Describe an algorithm that outputs the list of usernames in the decreasing order of their total numbers of words posted among the posts described above. Analyze the running time of your algorithm. You may assume that the input of your algorithm is two arrays U and P that store the pairs (ui, pi) as defined above.

Please answer differently than solution already on chegg, I would like explanations to steps. Thank you.

In: Computer Science

Using python coding, test for convergence of an infinite sequence or series. keep the coding at...

Using python coding, test for convergence of an infinite sequence or series.

keep the coding at beginner level please!

In: Computer Science

(Subject: Data Structures and Algorithms) Faster merging. You are given two sorted sequences of $\lg{n}$ and...

(Subject: Data Structures and Algorithms)

Faster merging.

You are given two sorted sequences of $\lg{n}$ and $n-1$ keys. We would like to merge those two sorted sequences by performing $o(n)$ comparisons.

(Note we are interested in comparisons, not running time.) Show how this can be done or argue that it cannot be done.

Note: In class we showed that ordinary merging would require no more than $\lg{n}+n-1+1= n + \lg{n}$ comparisons.

In: Computer Science