b) a) public abstract myClass ( int result-01 public void add(int x, int y) ( result x + y; } public abstract void print(); ( System.out.print(result); public class myClass ( private int x; public float getX() ( return x; } public void setX(int x) { this.x = x; Jass Page 4 of
Q: Construct SLR parsing table for the grammar: S --> iCtSes | iCtS | a C--> b
A: FIRST / FOLLOW table Nonterminal FIRST FOLLOW S {i,a} {$,e} C {b} {t}
Q: in the complement addition and subtraction, the use of two sign bit to determine the overflow, the…
A: determine the overflow
Q: Define the variables x and y as lists of numbers x=[1, 2, 3, 4, 5] y=[11, 12, 13, 14, 15] If you add…
A: The question has been answered in step2
Q: Construct SLR parsing table for the grammar: S --> iCtSes | iCtS | a C--> b
A: Answer is given below:
Q: O All True or false O O O O The conditional for the loop must only produce either a true or false…
A: According to the Question below the Solution: as per our company guidelines we are supposed to…
Q: The easiest way to describe my understanding of multi-factor authentication is to call it…
A: Interview: Multi factor authorisation is a kind of security that employs a variety of security…
Q: In computer science, what are the seven criteria for picking the best file management system?
A: Computer science: Individual functional areas of a firm (e.g., finance, marketing, operations, and…
Q: What are some symptoms that a laptop's OS has been corrupted?
A: Nowadays, it is typical for a personal computer's operating system, such as a laptop, to be hacked;…
Q: The hierarchical structure of a computer system is usually divided into a microprogramme machine…
A: There are different levels in computer architecture Level 5 - Problem Oriented Language -…
Q: Interrupts have a function, but what is it? What's the difference between an interrupt and a trap?…
A: Interrupts : Interrupts are signals provided by I/O devices to the CPU, instructing the CPU to halt…
Q: Write the equals method for Circle2 which returns true when the radius and the color are the same as…
A: Find the required code in java given as below and output :
Q: How long till an interrupt? How does this affect context switching?
A: Context switching: A context switch is a mechanism used by a computer's CPU (central processing…
Q: When it comes to the design of software systems, performance and security may seem to be…
A: Presentation: To investigate how non-functional requirements such as system performance and security…
Q: It's because of how powerful computers have become in recent years. How is it possible to…
A: Computers have become more prevalent: Computers have been reliable since their inception, but they…
Q: How can you detect whether an app is affecting a device's output? Can the user population expand…
A: OS's stability: A "stable" OS is just one that is not prone to error or is strong enough to handle…
Q: The ideal way to organise your files is to follow the seven computer science criteria listed above.
A: System for filing documents: 1) A file's organization is the mechanism used to represent and store…
Q: A laptop's operating system may show signs of compromise in many ways. How can you detect if this…
A: Operating system: In order to compromise digital devices and networks, hacking is defined as…
Q: e When used in a program, the repetition architecture instructs the computer to repeat one or more…
A: (1) Statement First is true because The repeate/until loop is a loop that executes a block of…
Q: In order to be a good software developer, what four traits are required? In order to improve…
A: According to IBM Research, software development is a set of computer science activities dedicated to…
Q: What are some of the most essential terms associated with the use of Web services?
A: Web services incorporate any product, application, or cloud innovation that gives normalized web…
Q: In addition to analysing and contrasting the similarities and differences between processes and…
A: Thread scheduling comprises two types of limit scheduling: - The application engineer schedules…
Q: What is the significance of information security management in the context of the modern world?
A: Information security management is understood as tool of the information confidentiality,…
Q: Which layers of the OSI protocol are used by the HART digital transmission?
A: Despite the fact that it only has three layers: Application, data link, and physical, the HART…
Q: Methods for developing and modelling software are not identical. It is essential to specify each…
A: Methodology for Software Development : A software process is the segmentation of development…
Q: rehend two-factor authentication. How does it affect password sec
A: Introduction: Below the describe How does it affect password security with compare two-factor…
Q: In what ways are these protocols similar to or distinct from UDP/TCP?
A: TCP is comparatively slower than UDP.
Q: The phrase "software maintenance" refers to any changes made to a software product after it has been…
A: Completing the following procedure: After-delivery software maintenance is modifying a software…
Q: What considerations should be taken into account while deploying and maintaining web applications?
A: The challenges considered in the deployment and maintenance of the web application are given below:…
Q: Using a function, write a program that calculates the area of a rectangle. Your program must accept…
A: Code: <?php function calculateArea($l, $w) { return $l * $w;} $l = readline("Enter the length of…
Q: To correctly characterise multiprocessor systems, it is necessary to understand how they interact…
A: A multiprocessor system comprises several processors and a means of interprocessor communication.…
Q: researching the reasons why computers are so useful. Which four qualities of computers in the modern…
A: The educational system is primarily affected by the following properties of modern computers: -
Q: How does machine learning work?
A: In this question we have to understand about the machine learning and its working. Let's understand
Q: What exactly does "evidence integrity" mean?
A: NOTE :- Below i explain the answer in my own words by which you understand it well. Evidential…
Q: Create a HTML page as the image given below. Add a submit and a reset button at the end of the form.…
A: To create all the elements of a form using HTML and CSS will be able to style the form to resemble…
Q: Examine backup plan sections. What's different between mobile device and PC backup plans?
A: A contingency plan includes the following elements: Parts of a contingency plan One of the…
Q: Explore wearable computing, such as the Apple Watch and Android Wear, and discuss how these devices…
A: Wearable computing: Wearable computing is the study or practice of inventing, designing, building,…
Q: List and describe the approaches used to improve software quality.
A: 1. Test early and Test often with Automation2. Implement quality controls from the beginning3.…
Q: The three-level timing signal provided by the three-stage timing system is ( ). A instruction cycle,…
A: The three-level timing signal provided by the three-stage timing system is instruction cycle,…
Q: Create a Java class with a method to calculate the factorial of a number.
A: The program is written in java. Please check the source code and output in the following steps.
Q: Is it really feasible to evaluate the quality of software when the client continually altering their…
A: Is it really feasible to evaluate the quality of software when the client continually altering…
Q: When removing a node from a linked list, what are the two steps?
A: Introduction: A pointer to the first node of a linked list is used to represent it. The head of the…
Q: Magnetic disc storage, optical disc storage, and magnetic tape storage are three types of physical…
A: Magnetic, Optical, and Magnetic Tape Storage Magnetic discs: Magnetic discs write, rewrite, and…
Q: Describe the process through which intra-AS routing is carried out. Provide some examples of routing…
A: Intra-AS routing protocols are the protocols that are used inside the AS: Within the AS, it is used…
Q: A device's output may be impacted by an application, but how can you tell? Is it possible to…
A: Operation of the operating system: The operating system does not perform any functions on its own,…
Q: Are there any other characteristics that you seek for in a software developer? We'd want to hear…
A: Software developer: To create outcomes, a successful software engineer must be able to interact with…
Q: When managing memory, it is important to differentiate between dynamic and static loading.
A: An operating system's memory management function is responsible for handling and managing primary…
Q: Please provide me with information on the information system capabilities offered by Amazon Web…
A: Аmаzоn Web Serviсes is а соmрrehensive, evоlving сlоud соmрuting рlаtfоrm рrоvided by…
Q: Interrupts have a function, but what is it? What's the difference between an interrupt and a trap?…
A: What is a trap?Traps are created by the user program to aid OS performance. Assume that the user…
Q: When it comes to scheduling individual threads, it is important to examine and contrast the…
A: Scheduling individual threads: To include an image in a tweet, click the (+) symbol to the right of…
Q: Required: a. Which resources constrain how many jobs the service can contract for? b. If WeeMow…
A: Let, R = Number of residential jobs C = Number of commercial jobs Objective function: Maximize Z =…
Step by step
Solved in 2 steps
- JAVA Language Caesar Shift Question: Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.) import java.util.*; public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…26. Assume the declaration of Exercise 24. A. Write the statements that derive the class dummyClass from class base as a private inheritance. (2 lines are { and }.) "A1 is { "A2 is "A3 is )) B. Determine which members of class base are private, protected, and public in class dummyClass. "B1 is dummyClass is a deTrace through the following program and show the output. Show your work for partial credit. public class Employee { private static int empID = 1111l; private String name , position; double salary; public Employee(String name) { empID ++; this.name 3 пате; } public Employee(Employee obj) { empID = obj.empĪD; пате %3D оbj.naте; position = obj.position; %3D public void empPosition(String empPosition) {position = empPosition;} public void empSalary(double empSalary) { salary = empSalary;} public String toString() { return name + " "+empID + " "+ position +" $"+salary; public void setName(String empName){ name = empName;} public static void main(String args[]) { Employee empOne = new Employee("James Smith"), empTwo; %3D empOne.empPosition("Senior Software Engineer"); етрOпе.етpSalary(1000); System.out.println(empOne); еmpTwo empTwo.empPosition("CEO"); System.out.println(empOne); System.out.println(empTwo); %3D етpОпе empOne ;
- Consider the following class definition: (8)class base{public:void setXYZ(int a, int b, int c);void setX(int a);int getX() const { return x; }void setY(int b);int getY() const { return y; }int mystryNum() { return (x * y - z * z); }void print() const;base() {}base(int a, int b, int c);protected:void setZ(int c) { z = c; }void secret();int z = 0;private:int x = 0;int y = 0;};a. Which member functions of the class base are protected?b. Which member functions of the class base are inline?c. Write the statements that derive the class myClass from classbase as a public inheritance.d. Determine which members of class base are private, protected,and public in class myClass.public class date { private int day; // from 1 to 31 private int month; // from 1 to 12 private int year; // from 2000 upwards public void advance (); // move to next day }; Implement a constructor that initializes new objects of date class to be set to the 1st of January 2000. Implement setters for day, month, and year. Implement the advance method, which moves to the next day, ensuring that all data members are updated appropriately.Consider the following class definition: (8) class base { public: void setXYZ(int a, int b, int c) ; voidsetX ( int a ) ; int getX ()const{returnx; } void setY ( int b ); intgetY()const{returny; } int mystryNum () {return ( x &*#x00A0;y - z &*#x00A0;z) ;} void print () const; base () } base(int a, int b, int c); protected: void setz ( int c) { z= c; } void secret(); int z= 0; private: int x= 0; int y = 0; }; a. Which member functions of the class base are protected? b. Which member functions of the class base are inline? c. Write the statements that derive the class myclass from class base as a public inheritance. d. Determine which members of class base are private, protected, and public in class myclass.
- QUESTION 15 public class numClass { private int a; private static int y = 10; public numClass(int newX) {a=newx; } public void set(int newx) { a=newx; y+=a; } public void setY(int newy) { y=newY; } public static int getY() { return y; } }// end of class public class output { public static void main(String[] args) { numClass one = new numClass(10); numClass two = new numClass (2); try{ one. sety(30); two.set(4); if(one.getY()==30) throw new Exception ("30"); one.setY(40); } catch (Exception e) { two.sety (50); } System.out.println(two.getY()); }// end of main } // end of classLecture 15: Clicker Question #2 Given the Student class defined in this lecture: public class Student { private int id; private double gpa; public int getID() public double getGPA() public void setID(int n) ... public void setGPA(double g) . public void print() ... } public Student() public Student(int n, double g) What is the output of the following code snippet? Student bart = new Student(); Student lisa = new Student(345, 3.5); bart.setID(lisa.getID()); System.out.print(bart.getID() + + lisa.getID()); А. 00 В. 0 345 C. 3450 D. 345 345 II E. Something else 31Question 15 1(8).png public class numClass { private int a; private static int y = 10; public numClass(int newx) {a-newx; } public void set(int newx) {a=newx; y+=a;} public void setY(int newY) {y-newY; } public static int getY() { return y; } // end of class Blank 1 Blank 1 Add your answer public class output[ public static void main(String[] args) { numclass one new numClass(10); numclass two new numClass (2); try{ one.sety(30); two.set(4); if(one.getY()-30) throw new Exception ("30"); one. sety (40); } catch(Exception e) { two.setY(50); } System.out.println(two.getY()); // end of main } // end of class ***
- 2. Using Encapsulation concept for Test1 class. package Exam; public class Test1 { private static int index = 0; public int x; Test1(){ index ++; } public static int getlndex () { return index; } public void prints(){ System.out.println("Hi Students!"); } } public class Test2 extends Test1 { @Override public void prints(){ System.out.println("OOP!"); } } public class Main { public static void main(String[] args) { } }Consider the following code segment and answer questions 14 and 15. class Point { public: Point (double x = -99, double y = -99) { this -> xM = x; this -> yM = y;} double getx () {return xM; } double gety () {return yM; } void setx (double x) {this -> xM = x; } void sety (double y) {this -> yM = y; } private: double xM, yM; }; 14. What is the output of the following code snippet: Point pl (100); cout << pl.getx() << " " << pl.gety(); a. The output of the program is: -99 -99 b. The output of the program is: 100 100 c. The output of the program is: -99 100 d. The output of the program is: 100 -99 e. None of the above. It doesn't compile because constructor of Point needs two arguments. 15. How many times does the constructor of class Point get called by the following code snippet: Point a (100, 200); Point b[6]; Point *c = new Point; Point *d = new Point (300, 400); a. Four times b. Three times c. Nine times d. Two times e. None of the abovepublic class Secret private int x; private static int y; public static int count; public int z; public Secret () } X ?t = 2 { public Secret (int a) } { public Secret (int a, int b) } { public String toString() return ("x = " count = " + count); { public static void incrementY () { { 54. How many constructors are present in the class definition above? C. 2 d. 3 b. 1 55. What does the default constructor do in the class definition above? a. Sets the value of x to 0 c. Sets the value of x to 0 and the value of z to 1 d. There is no default constructor. b. Sets the value of z to 1 56. Based on the class definition above, which of the following statements is illegal? Secret.incrementY (); b. Secret.count++3B a. c. Secret. 2++; d. None of these 13