Questions
to be written in c++ only Objectives  To be able to solve problem using branch...

to be written in c++ only

Objectives
 To be able to solve problem using branch an bound strategy
 To be able to find the minimized cost
 To practice writing solutions to problems in a clear and succinct way
Problem
Let there be N workers and N jobs. Any worker can be assigned to perform any job, incurring
some cost that may vary depending on the work-job assignment. It is required to perform all jobs
by assigning exactly one worker to each job and exactly one job to each agent in such a way that
the total cost of the assignment is minimized. Write a program using branch and bound strategy to
show who will be assigned which job and the total cost incurred.

In: Computer Science

: In the context of state diagrams in system design, describe what is an event, state,...

: In the context of state diagrams in system design, describe what is an event, state, transition and conditions?

In: Computer Science

Describe an algorithm that could be used to solve the Tee Puzzle. In this puzzle, the...

Describe an algorithm that could be used to solve the Tee Puzzle. In this puzzle, the board consists of a 5 sided triangle full of golf tees. One hole is empty. You can jump a tee over an adjacent tee as long as it lands into an empty hole. The jumped tee is removed. The goal is to have one tee remaining.

In: Computer Science

[BushQ2] Consider the typical file structure of the C: (Windows) or / (Linux and macOS) drives....

[BushQ2] Consider the typical file structure of the C: (Windows) or / (Linux and macOS) drives. How is the hierarchy of this structure reflective of the permissions granted to various users within the system? Explain.

In: Computer Science

Q2: What are the forms of malware? Differentiate briefly between them. Give example for each.? Q4:...

Q2: What are the forms of malware? Differentiate briefly between them. Give example for each.?

Q4: what are the similarities and differences of the two types of protocols TCP and UDP?

In: Computer Science

When implementing SEO techniques into a website, what are some practices that should be avoided?

When implementing SEO techniques into a website, what are some practices that should be avoided?

In: Computer Science

Add a function to Programming Challenge 7 that allows the user to search the structure array...

Add a function to Programming Challenge 7 that allows the user to search the structure array for a particular customer's account. It should accept part of the customer's name as an argument and then search for an account with a name that matches it. All accounts that match should be displayed. If no account matches, a message saying so should be displayed. Currently I have

#include <iostream>
#include <string>

using namespace std;
void displayAccount(struct customerAccount Arr[], int index);
void changeAccount(struct customerAccount Arr[], int index, int num);
void createNewAccount(struct customerAccount Arr[], int index);
void menu();
const int SIZE = 2;
struct customerAccount
{
   string name, address, city, state, zip, phone, date;
   double balance;
};
int main()
{
   int choice = 0;
   int num = 0;
   int index = 1;
   customerAccount Arr[2];
   menu();
   cout << "Please enter a choice: 1-4\n";
   cin >> choice;
   {
       switch (choice)
       {
       case 1:
           createNewAccount(Arr, index);
           index++;
           cout << "Make another choice 1-4: \n";
           cin >> choice;
       case 2:
           cout << "Enter the customer number you would like to change the account information of " << endl;
           cin >> num;
           changeAccount(Arr, num, index);
           break;
       case 3:
           displayAccount(Arr, choice);
           system("pause");

       case 4:
           return 0;
       default:
           cout << "Please enter a valid choice ";
           cout << "between 1 and 4:" << endl;
           menu();
           cout << "Please enter a choice: ";
           cin >> choice;
       }
   }
   return 0;
}
void menu()
{
   cout << "****************************" << endl;
   cout << "\n \t MENU \n" << endl;
   cout << "****************************" << endl;
   cout << "1. Enter new account information" << endl;
   cout << "2. Change account information" << endl;
   cout << "3. Display all account information" << endl;
   cout << "4. Exit the program" << endl;
}
void displayAccount(struct customerAccount Arr[], int index)
{

   for (int i = 0; i < SIZE; i++)
   {
       cout << "The Customer's name is " << Arr[i].name << endl;
       cout << "The Customer's address is " << Arr[i].address << endl;
       cout << "Customer City is " << Arr[i].city << ", ";
       cout << Arr[i].state << "\n Area code: " << Arr[i].zip << endl;
       cout << "Their phone number is " << Arr[i].phone << endl;
       cout << "Their account creation date is " << Arr[i].date << endl;
       cout << "Their account balance is " << Arr[i].balance << endl;
   }
}
void changeAccount(struct customerAccount Arr[], int index, int num)
{

   cout << "enter the new Customer name: ";
   cin.ignore();
   getline(cin, Arr[num].name);
   cout << "enter the new Customer address: ";
   getline(cin, Arr[num].address);
   cout << "enter the new City: ";
   getline(cin, Arr[num].city);
   cout << "enter the new State: ";
   getline(cin, Arr[num].state);
   cout << "enter the new ZIP Code: ";
   getline(cin, Arr[num].zip);
   cout << "enter their telephone number: ";
   getline(cin, Arr[num].phone);
   cout << "Account balance, postive numbers only: ";
   cin >> Arr[num].balance;
   if (Arr[num].balance < 0)
   {
       cout << "this is not a valid balance.\n";
       cout << "please enter another balance";
       cin >> Arr[num].balance;
   }
   cout << "enter a date of last payment: ";
   cin.ignore();
   getline(cin, Arr[num].date);
}
void createNewAccount(customerAccount Arr[], int index)

