Questions
L ={x^a y^b z^c | c=a+b} a) Prove that L is not regular. b)Prove by giving...

L ={x^a y^b z^c | c=a+b}

a) Prove that L is not regular.

b)Prove by giving a context-free grammar that the L is context free.

c)Give a regular expression of the complement L'.

In: Computer Science

C++ Create a class called Musicians to contain three functions string ( ), wind ( )...

C++

Create a class called Musicians to contain three functions string ( ), wind ( ) and perc ( ).

Each of these functions should initialize a string array to contain the following instruments:
    - veena, guitar, sitar, sarod and mandolin under string ( )
    - flute, clarinet saxophone, nadhaswaram and piccolo under wind ( )
    - tabla, mridangam, bangos, drums and tambour under perc ( )

It should also display the contents of the arrays that are initialized.

Create a derived class called TypeIns to contain a function called get ( ) and show ( ). The get ( ) function must display instruments as follows:

Type of instruments to be displayed
   a.    String instruments
   b. wind instruments
   c.    Percussion instruments

The show ( ) function should display the relevant detail according to our choice. The base class variables must be accessible only to its derived classes.

In: Computer Science

Hello There! I have a question to answer please, I don't understand it, it is about...

Hello There!

I have a question to answer please, I don't understand it, it is about data communication and networking "Wireshark"

Capture ICMP packets with “Wireshark” and analyze the results.

Capturing Basics and Filters

1_ Create a filter to show only HTTP traffic with destination port 80.

2_ Create a filter to exclude ARP and ICMP traffic from visualization.

3_ Create a filter to show DNS queries to a specific domain. TIP: Use the keyword contains to search a specific value in the payload.

I want to see screenshots please and outcomes,

Thanks!

In: Computer Science

