Questions
how to write a genetic algorithm for a knapsack problem .

how to write a genetic algorithm for a knapsack problem .

In: Computer Science

You are tasked with developing an application that converts US currency ($) to 3 other major...

You are tasked with developing an application that converts US currency ($) to 3 other major world currencies.

Here are the current rates:

1 US dollar = 0.90 EURO

1 US dollar = 107.7 Japanese YEN

1 US dollar =19.45 Mexican PESO

Your application must prompt the user to enter an amount in US dollars, convert it into EURO, YES, and PESO and then display all using a suitable format.

Coding requirements:

-All your variables MUST  declared inside main() except for the Scanner.

-Code function(s)/method(s)   that handle all input.

-Code function(s)/method(s) that handles all conversions.

-Code a function/method that displays the result of the conversion. Your output must be clear and well labeled.

(show the amount input in dollar, then show the amount of the conversion for each of the three major currencies)

In: Computer Science

Complete the Vec class to make it similar to the vector. sample code here. #include #include...

Complete the Vec class to make it similar to the vector.

sample code here.

#include

#include

#include

#include

#include

using namespace std;

int get_mode( vector vec )

{

int numbers[101] = {0};

for ( int e : vec ) numbers[e]++;

int greatest = 0, n = 0;

for ( int i = 0; i <= 100; i++ )

{

if ( numbers[i] > greatest )

{

greatest = numbers[i];

n = i;

}

}

return n;

}

const double g = 9.81;

const double k = 0.24;

double v( double m, double t )

{

return sqrt(m * g / k) * tanh( sqrt(k * g / m) * t );

}

double d( double m, double t )

{

return m / k * log( cosh(sqrt(k * g / m) * t) );

}

int main()

{

cout << "Please enter the skydiver mass: ";

double m;

cin >> m;

cout << "k = 0.24kg/m, m = 95.0kg, g = 9.81m/s^2" << endl;

cout << endl;

cout << "| Time | Velocity | Distance |" << endl;

for ( int t = 1; t <= 8; t++ )

{

cout << "| " << setw(4) << t << " | ";

cout << setw(8) << fixed << setprecision(2) << v(m, t) << " | ";

cout << setw(8) << fixed << setprecision(2) << d(m, t) << " |" << endl;

}






return 0;

}

In: Computer Science

-create a magic 8 ball program in Javascript. -use a loop to ask for the question...

-create a magic 8 ball program in Javascript.
-use a loop to ask for the question
-use a random number to get the answer let randAnswer = Math.round(Math.random()*10);
-must have at least10 different answers
-must use elseif or switch statement
-must outputs both answers and user to input the console
-program should repeat indefinitely until either blank input or cancel is selected

In: Computer Science

Make a function in Python that can do the following: Longest Increasing Sub-sequence: The input is...

Make a function in Python that can do the following:

Longest Increasing Sub-sequence:

The input is a sequence of numbers and the goal is to find a subsequence of the given sequence in which the subsequence's elements are in increasing order. You are looking for the longest possible such subsequence.

In: Computer Science

L4 (0.4 marks) Code a calling and called method that tries to demonstrate that a called...

L4 (0.4 marks) Code a calling and called method that tries to demonstrate that a called method cannot remember how many times it has been called if it’s limited to only using its formal parameters and local variables. For technical reasons this cannot be demonstrated. You will discover why in your attempt. Now use a class-level variable to do the job properly.

In: Computer Science

Please use markup language HTML5 please. For this homework assignment, you will create a Web site...

Please use markup language HTML5 please.

For this homework assignment, you will create a Web site made up of three different pages and links between those pages

