Questions
A Roman numeral represents an integer using letters. Examples are XVII to represent 17, MCMLIII for...

A Roman numeral represents an integer using letters. Examples are XVII to represent 17, MCMLIII for 1953, and MMMCCCIII for 3303. By contrast, ordinary numbers such as 17 or 1953 are called Arabic numerals. The following table shows the Arabic equivalent of all the single-letter Roman numerals:
M 1000 X 10
D 500 V 5
C 100 I 1
L 50
When letters are strung together, the values of the letters are just added up, with the following exception. When a letter of smaller value is followed by a letter of larger value, the smaller value is subtracted from the larger value. For example, IV represents 5 - 1, or 4. And MCMXCV is interpreted as M + CM + XC + V, or 1000 + (1000 - 100) + (100 - 10) + 5, which is 1995. In standard Roman numerals, no more than three consecutive copies of the same letter are used. Following these rules, every number between 1 and 3999 can be represented as a Roman numeral made up of the following one- and two-letter combinations:
M 1000 X 10
CM 900 IX 9
D 500 V 5
CD 400 IV 4
C 100 I 1
XC 90
L 50
XL 40
Write a Python code with a class to represent Roman numerals. The class should have two constructors. One named “toArabic” constructs a Roman numeral from a string like "XVII" to “seventeen” or "MCMXCV" to “one thousand nine hundred ninety-five”. It should throw an exception if the string is not a legal Roman numeral. The other constructor named “toInt” constructs a Roman numeral to an integer such as "XVII" to “17” or "MCMXCV" to “1995”. It should throw an exception if the integer result is outside the range 1 to 3999.

In: Computer Science

An organization’s success begins with building a strong, secure infrastructure, which includes the appropriate policies, procedures,...

An organization’s success begins with building a strong, secure infrastructure, which includes the appropriate policies, procedures, and processes, as well as architecting a scaleable, available, and secure network.

Describe the critical components of a cybersecurity architecture. Be sure it provides defense to protect the organization’s data, network, and assets.

Explain the function of each component and how each protects the organization.

Respond to the following in a minimum of 175 words:

In: Computer Science