{
   cout << "enter a Customer name: ";
   cin.ignore();
   getline(cin, Arr[index].name);
   cout << "enter a Customer address: ";
   getline(cin, Arr[index].address);
   cout << "enter their City: ";
   getline(cin, Arr[index].city);
   cout << "enter their State: ";
   getline(cin, Arr[index].state);
   cout << "enter their ZIP Code: ";
   getline(cin, Arr[index].zip);
   cout << "Telephone: ";
   getline(cin, Arr[index].phone);
   cout << "Account balance: ";
   cin >> Arr[index].balance;
   cout << "Date of last payment: ";
   cin.ignore();
   getline(cin, Arr[index].date);
}
  

How do I make a sort function for this?



In: Computer Science

Write a C program that generates the following 2D array. 64   32   16   8   4   2  ...

Write a C program that generates the following 2D array.

64   32   16   8   4   2   1
32   32   16   8   4   1   1
16   16   16   8   4   2   1
8   8   8   8   4   2   1
4   4   4   4   4   2   1
2   2   2   2   2   2   1
1   1   1   1   1   1   1

In: Computer Science

1- Discuss the basic steps of an implementation strategy to apply various networking technologies at the...

1- Discuss the basic steps of an implementation strategy to apply various networking technologies at the campus network (Hint: consider different technologies following the TCP/IP network model).

2-Discuss An optimized routing and addressing for the campus backbone that interconnects buildings, provides access to the server farm and routes traffic to the Internet.

3- Discuss the considered performance and security metrics on the edge of the network where the traffic is routed to and from the network.

4- What additional hardware and protocols are required for transforming the data network to handle real-time voice communications within the campus network ?

In: Computer Science

1. Practice Tasks Aims: to simulate the principles and key technology in operating systems. You need...

1. Practice Tasks

Aims: to simulate the principles and key technology in operating systems. You need to analyze, design, implement and debug a program which simulates the chosen principles or technology. You need to finish the following tasks to do the practice:

1) CPU scheduling algorithms (including FCFS, SJF, Priority Scheduling, Round Robin)

2) Process Synchronization (including producer and consumer problem, reader and writer problem, Dining-Philosophers Problem)

3) Page replacement algorithm (including FIFO, LRU, Optimal Algorithm)

4) Disk scheduling algorithm (including FCFS, SSTF, SCAN)

You need to implement the above 4 tasks to do the practice. You need to implement the input, algorithms and the output. The output will be different when you switch to different algorithms.

2. Requirements

1) Requirement analysis

2) Function design

3) Code preferebly in c/c++ or java

4) Report write-up

In: Computer Science

Python problem I don't know how to arrive to the answer of this question: "Rounded to...

Python problem

I don't know how to arrive to the answer of this question:

"Rounded to the nearest integer, how much higher is the average sum of all six stats among Mega Pokemon than their non-Mega versions? Note that Mega Pokemon share the same Number (the first column) as their non-Mega versions, which will allow you to find all Pokemon that have a Mega version."

For this problem below. The format of the file is included at the bottom but it's not complete. If you want the complete one, let me know and I can email it to you.

#The line below will open a file containing information
#about every pokemon through Generation 7:

pokedex = open('../resource/lib/public/pokedex.csv', 'r')

#We've also provided a sample subset of the data in
#sample.csv.
#
#Each line of the file has 13 values, separated by commas.
#They are:
#
#
# - Number: The numbered ID of the Pokemon, an integer
# - Name: The name of the Pokemon, a string
# - Type1: The Pokemon's primary type, a string
# - Type2: The Pokemon's secondary type, a string (this
# may be blank)
# - HP: The Pokemon's HP statistic, an integer in the range
# 1 to 255
# - Attack: The Pokemon's Attack statistic, an integer in
# the range 1 to 255
# - Defense: The Pokemon's Defense statistic, an integer in
# the range 1 to 255
# - SpecialAtk: The Pokemon's Special Attack statistic, an
# integer in the range 1 to 255
# - SpecialDef: The Pokemon's Special Defense statistic, an
# integer in the range 1 to 255
# - Speed: The Pokemon's Speed statistic, an integer in the
# range 1 to 255
# - Generation: What generation the Pokemon debuted in, an
# integer in the range 1 to 7
# - Legendary: Whether the Pokemon is considered "legendary"
# or not, either TRUE or FALSE
# - Mega: Whether the Pokemon is "Mega" or not, either TRUE
# or FALSE
#
#Use this dataset to answer the questions below.