Index.htm

  • The Web pages in a site should have a similar look-and-feel. For this site, you should create a simple menu as follows:
    • Create a horizontal line across the very top and bottom of the page.
    • Also on the home (Index) page, create links to the other two pages. The links should appear just below the line at the top of the page. You must use relative links between the pages in your site. Create another horizontal line just below the menu. The menu should appear on every page and appear just like it does on the home page.
    • Wrap the above code (menu) in the appropriate semantic navigation tag.
  • The home page should have a level 1 heading containing your full name. Your name should appear below the links to the other two pages (navigation area).
  • Add a picture of your choosing to the home page such that it appears below the level 1 heading. You must use a relative reference for the image. Make sure that you have alternate text for the image for accessibility. Wrap the image in the appropriate figure and figure caption tags. Create a caption for the figure as you see fit. You can use any image you want.
  • Add a second picture of your choosing to this page. However, do not download this picture. Use and absolute reference to the picture on the Web. Make sure that you have alternate text for the image for accessibility. Wrap the image in the appropriate figure and figure caption tags. Create a caption for the figure as you see fit.
  • Put a copyright notice using the appropriate named entity at the very bottom of the page below the last horizontal line. It should have the copyright symbol, followed by your name. You can use a named or numbered entity to do this. The copyright notice should appear on all the pages and be wrapped in the appropriate semantic footer tag.
  • Write the necessary tag so that the text Home appears in the browser's title bar.

Content.htm

For this page, you have considerable flexibility. You can use any content that you want. Pick a subject in which you are interested, and teach me something or inform me about it. You do not need to write all of the content yourself. You can cut and paste it from the Web.

To get full credit, your page MUST meet the following minimum requirements.

  • Create a horizontal line across the very top and bottom of the page, just as you did on the first page and wrap the menu in the appropriate navigation tags.
  • Also on the page, create relative links to the other two pages. The links should appear just below the two horizontal lines at the top of the page.
  • Create a level 1 heading as you did on the first page. The text of the heading should describe the purpose or meaning of your site. Your heading should be wrapped in an <article> tag.
  • Your page must have at least three sections <section> tags and corresponding <h2> tags. Put your content in the sections.
  • Your page must have at least two images excluding the image required for the validation report. They must have semantic figure, figure caption, and alternate text.
  • Your page must have at least three links to pages that somehow relate to your page. One of those links must operate as a clickable image.
  • A billeted list must appear somewhere on the page.
  • Write the necessary tag so that the text Content appears in the browser's title bar.
  • Just below the menu and before the top <h1> tag, create bookmarks to the various sections. The number of bookmarks will vary based on the number of sections.