Written in JAVA A valid month value mm must be from 1 to 12 (January is...

Written in JAVA

A valid month value mm must be from 1 to 12 (January is 1) and it must contain two digits. The day value dd must be from 1 to a value that is appropriate for the given month and it also must contain two digits. The year value yyyy must contain four digits and be a positive number. September, April, June, and November each have 30 days. February has 28 days except for leap years when it has 29. The remaining months all have 31 days. A leap year is any year that is divisible by 4 but not divisible by 100 unless it is also divisible by 400.

After you have the three substrings for the month, day, and year, you need to convert those strings into int values. This is done with a line of code like the following (for the year).

      int year = Integer.parseInt( yearString );

As soon as you find a problem with the user's input, output an appropriate error message and return from the checkDate method. Here is an example of how that might look.

      if ( 4 != yearString.length() )
      {
         System.out.println("Error with " + savedDate + ": The year must have four digits.");
         return;  // exit from the checkDate method
      }

You need to determine which years are leap years. This is tricky. The main tool for doing this is the "integer remainder" operator, %, which is described on pages 68-70 of the textbook. So, for example, the year is divisible by 4 when 0 == (year % 4) is true. A year is not divisible by 100 when 0 != (year % 100) is true.

In: Computer Science

You need to implement a web application that is split in three parts, namely, Webpage, PHP...

You need to implement a web application that is split in three parts, namely, Webpage, PHP and Database. Each of them will be employed synergically to solve the simple problem described below. Your implementation should be able to resist all the most common security threats.

Webpage: This is the main page of your application. It would contain two sections, ADD and SEARCH: ADD section contains:

-A text box to input an Advisor name

-A text box to input a Student name

-A text box to input the Student ID code

-A text box to input the class code

-A button to allow the user to add the above specified data in the Database

SEARCH section contains: A search box (with corresponding button) that allows the user to query the database for Advisors name

PHP:

-Implement one or more PHP functions that read the inputs from the ADD section of the Webpage and prepare the corresponding query to add the record in the Database.

-Implement one or more PHP functions that read the input from the SEARCH section and prepare the corresponding query for the Database.

-Implement a function that, when a search is made in the SEARCH section, it shows in input the result of the query

Database: You need to create a database that contains at least a table to store the information in input to the webpage.

In: Computer Science

Write as a script in the editor window of Matlab: Concession stand. Write a program, ConcessionStand.m,...

Write as a script in the editor window of Matlab:

Concession stand. Write a program, ConcessionStand.m, that uses vector-matrix multiplication to tabulate and display the cost of each of the following orders. Assume that a hot dog costs $3.00, a brat costs $3.50, and a Coke costs $2.50.

----------------------------------------------------

  hot dogs brats cokes

order 1    2 1 3

order 2 1 0 2

order 3 2 2 2

order 4 0 5 1

In: Computer Science

You will ask the end user to type their first name and their last name and...

You will ask the end user to type their first name and their last name and store it on separate
string variables, you will ask for the gender, you will then concatenate both strings into a third
string variable. You will salute the end user as Mr. or Ms depending on the gender and last you
will display the initials of the end user. (You must use methods of the string class in this lab)

In: Computer Science

Write in C++ programming language Given the following postfix string, from left to right, use the...

Write in C++ programming language

Given the following postfix string, from left to right, use the stack push operation to put items on the stack and the pop operation whenever an operator is encountered and to get two items and apply the operator to the operands then push back the result to evaluate the expression … rewrite the entire stack as it appears before each operator is applied.

12 3  / 5  + 32 2  3  ^  2  *  /  -

In: Computer Science

Respond to the following in a minimum of 175 words: Research data manipulation, efficiency, and memory...

Respond to the following in a minimum of 175 words:


Research data manipulation, efficiency, and memory in programming.


Why are data manipulation, efficiency, and memory useful in programming? Provide specific examples for each.

In: Computer Science

Problem 3: What three ASCII letters (bytes) are encoded by the following 4B/5B pattern? (Case sensitive)...

Problem 3: What three ASCII letters (bytes) are encoded by the following 4B/5B pattern? (Case sensitive)

010110101001110101010111111110

In: Computer Science

Give an example of a program that uses the nongeneric version of a class from the...

Give an example of a program that uses the nongeneric version of a class from the STL and the equivalent program that uses the generic version. How do the two implementations differ? Why is having the syntax of generics better?

In: Computer Science

Use the Internet to research IDS and Vulnerability Management and Assessment Tools. Find at least six...

Use the Internet to research IDS and Vulnerability Management and Assessment Tools. Find at least six (6) tools for each security tool category, with a minimum of three (3) Open Source and three (3) Commercial for each category of tools (6 IDS and 6 Vulnerability Management).

write a paragraph explaining which tool you prefer or will recommend for your company (one statement for each category, open source vs commercial). What is your logic behind your choice?

In: Computer Science

Using Eclipse to answer this Java question Using the concepts from the Concurrency Basics Tutorial I...

Using Eclipse to answer this Java question

Using the concepts from the Concurrency Basics Tutorial I provided in Modules, write a program that consists of two threads. The first is the main thread that every Java application has. The main thread should create a new thread from the Runnable object, MessageLoop, and wait for it to finish. If the MessageLoop thread takes too long to finish, the main thread should interrupt it. Use a variable named maxWaitTime to store the maximum number of seconds to wait. The main thread should output a message stating that it is still waiting every half second.

The MessageLoop thread should print out a series of 5 messages. It should wait 850 milliseconds between printing messages to create a delay. If it is interrupted before it has printed all its messages, the MessageLoop thread should print "Message loop interrupted" and exit.

Your program must demonstrate that it can both output messages and interrupt the message output. To do this, place your code in main into a for loop using maxWaitTime as the index.

So in main your code will be

for (int maxWaitTime = 1; maxWaitTime <= 5; maxWaitTime++) {

// All of main's processing goes here (All does not mean part of. ALL of main).

}

maxWaitTime means the same as it would in real life. It is how long the main thread waits before interrupting. Think about this. Don't confuse milliseconds and seconds.

Sample output :

maxWaitTime: 1 second(s)
main : Starting MessageLoop thread
main : Waiting for MessageLoop thread to finish
main : Continuing to wait...
main : Continuing to wait...
Thread-0 : 1. All that is gold does not glitter, Not all those who wander are lost
main : MessageLoop interrupted
maxWaitTime: 2 second(s)
main : Starting MessageLoop thread
main : Waiting for MessageLoop thread to finish
main : Continuing to wait...
main : Continuing to wait...
Thread-1 : 1. All that is gold does not glitter, Not all those who wander are lost
main : Continuing to wait...
main : Continuing to wait...
Thread-1 : 2. The old that is strong does not wither, Deep roots are not reached by the frost
main : MessageLoop interrupted
maxWaitTime: 3 second(s)
main : Starting MessageLoop thread
main : Waiting for MessageLoop thread to finish
main : Continuing to wait...
main : Continuing to wait...
Thread-2 : 1. All that is gold does not glitter, Not all those who wander are lost
main : Continuing to wait...
main : Continuing to wait...
Thread-2 : 2. The old that is strong does not wither, Deep roots are not reached by the frost
main : Continuing to wait...
main : Continuing to wait...
Thread-2 : 3. From the ashes a fire shall be woken, A light from the shadows shall spring
main : MessageLoop interrupted
maxWaitTime: 4 second(s)
main : Starting MessageLoop thread
main : Waiting for MessageLoop thread to finish
main : Continuing to wait...
main : Continuing to wait...
Thread-3 : 1. All that is gold does not glitter, Not all those who wander are lost
main : Continuing to wait...
main : Continuing to wait...
Thread-3 : 2. The old that is strong does not wither, Deep roots are not reached by the frost
main : Continuing to wait...
main : Continuing to wait...
Thread-3 : 3. From the ashes a fire shall be woken, A light from the shadows shall spring
main : Continuing to wait...
Thread-3 : 4. Renewed shall be blade that was broken
main : Continuing to wait...
main : MessageLoop interrupted
maxWaitTime: 5 second(s)
main : Starting MessageLoop thread
main : Waiting for MessageLoop thread to finish
main : Continuing to wait...
main : Continuing to wait...
Thread-4 : 1. All that is gold does not glitter, Not all those who wander are lost
main : Continuing to wait...
main : Continuing to wait...
Thread-4 : 2. The old that is strong does not wither, Deep roots are not reached by the frost
main : Continuing to wait...
main : Continuing to wait...
Thread-4 : 3. From the ashes a fire shall be woken, A light from the shadows shall spring
main : Continuing to wait...
Thread-4 : 4. Renewed shall be blade that was broken
main : Continuing to wait...
main : Continuing to wait...
Thread-4 : 5. The crownless again shall be king
main : Done!

In: Computer Science

Write a C or C++ program that uses pthreads to compute the number of values that...

Write a C or C++ program that uses pthreads to compute the number of values that are
evenly divisible by 97 between a specified range of values (INCLUSIVE).

The program should accept 3 command-line arguments:
low value
high value
number of threads to create to perform the computation

-Specifics for program

order of input: 0 9000000000 2 this means 0 to 9 Billion (INCLUSIVE); 2 threads

alarm(90); this should be the first executable line of the program to make sure it does not run for too long

use long ints instead of ints

hard-code the use of 97 in computations, instead of into a variable (const may be ok)

time1 please copy function below to get the time

sample output from the above run:
THREAD 0: 46391753
THREAD 1: 46391753
TOTAL 92783506
TIME 7.425558

time1 function

#include <stdio.h>

#include <unistd.h>

#include <stdlib.h>

#include <time.h>

#include <sys/time.h>

  

double time1()

{

struct timeval tv;

gettimeofday( &tv, ( struct timezone * ) 0 );

return ( (double) (tv.tv_sec + (tv.tv_usec / 1000000.0)) );

}

double time2()

{

return ( (double) time(NULL) );

}

void main(int argc,char *argv[])

{

double t1, t2, t3, t4;

t1 = time1();

t2 = time2();

printf("%lf %lf\n",t1,t2);

sleep(2);

t3 = time1();

t4 = time2();

printf("%lf %lf\n",t3,t4);

printf("%lf %lf\n",t3-t1,t4-t2);

}

In: Computer Science

Can you answer these question using python and recursive functions Write a function that consumes two...

Can you answer these question using python and recursive functions

Write a function that consumes two numbers N1 and N2 and prints out all the even numbers between those numbers, using recursion.

Using any number of list literals of maximum length 2, represent the data from your Survey List. So you cannot simply make a list of 15 values. Make a comment in your code that explicitly describes how you were able to represent this.

Write a recursive function that traverses your list of pairs and calculates their sum.

In: Computer Science

//those who say that "whether the student wants to understand or debug the code, IT IS...

//those who say that "whether the student wants to understand or debug the code, IT IS IN THE COMMENTS, it says solve and that is all that is given for the code and no other instructions

it says //SOLVE

// the code already works you just have to finish the void functions that are given and run it and see if it works or not are those in the main are the test cases to test whether they work or not

#include

#include

using namespace std;

class NodeType {

public:

  NodeType(int = 0); // constructor with default value for

           // info field

  int info;    // data

  NodeType *nextPtr; // pointer to next node in the list

};

// Constructor

NodeType::NodeType(int data) {

  info = data;

  nextPtr = 0;

}

void printmenu(void) {

  cout << "N: new item" << endl;

  cout << "P: print list" << endl;

  cout << "F: find item" << endl;

  cout << "D: delete head item" << endl;

  cout << "V: delete value" << endl;

  cout << "S: recursively sum values" << endl;

  cout << "O: recursively prod values" << endl;

  cout << "X: recursively find max" << endl;

  cout << "G: recursive negative item on list" << endl;

  cout << "Q: quit" << endl;

}

void printList(NodeType *currentPtr) {

//solve

return 0;

int MaxList(NodeType *currentPtr) {

//solve

return 0;

}

int sumList(NodeType *currentPtr) {

  return 0;

//solve

}

int prodList(NodeType *currentPtr) {

//solve

return 0;

}

bool negList(NodeType *currentPtr) {

//solve

\ return 0;

}

NodeType *insertHead(NodeType *head, int value) {

//solve  

NodeType *newptr;

  return (newptr);

}

void findValue(NodeType *head, int value) {

//solve

}

NodeType *deleteFront(NodeType *head) {

  // deletes the first item and returns the new head pointer

  NodeType *tempPtr;

//solve  

return tempPtr;

}

NodeType *deleteValue(NodeType *currentPtr, int value) {

  NodeType *tempPtr = NULL;

//solve  

return tempPtr;

}

int main(void) {

  NodeType *head = NULL;

  int value;

  char input;

  printmenu();

  cout << "what is your selection?";

  cin >> input;

  while (input != 'Q' && input != 'q') {

    switch (input) {

    case 'n':

    case 'N':

      cout << "N" << endl;

      break;

    case 'p':

    case 'P':

      cout << "P" << endl;

      break;

    case 'o':

    case 'O':

      cout << "O" << endl;

      break;

    case 's':

    case 'S':

      cout << "S" << endl;

      break;

    case 'x':

    case 'X':

      cout << "X" << endl;

      break;

    case 'g':

    case 'G':

      cout << "G" << endl;

      break;

    case 'f':

    case 'F':

      cout << "What value would you like to find?" << endl;

      cin >> value;

      cout << endl << "You are finding: " << value << endl;

      break;

    case 'd':

    case 'D':

      cout << "Deleting head entry if present" << endl;

      break;

    case 'v':

    case 'V':

      cout << "What value would you like to delete?" << endl;

      cin >> value;

      cout << "You are deleting " << value << endl;

      break;

    default:

      cout << "What happened?" << endl;

    }

    printmenu();

    cout << "what is your selection?";

    cin >> input;

  }

  system("pause");

}

In: Computer Science