For each of the following languages, state with justification whether it isrecognizableor unrecognizable.(a)LHALT≥376={(〈M〉, x) : machine halts on input after 376 or more steps}(b)LLIKES-SOME-EVEN={〈M〉:Maccepts some even number}(c)L

Answers

Answer 1

Answer:

See the picture attached

Explanation:

For Each Of The Following Languages, State With Justification Whether It Isrecognizableor Unrecognizable.(a)LHALT376={(M,

Related Questions

Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789. Will both of these segments be directed to the same socket at Host C

Answers

Answer:

Yes, both of these segments (A and B) will be directed to the same socket at Host C .

Explanation:

Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789, surely , both of these segments will be directed to the same socket at Host C .

Reason being that,  the operating system will provide the process with the IP details to distinguish between the individual segments arriving at host C- for each of the segments (A and B) recieved at Host C.

Create a class named Billing that includes three overloaded computeBill() methods for a photo book store. When computeBill() receives a single parameter, it represents the price of one photo book ordered. Add 8% tax, and return the total due. When computeBill() receives two parameters, they represent the price of a photo book and the quantity ordered. Multiply the two values, add 8% tax, and return the total due. When computeBill() receives three parameters, they represent the price of a photo book, the quantity ordered, and a coupon value. Multiply the quantity and price, reduce the result by the coupon value, and then add 8% tax and return the total due. Write a main() method that tests all three overloaded methods. Save the application as Billing.java.

Answers

Answer:

Following are the program in the Java Programming Language.

//define class

public class Billing

{

//define method  

public static double computeBill(double Price)  

{

//declare variable and initialize the rate method

double taxes = 0.08*Price;

//print the output  

return Price+taxes;

}

//override the following function

public static double computeBill(double Price, int quant) {

//declare double type variable

double taxes = 0.08*(Price*quant);

//return the output

return (quant*Price)+taxes;

}

//override the function

public static double computeBill(double Price, int quant,double value) {

//declare double type variable

double taxes = 0.08*(Price*quant);

//return the output

return ((quant*Price)+taxes)-value;

}

//define main method

public static void main(String args[]) {

//call the following function with argument

System.out.println(computeBill(10));

System.out.println(computeBill(10, 2));

System.out.println(computeBill(10, 20, 50));

}

}

Output:

10.8

21.6

166.0

Explanation:

Following are the description of the program.

Define class 'Billing', inside the class we override the following function.Define function 'computeBill()', inside it we calculate tax.Then, override the following function 'computeBill()' and pass the double data type argument 'Price' and integer type 'quant' then, calculate tax.Again, override that function 'computeBill()' and pass the double type arguments 'Price', 'value' and integer type 'quant' then, calculate tax.Finally, define the main method and call the following functions with arguments.

The Billing class has three overloaded computeBill methods to calculate the total price of photo books with 8% tax. The methods vary by one, two, or three parameters for price, quantity, and coupon value respectively. The main method tests all three computeBill methods.

Let's create a Billing class with three overloaded computeBill() methods.

Here is the Java implementation:

public class Billing {
public double computeBill(double price) {
double tax = price * 0.08;
return price + tax;
}
public double computeBill(double price, int quantity) {
double total = price * quantity;
double tax = total * 0.08;
return total + tax;
}
public double computeBill(double price, int quantity, double coupon) {
double total = price * quantity;
total -= coupon;
double tax = total * 0.08;
return total + tax;
}
public static void main(String[] args) {
Billing bill = new Billing();
// Test first method
System.out.println("Total for one book: " + bill.computeBill(50.0));
// Test second method
System.out.println("Total for five books: " + bill.computeBill(50.0, 5));
// Test third method
System.out.println("Total for five books with coupon: " + bill.computeBill(50.0, 5, 20.0));
}
}

First identify the formula to compute the sales in units at various levels of operating income using the contribution margin approach. ​(Abbreviations used: Avg.​ = average, and CM​ = contribution​ margin.) ( + ) / = Breakeven sales in units

Answers

Answer:

10 stand scooters and 15 chrome scooters

Explanation:

Data:

The margin approach:

(Fixed expenses + Operating income)/ Weighted average CM per unit = Break even sales in units.

Tallying from the tables, the types and quantities that need to be sold will be like this:

Standard scooters  = 10

Chrome scooters    = 15

Part A [10 points] Create a class named Case that represents a small bookbag/handbag type object. It should contain: Fields to represent the owner’s name and color of the Case. This class will be extended so use protected as the access modifier. A constructor with 2 parameters – that sets both the owner’s name and the color. Two accessor methods, one for each property. (getOwnerName, getColor) A main method that creates an instance of this class with the owner’s name set to ‘Joy’ and color set to ‘Green’. Add a statement to your main method that prints this object. Run your main method

Answers

Answer:

class Case //Case class

{

String owner_name,color; //members to store information name and color

Case(String name,String color) //constrictor with two parameters

{

this.owner_name = name; //members initialization

this.color = color;

}

public String getName() //to get name

{

return owner_name;

}

public String getColor() //to get color

{

return color;

}

public String toString()//override string method

{

return "Case Owner: " + owner_name + ", " + "Color: "+ color;

}

}

class Main //test class

{

public static void main(String args[])

{

String na,color;

Case c = new Case("Joy","Green"); //create instance of class Case and set constructor parameters

na = c.getName();

color = c.getColor();

System.out.println(c);//print statement tp print instance of a class

System.out.println(c.toString()); //print with override toString

}

}

Explanation:

The following program includes fictional sets of the top 10 male and female baby names for the current year. Write a program that creates: A set all_names that contains all of the top 10 male and all of the top 10 female names. A set neutral_names that contains only names found in both male_names and female_names. A set specific_names that contains only gender specific names. Sample output for all_names: {'Michael', 'Henry', 'Jayden', 'Bailey', 'Lucas', 'Chuck', 'Aiden', 'Khloe', 'Elizabeth', 'Maria', 'Veronica', 'Meghan', 'John', 'Samuel', 'Britney', 'Charlie', 'Kim'} NOTE: Because sets are unordered, they are printed using the sorted() function here for comparison

Answers

Answer:

Following are the program in the Python Programming Language.

male_names = {'kay', 'Dev', 'Sam', 'Karan', 'Broly', 'Samuel', 'Jayd', 'Lucifer', 'Amenadiel', 'Anmol'}

female_names = {'Kally', 'Megha', 'Lucy', 'Shally', 'Bailey', 'Jayd', 'Anmol', 'Beth', 'Veronica', 'Sam'}

#initialize the union from male_names and female_names

all_names = male_names.union(female_names)

#Initialize the similar names from male_names and female_names  

neutral_names = male_names.intersection(female_names)

#initialize the symmetric_difference from male_names and female_names

specific_names = male_names.symmetric_difference(female_names)

#print the results

print(sorted(all_names))

print(sorted(neutral_names))

print(sorted(specific_names))

Output:

['Amenadiel', 'Anmol', 'Bailey', 'Beth', 'Broly', 'Dev', 'Jayd', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Sam', 'Samuel', 'Shally', 'Veronica', 'kay']

['Anmol', 'Jayd', 'Sam']

['Amenadiel', 'Bailey', 'Beth', 'Broly', 'Dev', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Samuel', 'Shally', 'Veronica','kay']

Explanation:

The following are the description of the program.

In the above program, firstly we set two list data type variables 'male_names' and 'female_names' and initialize the male and female names in those variables. Then, we set three variables in which we store union, intersection, and symmetric differences and finally print these three variables in a sorted manner.

Write a program to solve a quadratic equation. The program should allow the user to enter the values for a, b, and c. If the discriminant is less than zero, a message should be displayed that the roots are imaginary; otherwise, the program should then proceed to calculate and display the two roots of the eqaution. (Note: Be certain to make use of the squareRoot () function that you developed in this chapter.) (In C language)

Hint: This should not be too hard. You need to get some numbers from the user, do some calculations, check if the discriminate is negative, then use the textbook author’s squareRoot function to finish up the calculations!

program 7.8:

// Function to calculate the absolute value of a number

#include

float absoluteValue(float x)

{

if (x < 0)

x = -x;

return (x);

}

// Function to compute the square root of a number

float squareRoot(float x)

{

const float espsilon = .00001;

float guess = 1.0;

while (absoluteValue(guess * guess - x) >= espsilon)

guess = (x / guess + guess) / 2.0;

return guess;

}

int main(void)

{

printf("squareRoot (2.0) = %f\n", squareRoot(2.0));

printf("squareRoot (144.0) = %f\n", squareRoot(144.0));

printf("SquareRoot (17.5) = %f\n", squareRoot(17.5));

return 0;

}

Answers

Answer:

int main(void) {    float a, b, c, discriminant, root1, root2;    printf("Enter value for a, b and c:");    scanf("%f %f %f", &a, &b, &c);    discriminant = b * b - 4 * a * c;    if(discriminant < 0){        printf("The roots are imaginary");    }else{        root1 = (-b + squareRoot(discriminant)) / (2*a);        root2 = (-b - squareRoot(discriminant)) / (2*a);        printf("Root 1: %f", root1);        printf("Root 2: %f", root2);    }    return 0; }

Explanation:

Firstly, we declare all the required variables (Line 3) and then get user input for a , b and c (Line 4-5).

Next, apply formula to calculate discriminant (Line 7).

We can then proceed to determine if discriminant smaller than 0 (Line 9). If so, display the message to show the roots are imaginary (Line 10).

If not, proceed to calculate the root 1 and root 2 (Line 12-13) and then display the roots (Line 15 -16)

Answer:

// Program to calculate the roots of a quadratic equation

// This program is written in C programming language

// Comments are used for explanatory purpose

// Program starts here

#include<stdio.h>

#include<math.h>

int main()

{

// For a quadratic equation, ax² + bx + c = 0, the roots are x1 and x2

// where d =(b² - 4ac) ≥ 0

// Variable declaration

float a,b,c,d,x1,x2;

// Accept inputs

printf("Enter a, b and c of quadratic equation: ");

scanf("%f%f%f",&a,&b,&c);

// Calculate d

d = (b*b) - (4*a*c);

// Check if d > 0 or not

if(d < 0){ // Imaginary roots exist

printf("The roots are imaginary");

}

else // Real roots exist

{

// Calculate x1 and x2

x1= ( -b + sqrt(d)) / (2* a);

x2 = ( -b - sqrt(d)) / (2* a);

// Print roots

printf("Roots of quadratic equation are: %.3f , %.3f",x1,x2);

}

return 0;

}

return 0;

}

Other Questions
You Save Bank has a unique account. If you deposit $7,250 today, the bank will pay you an annual interest rate of 4 percent for 5 years, 4.6 percent for 4 years, and 5.3 percent for 8 years. How much will you have in your account in 17 years In a constantpressure calorimeter, 70.0 mL of 0.310 M Ba ( OH ) 2 was added to 70.0 mL of 0.620 M HCl . The reaction caused the temperature of the solution to rise from 21.12 C to 25.34 C. If the solution has the same density and specific heat as water, what is heat absorbed by the solution? Assume that the total volume is the sum of the individual volumes. (And notice that the answer is in kJ). What is the value of d? How much Ca3(PO4)2(s) could be produced in an industrial process if 55.00 g of CaCl2 in solution reacted completely with sufficient Na3(PO4) (aq) help me pass this course please somebody, anybody Using the points (0, 0), (6, 0), and (0, 8) to form a triangle, find the length of the three sides of the triangle.7, 8, 56, 8, 108, 6, 36, 8, 9 Note: Enter your answer and show all the steps that you use to solve this problem in the space provided.Find the area of the complex figure.Not drawn to scale. Triangle SRQ undergoes a rigid transformation that results in triangle VUT. 2 right triangles with identical side lengths and angle measures are shown. The second triangle is shifted up and to the right. Which statements are true regarding the transformation? Select two options. SQ corresponds to VU. AngleR corresponds to AngleU. UV corresponds to RS. AngleS corresponds to AngleT. QS corresponds to RS. Need some help please Which cell organelle contains coded directions for production of proteins? Question 3 options: endoplasmic reticulum lysosome Golgi apparatus nucleus Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789. Will both of these segments be directed to the same socket at Host C There is a large push in the united states currently to convert incandescent light bulbs more energy-efficient technologies, including compact fluorescent lights and light-emitting diodes. The lumen [lm] is the SI unit of luminous flux, a measure of the perceived power of light. To test the power usage, you runan experiment and measure the following data. Create a proper plot of these data, with electrical consumption (EC) on the ordinate.Electrical Consumption [W]Incandescent CompactLuminous Flux [lm] 120 Volt Fluorescent80 16200 4400 38 8600 55750 68 131,250 181,400 105 19 The measurements obtained for the interior dimensions of a rectangular box are 200 cm by 200 cm by 300 cm. If each of the three measurements has an error of at most 1 cm, which of the following is closest to the maximum possible difference, in cubic cm, between the actual capacity of the box and the capacity computed using these measurements?A. 100,000.B. 120,000.C. 160,000.D. 200,000.E. 320,000. Economic growth will A. be faster if more capital per hour is used because of increasing returns to capital. B. slow down or stop if more capital per hour is used because of diminishing returns to capital. C. not be affected because the key to economic growth is capital accumulation whether there are diminishing returns or not. D. not be sustained if developing countries stop accumulating capital because of diminishing returns to capital. Some economies are able to maintain high growth rates despite diminishing returns to capital by using A. better or enhanced technology, along with accumulating capital; these economies are growing because technology, unlike capital, is subject to increasing returns. B. a larger proportion of capital, thereby making their production capital intensive, so the sheer volume of capital protects them from diminishing returns to capital. C. a labor-intensive technology because labor, unlike capital, is not subject to diminishing returns. D. a newer production method that, if used properly, produces increasing returns to capital. Carolina breeds Dachshunds and is an active participant in dog shows. Although her fellow dog enthusiasts hold the values of mainstream society, they also have strong beliefs about the importance of animals and believe animals are as important as humans in society. Carolina is the member of a:________.a. categoryb. collectivec. subcultured. counterculture Credit sales are collected as follows:65 percent in the month of the sale.25 percent in the month after the sale.10 percent in the second month after the sale. The accounts receivable balance at the end of the previous quarter was $94,000 ($64,000 of which were uncollected December sales). a.Calculate the sale What do you see as the major strengths and flaws in the feedback control system used in the schools in this scenario? What changes do you recommend to overcome the flaws? Linux is a kind of software whose code is provided for use, modification, and redistribution, at no cost. What kind of software would this be considered from the choices available? Group of answer choices client/server subscription open source SourceForge Alina is flying a kite. The kite string is fully extended and measures 100 feet in length. The kite is 45 feet east of Alina. Which equation can be used to find the height of the kite? How high is the kite? Select two answers The following annual amounts pertain to ABC Company: Estimated Overhead Costs $ 101,988 Estimated Direct Labor hours 67,992 If actual direct labor worked in February was 6,000 hours, how much overhead cost would be applied to work-in-process for the month Choose the best graph that represents the linear equation:4x + y = 0i need help please