Copyright.htm

  • Again, create horizontal lines at the top and bottom of the page.
  • Create links to the other two pages. The links should appear just below the line at the top of the page.
  • Use the proper semantic tags to describe the reviewer or author. (that's you).
  • Use the proper tag to represent the article date. The date you submitted your assignment
  • Write the necessary tag so that the text Copyright appears in the browser's title bar.
  • Somewhere in the copyright notice, you must used the copyright symbol (named entity).

In: Computer Science

- List the benefits of deploying Windows Server Update Services in the network - Define the...

- List the benefits of deploying Windows Server Update Services in the network

- Define the new features In the latest version of Windows Server Update Services

In: Computer Science

Write an advertisement for a user support position. Find one or more ads online or in...

Write an advertisement for a user support position. Find one or more ads online or in
your local newspaper for information technology and user support positions. Note the format
and content of a typical help wanted ad in the IT field. Select one of the user support position
descriptions in Chapter 1, and then write a classified ad that could be used to attract job
applicants for the position whose description you selected.

In: Computer Science

In a library database, where would you have the potential for repeating groups? What are the...

In a library database, where would you have the potential for repeating groups? What are the potential problems? Explain.

In: Computer Science

can you give me a brief description of your experience related to each of these bullets?...

can you give me a brief description of your experience related to each of these bullets?

  • Development of test automation using Selenium (and potentially other Open Source or Commercial Functional Testing Frameworks like Katalon), SOAPUI, AppScan, and JMeter.
  • Development of test automation for web applications, mobile applications and web services.
  • Ability to understand and write code including but not limited to C# and JavaScript
  • Ability to create and maintain test plans, test results and communicate effectively with clients.
  • Experience managing test data in multiple database platforms as well as JSON and XML.

In: Computer Science

Programming language: JAVA First, implement a recursive, Divide&Conquer-based algorithm to identify both the Minimum and Maximum...

Programming language: JAVA

First, implement a recursive, Divide&Conquer-based algorithm to identify both the Minimum and Maximum element in an unsorted list.

Second, convert your recursive algorithm to a non-recursive (or iterative) implementation. For your input, populate an "unsorted list" with random elements between 1 and 1,000,000.

In: Computer Science

Demonstrate your grasp of the Unix file system by constructing a directory structure as follows: In...

Demonstrate your grasp of the Unix file system by constructing a directory structure as follows:

  1. In your home ( ~ ) directory, create a directory named “UnixCourse”.

    This directory will be used in the remaining assignments of this course, as well as this one.

    Several of the commands that you will issue in this course will examine files in this directory and, in some cases, send me a listing of those files or even copies of those files for grading and diagnostic purposes. So you should not store anything unrelated to the course assignments in this ~/UnixCourse area.

  2. Within your UnixCourse directory, you should create a directory named “fileAsst”. Within that directory, you should create two directories, named “Empire” and “Alliance”.

    Use the ls command to check your work.

  3. Within the Empire directory, you should place a copy of the file ~cs252/Assignments/fileAsst/darth.txt

    Use the ls command to check your work.

  4. Within the Alliance directory, you should place a copy of the file ~cs252/Assignments/fileAsst/r2d2.txt

    Use the ls command to check your work.

  5. When you have completed this much, execute the command

    ~cs252/bin/fileAsst-1
    

    (Take note of the difference between the numeric digit 1 and the lower-case letter l in the command above. If you can’t tell the difference between these, check your web browser settings to see if you can get it to use some better fonts.)

    This will check to see if you have built the desired directory structure so far. You should repeat the above steps as necessary until this command reports success.

  6. If you have been successful so far, the fileAsst-1 command will have placed a new file somewhere in the directory structure you have built. Find it, and move it into the Empire directory, renaming the file to “emperor.dat”.

  7. Execute the command

    ~cs252/bin/fileAsst-2
    

    If all is well, you will receive the access code for completion of this assignment.

In: Computer Science

What are the the three characteristics of Big Data, and what are the main considerations in...

What are the the three characteristics of Big Data, and what are the main considerations in processing Big Data?

In: Computer Science

Your primary task for this exercise is to complete header file by writing three functions with...

Your primary task for this exercise is to complete header file by writing three functions with its description below:

removeAt function – to remove the item from the list at the position specified by location. Because the list elements are in no particular order (unsorted list), you could simple remove the element by swapping the last element of the list with the item to be removed and reducing the length of the list.

insertAt function - to insert an item in the list at the position specified by location. The item to be inserted is passed as a parameter to the function.

print function – to output the elements of the list.

3. Demonstrate the program by asking a user to enter 5 integers. After displaying 5 integers, ask the user the position of the item to be deleted. You can use your own data to generate two outputs.

Sample output 1:

Enter 5 integers: 45 19 2 16 77

The list you entered is: 45 19 2 16 77

Enter the position of item to be deleted: 2
After removing element at 2, the list is:
45 19 77 16

Sample output 2:

Enter 5 integers: 15 12 11 3 49

The list you entered is: 15 12 11 3 49

Enter the position of item to be deleted: 6
The location of the item to be removed is out of range
After removing element at 6, the list is:
15 12 11 3 49

======================================== C++

#ifndef H_arrayListType
#define H_arrayListType

#include <iostream>
#include <cassert>

using namespace std;

template <class elemType>
class arrayListType
{
public:
    const arrayListType<elemType>& operator=
                         (const arrayListType<elemType>&);
      //Overloads the assignment operator
    
    void print() const;
      //Function to output the elements of the list
      //Postcondition: Elements of the list are output on the 
       //   standard output device.
    
   void insertAt(int location, const elemType& insertItem);
      //Function to insert an item in the list at the 
      //position specified by location. The item to be inserted 
      //is passed as a parameter to the function.
      //Postcondition: Starting at location, the elements of the
      //    list are shifted down, list[location] = insertItem;,
      //    and length++;. If the list is full or location is
      //    out of range, an appropriate message is displayed.
   
    void removeAt(int location);
      //Function to remove the item from the list at the 
      //position specified by location 
      //Postcondition: The list element at list[location] is removed
      //    and length is decremented by 1. If location is out of 
      //    range,an appropriate message is displayed.
 
    arrayListType(int size = 100);
      //constructor
      //Creates an array of the size specified by the 
      //parameter size. The default array size is 100.
      //Postcondition: The list points to the array, length = 0, 
      //    and maxSize = size
        
    arrayListType(const arrayListType<elemType>& otherList); 
      //copy constructor

    ~arrayListType();
      //destructor

protected:
    elemType *list;  //array to hold the list elements
    int length;      //to store the length of the list
    int maxSize;     //to store the maximum size of the list
};

// print function definition
template <class elemType>
void arrayListType<elemType>::print() const
{
        // your code here
}

// insertAt function definition
template <class elemType>
void arrayListType<elemType>::insertAt
                  (int location, const elemType& insertItem)
{
        // your code here
} //end insertAt

// removeAt function definition
template <class elemType>
void arrayListType<elemType>::removeAt(int location)
{
 // your code here

} //end removeAt

// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
template <class elemType>
arrayListType<elemType>::arrayListType(int size)
{
    if (size < 0)
    {
        cerr << "The array size must be positive. Creating "
             << "an array of size 100. " << endl;

        maxSize = 100;
    }
    else
        maxSize = size;

    length = 0;

    list = new elemType[maxSize];
    assert(list != NULL);
}


template <class elemType>
arrayListType<elemType>::~arrayListType()
{
    delete [] list;
}


template <class elemType>
arrayListType<elemType>::arrayListType
                   (const arrayListType<elemType>& otherList)
{
    maxSize = otherList.maxSize;
    length = otherList.length;
    list = new elemType[maxSize]; //create the array
    assert(list != NULL);         //terminate if unable to allocate
                                  //memory space

    for (int j = 0; j < length; j++)  //copy otherList
        list [j] = otherList.list[j];
} //end copy constructor


template <class elemType>
const arrayListType<elemType>& arrayListType<elemType>::operator=
                      (const arrayListType<elemType>& otherList)
{
    if (this != &otherList)   //avoid self-assignment
    {
        delete [] list; 
        maxSize = otherList.maxSize; 
        length = otherList.length; 
 
        list = new elemType[maxSize];  //create the array
        assert(list != NULL);   //if unable to allocate memory 
                                //space, terminate the program 
        for (int i = 0; i < length; i++)
            list[i] = otherList.list[i]; 
    }

    return *this; 
}

#endif

==================================================================

#include <iostream>
#include "arrayListType.h"

using namespace std;

int main()
{
    arrayListType<int> intList(100);                                              
   
    int counter;                                                                                        
    int number; 
    int position;                                                                                       
                                                                                        
    cout << "Enter 5 integers: ";                                         
                                                                                
    for (counter = 0; counter < 5; counter++)                                
    {   
                cin >> number;                                                                            
                intList.insertAt(counter, number);                                      
    }

    cout << endl;                                                                                         
    cout << "The list you entered is: ";                          
    intList.print();                                                                            
    cout << endl;                                                                                         

    cout << "Enter the position of item to be deleted: ";         
    cin >> position;                                                                                      
    intList.removeAt(position);                                                                 
    cout << "After removing element at " << position
                 << ", the list is:" << endl;                                                       
    intList.print();
        
        system("pause");
    return 0;
}

/*
Enter 5 integers: 45 19 2 16 77

The list you entered is: 45 19 2 16 77

Enter the position of item to be deleted: 2
After removing element at 2, the list is:
45 19 77 16

*/

/*
Enter 5 integers: 15 12 11 3 49

The list you entered is: 15 12 11 3 49

Enter the position of item to be deleted: 6
The location of the item to be removed is out of range
After removing element at 6, the list is:
15 12 11 3 49

*/

In: Computer Science