class A { int m=20, n-D30; void display() System.out.println(m); Elass B extends A{ int n=40; void display() System.out.println(n); Lass Main nuhlic static void main(String[] ar
Q: python pr
A: I have written python code for the following question:
Q: top come out?
A: A laptop, often known as a notebook computer or laptop, is a small, portable computer with a screen ...
Q: the meaning of the dot in from of the directory name “.puta” and “.t0rn”?
A: The meaning of the dot in from of the directory name “.puta” and “.t0rn” in linux means these folde...
Q: Question 7
A: Answer of question 7 the code looks like follow: int main(int argc, char*argv[]) { while(1) { ...
Q: The capacity of the memory am defined ty eber of wond mplied by the ber of hitswoed How many wparaie...
A: The capacity of a memory unit is defined by the number of words multiplied by the number of bits/ wo...
Q: Alice and Bob use the ElGamal scheme with a common prime q= 131 and a primitive root a = 6. Let Bob’...
A: The answer is
Q: Prove that C = {w|w has an equal number of 0s and 1s} is not regular. Consider the string s=0p1p.
A: If A is a regular language, then there is a number p (the pumping length) where if s is any string i...
Q: When transmitting data back and forth to the cloud, physicians must follow HAPAA regulations; penalt...
A: Measures done to ensure the safety of patients ConfidentialityEach individual's medical information ...
Q: C++ Programming Question Explains the number of methods from which we can take the string input from...
A: Explain the methods from which we can take string input from the user.
Q: Convert the following PDA to a CFG.( Correct answer only). Proper steps and conversion
A: Convert the following PDA to a CFG.( Correct answer only).
Q: Define the term "virtual machine" and explain why it is necessary.
A: Introduction: A virtual machine is created on a physical hardware system (off-premises) that acts as...
Q: Extend DATAVIEW to support some blockchain features, such as the support of Metatask, a new token to...
A: Blockchain can enable Universal Basic Income, (UBI) through a system like Circles, or power local cu...
Q: The value of the keyboard flag byte is returned by which INT 16h function
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful. Tha...
Q: Using doc function, determine what the dot-forward slash (./) operator does.
A: . is a current list shorthand and is used in Linux and Unix to create an integrated program for the ...
Q: Variable x' is assigned to X19 Variable 'y' is assigned to X20 Assume the operation returns the abso...
A:
Q: 28. Write an assembly language program that corresponds to the following C++ program: #include usin...
A: Given :- Write an assembly language program that corresponds to the following C++ program:#include ...
Q: Consider the adjacency matrix below. Upload a picture (it can be hand drawn) of the adjacency list o...
A: Dear student, We valued your time but as per guidelines, I can answer the only first question. Pleas...
Q: Alice and Bob use the ElGamal scheme with a common prime q= 131 and a primitive root a = 6. Let Bob'...
A: Key generation Common prime q=131 primary root αα = 6 Bob's public key YBYB =3 Random integer chosen...
Q: PARALLEL AND DISTRUBUTED COMPUTING write code in c++
A: CODE:- In C++ program of multiplication of matrix n*n. #include <iostream> using namespace s...
Q: I need to write 2-3 pages report of "fake news detection" which is the topic of my project. in this ...
A: Let's discuss the solution in the next steps
Q: Develop a c programm that reads a text file (input1.txt) containing a list of sentences and, for eac...
A: import re def open_file(): ##method to open a file while(True): text = raw_input("Ente...
Q: A security analyst receives an alert regarding multiple logins to the corporate doud infrastructure ...
A: As per Bartleby guidelines, Since you have asked multiple question, we will solve the first question...
Q: What is the difference between an interrupt service routine and a regular service routine?
A: An interrupt service routine (duh!) services an "interrupt". An "interrupt" is pretty much that -- t...
Q: Total = a +b +c; Average = Total /6; A. Logic Errors B. Run-time Errors C. O С. None of the above Sy...
A: Answer : It is a logical error . As there are three variables in the total and the sum of three var...
Q: 4-5 A Girl Scout needs to calculate the total dollar amount of her cookie orders. User input should ...
A: Given :- 4-5 A Girl Scout needs to calculate the total dollar amount of her cookie orders. User inpu...
Q: Consider the int Array below and determine the values of A and B so that Array[0] has an integer in ...
A: The question is to find the values of A and B.
Q: 3 per minute and each is expected to use the software for 20 minutes (1 student stops using
A: The answer is
Q: mass is in kg and height is in m) vars %>% mutate(mass height^2) % mutate(mass/(height/100)^2) vars ...
A: BMI <- starwars$mass / (heightm^2) starwars$BMI = BMI starwars %>% mutate(name, bmi = mass...
Q: What is the default visual mode when a computer is launched under MS-DOS?
A: Introduction: MS-DOS, IBM PC DOS, and certain operating systems that try to be compatible with MS-DO...
Q: You have a graph G = , |V| = n and |E| = m (represented using adjacency matrix you can). Given such ...
A: Java code for the brute- force algorithm for the given graph import java.util.*; public class Graph...
Q: When did the mechanical computer first come out?
A: The answer is as follows.
Q: 2. Write a program to graph the following equation in the interval. The interval step size is 0.5. C...
A: Introduction:
Q: The chip select kogie for a cenais DRAM chip in a memory system desigs is shoan belew Assume that de...
A: The answer is here
Q: What is the IEEE-754 single precision real number after encodingt the real decimal number -76.0625? ...
A: The correct option is b For details check image below
Q: Consider the figure below, which draws the analogy between store-and-forward link transmission and ...
A: 1) When a car enter service at the tollbooth, it takes 1 second service time. 2) It takes 10 second ...
Q: show your work text not a picture -35 (base 10) = ____________________________ (8-bit Excess-M bi...
A: Converting -35 to base 10. -*102=0 3*101=30 5*100=5 Adding all to get Ans=3510
Q: Write a Java program to display the push, peek & pop operation on the stack.
A: import java.util.Stack; public class Main{ public static void main(String[] args) { Stack<...
Q: What can you do with a DWORD?
A: -It is a short for (double word). -basically it is a data type definition which specific to microsof...
Q: Describe various employment legal documents including: non-disclosure agreements, non-compete clause...
A: An employee is prohibited from exposing any of the employer's private information, business processe...
Q: C++ Imagine you have to verify the type of integer variable foo below, include header print to s...
A: C++ Imagine you have to verify the type of integer variable foo below, include <typeinfo> he...
Q: Define the term "virtual machine" and explain why it is necessary.
A: Virtual Machine: It is a machine created on a physical hardware system (off-premises) that acts as a...
Q: How are truly distributed systems modeled?
A: A distributed system uses resources from different system located on multiple networks. Distributed ...
Q: Appendix 1: UI Layer DriveWell Inc. Aphumme n h Cart detals VN Mamber Ca2 detals Carl deta Car Make ...
A: Answer: HTML and CSS Source Code: <!DOCTYPE html> <html lang="en"> <head> &l...
Q: In Matlab using ode23 comment, plot c,t graphs Data: Q=constant= 300 L/min, V= constant= 50 000 L, ...
A: Given that: Data: Q=constant= 300 L/min, V= constant= 50 000 L, t=0; C=Co,
Q: Task: Assume that your Student ID (e.g. 2018123456) is a fractional decimal and hexadecimal number w...
A: This question belongs to digital electronics . It is based on the conversion of decimal into binary
Q: What is the SI/DH register's code?
A: Introduction: The 16-bit index registers are called SI (Source Index) registers. It is used to condu...
Q: Consider a system implementing multilevel queue scheduling. What strategy can a computer user employ...
A: Answer: The software might optimise CPU time by not completely using its time quantums.Using a big p...
Q: Let A %3D (с, n, b), В%3 (х, у) and C %3 (0, 1). Find a) AXBXC b) СХВХА с) ВХСХ
A: The cartesian product of 3 sets produces another set such that, the new set has tuples of 3 elements...
Q: Which kind of parallelism (data or control) is optimal for SIMD? What kind of parallelism does MIMD ...
A: Introduction: Program-level parallelism is decentralizing a single program and running it on several...
Q: ould be men
A: given - At least three FPU special-purpose registers should be mentioned.
Step by step
Solved in 2 steps with 1 images
- Write a client program that loops around getting two fractions from the user,output their sum, and state whether or not they are equal. Keep looping until the first fraction entered is a zero fraction. import java.util.ArrayList;import java.util.Scanner; //Define the class Fractionclass Fraction{private int n, d;public Fraction(){//Initialize the valuesthis.n = this.d = 0;}public Fraction(int n, int d){//Initialize the variablesthis.n = n;this.d = d;}//Define the getter function getNum() that returns the numeratorpublic int getNum(){//Returns numeratorreturn n;}//Define the getter function getDen() that returns the denominatorpublic int getDen(){//Returns denominatorreturn d;}//Define the boolean function isZero() that returns 0 if numerator is 0 and denominator is not equals to zeropublic boolean isZero(){return(getNum() == 0 && getDen() != 0);}public boolean isequals(Object c){Fraction f = (Fraction) c;return(Integer.compare(n,f.n))==0 &&…Consider class IntArrayStack that has two instance variables: int[] data and int top. Implement an instance method inside the IntArrayStack, called popBottom(),that extracts and returns as output the element at the bottom of the stack. All other elements in the stack must remain unchanged and in the same order.(A) Write a program for the Online Turing Machine Simulator to simulate a Turing Machine with one tape that recognizes the language O. Language O {w | w ∈ {a, b}* and a(w) <= b(w)} a(w) = number of a's in a string w. b(w) = number of b's in a string w. (B) Test the Turing Machine with one tape for: one string from the language O one string from the language M or language N Language M M = {w | w ∈ {a, b}* and a(w) == b(w)}. a(w) = number of a's in a string w. b(w) = number of b's in a string w. Language N N = {w | w ∈ {a, b}* and a(w) >= b(w)}. a(w) = number of a's in a string w. b(w) = number of b's in a string w.
- public class Soru32{ // Returns length of LCS for X[0..m-1], Y[0..n-1] static void lcs(String X, String Y, int m, int n) { int[][] L = new int[m+1][n+1]; // Following steps build L[m+1][n+1] in bottom up fashion. Note // that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] for (int i=0; i<=m; i++) { for (int j=0; j<=n; j++) { if (i == 0 || j == 0) L[i][j] = 0; else if (X.charAt(i-1) == Y.charAt(j-1)) L[i][j] = L[i-1][j-1] + 1; else L[i][j] = Math.max(L[i-1][j], L[i][j-1]); } } // Following code is used to print LCS int index = L[m][n]; int temp = index; // Create a character array to store the lcs string char[] lcs = new char[index+1]; lcs[index] = '\u0000'; // Set the terminating character // Start from the right-most-bottom-most…public class Soru32{ // Returns length of LCS for X[0..m-1], Y[0..n-1] static void lcs(String X, String Y, int m, int n) { int[][] L = new int[m+1][n+1]; // Following steps build L[m+1][n+1] in bottom up fashion. Note // that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] for (int i=0; i<=m; i++) { for (int j=0; j<=n; j++) { if (i == 0 || j == 0) L[i][j] = 0; else if (X.charAt(i-1) == Y.charAt(j-1)) L[i][j] = L[i-1][j-1] + 1; else L[i][j] = Math.max(L[i-1][j], L[i][j-1]); } } // Following code is used to print LCS int index = L[m][n]; int temp = index; // Create a character array to store the lcs string char[] lcs = new char[index+1]; lcs[index] = '\u0000'; // Set the terminating character // Start from the right-most-bottom-most…Using Jcreator, open, compile, and run java and observe its runtime. Write your observation regarding how encapsulation works for the program and the data it processed. Limit your paper to a single paragraph with at least 50 words or five (5) sentences. Source code: public class EncapTest { private String name; private String idNum; private int age; public int getAge() { return age; } public String getName() { return name; } public String getIdNum() { return idNum; } public void setAge( int newAge) { age = newAge; } public void setName(String newName) { name = newName; } public void setIdNum( String newId) { idNum = newId; }} public class RunEncap { public static void main(String args[]) { EncapTest encap = new EncapTest(); encap.setName("James"); encap.setAge(20); encap.setIdNum("12343ms"); System.out.print("Name : " + encap.getName() + " Age : " + encap.getAge()); }}
- From Big Java 6th edition P9.7: "In this problem, you will model a circuit consisting of an arbitrary configuration of resistors. Provide a superclass Circuit with a instance method getResistance. Provide a subclass Resistor representing a single resistor. Provide subclasses Serial and Parallel, each of which contains an ArrayList<Circuit>. A Serial circuit models a series of circuits, each of which can be a single resistor or another circuit. Similarly, a Parallel circuit models a set of circuits in parallel; using Ohm's Law to compute the combined ressistance." I managed to create appropriate subclasses off of the Circuit superclass. But from here, I'm stuck! How do I compute the combined resistance? and how would I get the method to read the values off of the ArrayList<Circuit>? And does that Circuit refer to the Circuit Class I created, or would that require input for resister amounts?2. Using Java notation, suppose A is the alphabet {'a','b','c' }List the labels of all strings in A* from among thefollowing. a. "" b. "aa" c. "bb" d. "abc"e. "abcd" f. "aaaaaaaa..." (an infinite string ofa's) -> (THIS IS THE PROBLEM #3) <- 3. For alphabet A of the last problem, how many length 4stringsare there in A*?a. 3 b. 4 b. 12 c. 27 d. 81 e. 64 f. 128For lexer.java, please add the following state machines and produce the same output: private Token processWord() { StringBuilder value = new StringBuilder(); while (!stringHandler.isDone() && (Character.isLetterOrDigit(stringHandler.peek(0)) || stringHandler.peek(0) == '_' || stringHandler.peek(0) == ',')) { value.append(stringHandler.getChar()); charPosition++; } return new Token(TokenType.WORD, value.toString(), lineNumber, charPosition - value.length()); } private Token processNumber() { StringBuilder value = new StringBuilder(); while (!stringHandler.isDone() && (Character.isDigit(stringHandler.peek(0)) || stringHandler.peek(0) == '.')) { value.append(stringHandler.getChar()); charPosition++; } return new Token(TokenType.NUMBER, value.toString(), lineNumber, charPosition - value.length()); }
- Please implement in Java implement a keyed bag in which the items to be stored are strings (perhaps people’s names) and the keys are numbers (perhaps Social Security or other identification numbers). So, the in- sertion method has this specification: public void insert(String entry, int key);// Precondition: size( ) < CAPACITY, and the // bag does not yet contain any item// with the given key.// Postcondition: A new copy of entry has// been added to the bag, with the given key. When the programmer wants to remove or retrieve an item from a keyed bag, the key of the item must be specified rather than the item itself. The keyed bag should also have a boolean method that can be used to determine whether the bag has an item with a specified key. In a keyed bag, the pro- grammer using the class specifies a particular key when an item is inserted. Here’s an implementation idea: A keyed bag can have two private arrays, one that holds the string data and one that holds the corresponding…Write a library of static methods that performs various geometric transforms on polygons. Mathematically, a polygon is defined by its sequence of vertices (x0, y 0), (x 1, y 1), (x 2, y 2), …. In Java, we will represent a polygon by storing the x– and y-coordinates of the vertices in two parallel arrays x[] and y[]. Three useful geometric transforms are scale, translate and rotate. Scale the coordinates of each vertex (x i, y i) by a factor α. x‘i = α xi y‘i = α yi Translate each vertex (x i, y i) by a given offset (dx, dy). x‘i = xi + dx y‘i = yi + dy Rotate each vertex (x i, y i) by θ degrees counterclockwise, around the origin. x‘i = xi cos θ – yi sin θ y‘i = yi cos θ + xi sin θ Write a two-dimensional transformation library by implementing the following API: public class PolygonTransform { // Returns a new array object that is an exact copy of the given array. // The given array is not mutated. public static double[] copy(double[] array) // Scales the polygon by the factor…Please help debug this: Debugging Exercise 4-3, Farrell, Joyce, Java Programming, 9th edition, Cengage Learning public class DebugBox { private int width; private int length; private int height; private FixDebugBox() { length = 1; width = 1; height = 1; } public DebugBox(int width, int length, int height) { width = width; length = length; height = height; } public void showData() { System.out.println("Width: " + width + " Length: " + length + " Height: " + height); } public double getVolume() { double vol = length - width - height; return vol; } }