#Here, add any code you want to allow you to answer the
#questions asked below over on edX. This is just a sandbox
#for you to explore the dataset: nothing is required for
#submission here.

Number,Name,Type1,Type2,HP,Attack,Defense,SpecialAtk,SpecialDef,Speed,Generation,Legendary,Mega
1,Bulbasaur,Grass,Poison,45,49,49,65,65,45,1,FALSE,FALSE
2,Ivysaur,Grass,Poison,60,62,63,80,80,60,1,FALSE,FALSE
3,Venusaur,Grass,Poison,80,82,83,100,100,80,1,FALSE,FALSE
3,Mega Venusaur,Grass,Poison,80,100,123,122,120,80,1,FALSE,TRUE
4,Charmander,Fire,,39,52,43,60,50,65,1,FALSE,FALSE
5,Charmeleon,Fire,,58,64,58,80,65,80,1,FALSE,FALSE
6,Charizard,Fire,Flying,78,84,78,109,85,100,1,FALSE,FALSE
6,Mega Charizard X,Fire,Dragon,78,130,111,130,85,100,1,FALSE,TRUE
6,Mega Charizard Y,Fire,Flying,78,104,78,159,115,100,1,FALSE,TRUE
7,Squirtle,Water,,44,48,65,50,64,43,1,FALSE,FALSE
8,Wartortle,Water,,59,63,80,65,80,58,1,FALSE,FALSE
9,Blastoise,Water,,79,83,100,85,105,78,1,FALSE,FALSE
9,Mega Blastoise,Water,,79,103,120,135,115,78,1,FALSE,TRUE
10,Caterpie,Bug,,45,30,35,20,20,45,1,FALSE,FALSE
11,Metapod,Bug,,50,20,55,25,25,30,1,FALSE,FALSE
12,Butterfree,Bug,Flying,60,45,50,90,80,70,1,FALSE,FALSE
13,Weedle,Bug,Poison,40,35,30,20,20,50,1,FALSE,FALSE
14,Kakuna,Bug,Poison,45,25,50,25,25,35,1,FALSE,FALSE
15,Beedrill,Bug,Poison,65,90,40,45,80,75,1,FALSE,FALSE
15,Mega Beedrill,Bug,Poison,65,150,40,15,80,145,1,FALSE,TRUE
16,Pidgey,Normal,Flying,40,45,40,35,35,56,1,FALSE,FALSE
17,Pidgeotto,Normal,Flying,63,60,55,50,50,71,1,FALSE,FALSE
18,Pidgeot,Normal,Flying,83,80,75,70,70,101,1,FALSE,FALSE
18,Mega Pidgeot,Normal,Flying,83,80,80,135,80,121,1,FALSE,TRUE
19,Rattata,Normal,,30,56,35,25,35,72,1,FALSE,FALSE
20,Raticate,Normal,,55,81,60,50,70,97,1,FALSE,FALSE

In: Computer Science

PartA: Create the database. Name the database doctorWho. Then create a page that allows Doctor Who’s...

PartA: Create the database. Name the database doctorWho. Then create a page that allows Doctor Who’s assistant to add a new patient record. You will need to give the assistant rights to this database. The assistant’s username is 'helper' and the password is 'feelBetter'. For this to work, you will need to create several pages so be sure to include all of them when submitting your work. Name the main page addPatient.php.

PartB: Add at least five records to the patient's table in the doctorWho database you created in PartA. Now create a page that will display three or more fields from each of these records. The display should consist of, at a minimum, the patient’s first and last names, and a unique identifier. Name the page getPatient.php and be sure to include the necessary accompanying files when you submit your work.

In: Computer Science

int main(){    int i = 3;    if(fork()){    i++;    fork();    i+=3;   ...

int main(){
   int i = 3;

   if(fork()){
   i++;
   fork();
   i+=3;
   }else{
   i+=4;
   fork();
   i+=5;
   }
   printf("%d\n",i);
}

what is the output of the code

In: Computer Science

Course name object oriented programming. 3) Define the following methods: - constructors: create two constructors with...

Course name object oriented programming.

3) Define the following methods:

- constructors: create two constructors with and without parameters.

- setName: this method sets the name of the School.

- getName: this method returns the name.

- setPhone: this method sets the phone number.

- getPhone: this method returns the phone number.

- setType: this method sets the type of the school.

- getType: this method returns the type of the school.

- toString: this method returns a string the contains the full information about a school.

In: Computer Science

In java coding, write a program that will print out a representation of a “W” using...

In java coding, write a program that will print out a representation of a “W” using a character that a user provides.

In: Computer Science