Thus, an expression can contain a sequence of delimiters such as             { [ ( )...

Thus, an expression can contain a sequence of delimiters such as

            { [ ( ) ( ) ] ( ) }

but not

            [ ( ] )

For convenience, we will say that a balanced expression contains delimiters that are paired correctly, or are balanced.

  1. Write a program in java that detects whether an infix expression is balance using stack structure.
  2. Test your program on a set of infix algebraic expression.

In: Computer Science

Create a java program for Student profile with the following requirements. Each Student has: two variables...

Create a java program for Student profile with the following requirements.

  1. Each Student has: two variables id, and name.
  2. A Student can be initialization with two constructers:
  • Constructer without parameters, that set the id to zero and the name to an empty string.
  • Constructer with tow parameters to initialize the variables id and name by a specific value.
  1. Add a set method for each variable that change them to a specific value.
  2. Add a get method for each variable which return its value.

To test the program, create a class StudentTest with the main method.

In the main method:

  1. Create two empty Student profiles S1and S2.
  2. Print the S1and S2 information.
  3. Create a new student profile S3, specify the student id and name.
  4. Change S3id and name.
  5. Print the id and name of S3.

Answer:

In: Computer Science

Create a C++ program based on the following criteria: Define an integer for the user selection...

Create a C++ program based on the following criteria:

  • Define an integer for the user selection called selection
  • Define a double called ticketPrice that is initialized to 20
  • Create a numeric menu for ticket prices, thus:
    • Adult is 15-64 and is normal price (option 1)
    • Child is 0-14 and is half normal price (option 2)
    • Senior is 65+ and is 0.8x normal price (option 3)
    • Give an option to exit (option 4)
  • Based on their selection, output the price of their selected ticket

In: Computer Science

For this portion of the lab, you will reuse the Python program you wrote before. That...

For this portion of the lab, you will reuse the Python program you wrote before.
That means you will open the lab you wrote in the previous assignment and change it. You should NOT start from scratch. Also, all the requirements/prohibitions from the previous lab MUST also be included /omitted from this lab.   
Redesign the solution so that some portions of the code are repeated. In lab 4 you validated input to ensure that the user entered inputs within certain values. If the user entered an invalid value, the program terminated. Now you will add a loop such that the user gets three chances to enter a valid value. If the user enters an invalid value more than three times in a row, the program should issue an error message and terminate.

The program I wrote before is shown below.

How can I apply the new requirements to reuse this program?

#Get a value from user.
Miles = float(input('How many miles would you like to convert into kilometers: '))

#Condition
if Miles >= 0:

#Convert miles to kilomters
Kilometers = Miles * 1.6

#Display result
print(Miles,"miles is equal to", Kilometers,"kilometers.")

#Get a value from user.
Gallons = float(input('How many gallons would you like to convert into liters: '))

#Condition
if Gallons >= 0:

#Convert gallons to liters
Liters = Gallons * 3.9

#Display result
print(Gallons,"gallons is equal to", Liters,"liters.")

#Get a value from user.
Pounds = float(input('How many pounds would you like to convert into kilograms: '))

#Condition
if Pounds >= 0:

#Convert pounds to kilograms
Kilograms = Pounds * 0.45

   #Display result

   print(Pounds,"pounds is equal to", Kilograms,"kilograms.")

#Get a value from user.
Inches = float(input('How many inches would you like to convert into centimeters: '))

#Condition
if Inches > 0:
  
#Convert inches to centimeters
Centimeters = Inches * 2.54

#Display result
print(Inches,"inches is equal to",Centimeters,"centimeters.")

#Get a value from user.
Fahrenheit = float(input('How many fahrenheit would you like to convert into celsius: '))

#Condition   
if Fahrenheit < 1000:

#Convert fahrenheits to celsius
Celsius =(Fahrenheit - 32) * 5/9

#Display result
print(Fahrenheit,"fahrenheits is equal to",Celsius,"celsius.")

else:
#Display error message
print('Invalid value!')

else:
#Display error message
print('Invalid value!')

else:
#Display error message

else:
#Display error message
print('Invalid value!')

else:

#Display error message
print('Invalid value!')

In: Computer Science

Note: Show All the steps of your work. 1. Convert the following decimal real number to...

Note: Show All the steps of your work.

1. Convert the following decimal real number to a binary number with six places to the right of the binary point.
57.553

2. Represent the following decimal integer numbers in binary using 8-bit signed magnitude, one’s complement, and two’s complement representations:
(a) 65 (b) -24

3. What is the value of the 8-bit binary number 10011110 in decimal assuming the following representation: (a) unsigned, (b) sign-magnitude, (c) one’s complement, (d) two’s complement.

4. Using arithmetic shifting, perform the following operations assuming the numbers are expressed using 8-bit signed two’s complement representation:
(a) Multiply the value 00111101 by 8
(b) Divide the value 11001010 by 4

5. Assume we are using a simple model for floating-point representation similar to the one used in Chapter 2 of the textbook which has a 14-bit format, 5 bits for the exponent with a bias of 15 (not 16 as in the textbook), a normalized mantissa of 8 bits, and a single sign bit.
(a) Show how the computer would represent the numbers 100.0 and 0.25 using this representation.
(b) Show how the computer would add the two floating-point numbers in part (a) by changing one of the numbers so they are both expressed using the same power of 2.
(c) Show how the computer would represent the sum in part (b) using the given floating point
representation. What decimal value for the sum is the computer actually storing? Explain.

In: Computer Science

how to run child process and parent process in parallel/at the same time in python using...

how to run child process and parent process in parallel/at the same time in python using os

In: Computer Science

Why would an organisation review the current systems and processes? What are some of the records...


Why would an organisation review the current systems and processes? What are some of the records an organisation might examine as part of this review? Discuss in 150–180 words.

In: Computer Science

Staff members are reporting an unusual number of device thefts associated with time out of the...

Staff members are reporting an unusual number of device thefts associated with time out of the office. Thefts increased soon after the company deployed a new social networking app.

Which of the following should the Chief Information Security Officer (CISO) recommend implementing? SELECT ONE

A. Automatic location check-ins

B. Geolocated presence privacy

C. Integrity controls

D. NAC checks to quarantine devices

PLEASE ALSO STATE THE CORRECT ANSWER AS WELL AS WHY THE OTHER ANSWERS ARE WRONG, THANKS

In: Computer Science

what are stream manipulators in C++? write a detail note.

what are stream manipulators in C++? write a detail note.

In: Computer Science

Hello guys. Below is a test im struggling with I have to do it in Java...

Hello guys.
Below is a test im struggling with I have to do it in Java and use OOP concepts.


Create.

A House class with instance variables erfNumber, location, noOfRooms,
etc.
Mandatory properties: status(is the asset owned or sold), number of
years owned, selling price, and buying price.
At least two overloaded constructors that can be used to instatiate
House objects.
Getter and setter methods for all properties you have created.
A method checkProfitOrLoss() that returns the profit or loss that can be
made if the property is sold (sellingPrice-buyingPrice).
A custom toString() method to print out all the properties of a House
object.
A static counter to keep track of the number of each object created.
At least 5 more property or vehicle classes such as Farm, Flat, Bakkie,
RentalCar, etc.

A driver class named AssetManager.
An array of five House objects. The same applies to other classes created
in Section B.
Methods to add (remember to keep the sizes of the arrays in mind), sell
assets (sets the status of an asset at a given index of an array to sold), and
print the contents of each of the objects for each array. Each method to
have proper Javadoc comments.
Code to enter from input five of each of the assets into respective arrays
using the add methods just created.
Printing out the contents of all the arrays using the print methods you have
created to provide an initial asset report.
Change the current value of at least 10 objects from the arrays using the
getter and setter methods.
Print out the contents of the assets that can be sold at a profit using the
checkProfitOrLoss method and the methods you have provided an asset
sales report.

In: Computer Science

what are stream manipulators in C++? Write at least 3 short example programs of stream manipulators.

what are stream manipulators in C++? Write at least 3 short example programs of stream manipulators.

In: Computer Science

In Java, design and implement a class called Cat. Each Cat class will contain three private...

In Java, design and implement a class called Cat. Each Cat class will contain three private variables - an integer representing its speed, a double representing its meowing loudness, and a String representing its name. Using the Random class, the constructor should set the speed to a random integer from 0 to 9, the meowing loudness to a random double, and the name to anything you want; the constructor should take no parameters. Write “get” and “set” methods for each variable, and one that prints all the variables. Finally, write a main method to test the methods in the class. The three variables must be private.

Then design and implement a class called CatOwner. Each CatOwner will have three private variables: a String representing the owner name, an integer representing how much cat food is left, and a cat; each cat should be an instance of the Cat class. The constructor can name the CatOwner anything you want, and the supply of food should be a random number greater than or equal to 10 and less than 50. Each cat’s name should be set to “Tinkles.” The constructor for CatOwner should take no parameters. Write “get” and “set” methods for the owner’s name, the food supply, and all the properties of the cat; also write a feedCat method that decreases the food supply by 1 and prints that the cat was fed. Next, write a method to print all class variables. Finally, write a main method to test your methods.

Design a driver class which instantiates two CatOwner objects. Next, perform the following five steps:

1. Change the name of the first cat owner to “John Doe” and his dog’s name to “Whiskers.” Change the name of the second cat owner to “George Washington.”
2. Increase the meowing loudness of the first cat owner’s cat by .1, and set the speed of the second cat owner’s cat to 5.
3. Double the food supply of the first cat owner, and set the food supply of the second to 25.
4. Have the first cat owner feed his cat three times, and have the second cat owner feed his cat twice.
5. Print out all the information for both cat owners.

In: Computer Science