output
Q: what is length [0] variable ?
A: Here length [0] means length is an array and with 0 inside the parenthesis means we are accessing th...
Q: b. y(x)=x[x|, -10<x<10 (Consider step size of 0.1)
A: Question :-
Q: Which of the following is not a class of information system applications O a Database Management Sy...
A: Application software are the most common programs that run in the foreground of the computer.
Q: Write a function strlen that takes one char str[] as an argument, and return the number of character...
A: #include<iostream> using namespace std; //strlen function return length of str int strlen(cha...
Q: Modify the given machine below so that it supports the jr (i.e., jump register) instruction. Yo...
A: Here explain you which control signal don't care. 1.RegDst=X don't care where the register to be sto...
Q: Q1/ complete the following blanks 1 . A window used to enter variables 2- .it is a command that dele...
A: This question comes from matlab programming in Computer Science.
Q: QUESTION 17: Kindly convert the below nfs to dfa
A: We have to convert the given nfs to dfa. DFA: DFA stands for Deterministic Finite Automata. In this,...
Q: Let G = ({S. C}, {a, b}, P, S), where P consists ofS → aCa, C - aCa | b. Find L(G).
A: Question :-
Q: A binary ripple counter is required to count up to 16,38310: How many FFs are required? If the clock...
A: Given:
Q: Assume that: P(x) means: x is a person; T(y) means: y is a time F(x, y) means: you can fool x at tim...
A: Conversion of predicate to english
Q: Using MATLAB or Octave P=P0*e^(r*t) where P=current population; P0=initial population r=continuous ...
A: First, we will define the function cal_pop() After that, we will assign values to P0=140 mice; r=60%...
Q: Briefly explain the concept and use of a box-plot.
A: Answer: Briefly explain the concept and use of a box plot.
Q: Call graphs G and H isomorphic if the nodes of G may be reordered so that it is identical to H. Let...
A: Call graphs G and H isomorphic if the nodes of G may be reordered so that it is identical to H. Let ...
Q: Q3) Create two row vectors: a=2:3:17 and b=3:4:15. Then, by only using the name of the vectors (a an...
A: Question :
Q: Consider a context-free grammar G with the following productions, S → ASA B В > аСЬ | bСа C'→ ACA | ...
A: Question :-
Q: What is a counter?
A: Counters are used to count pulses in specific events.
Q: Define the term " numbering sign and magnitude " .
A: Numbering sign and magnitude also know as signed magnitude numbering system is used to represent sig...
Q: public class LabFinalExam_4 { private int add(int[] a){ for(int i = 0;i<5;i++) a[5-i] = a[i]; return...
A: Given :
Q: Given the code segment: char x[8]; scanf("%s",x); printf("The string is %s\n",x); if the user entere...
A: char x[8]; scanf("%s",x); printf("The string is %s\n",x);
Q: What will be the output of given code. #include using namespace std; int add(int a,int b){ retu...
A: Given: What will be the output of given code. #include<iostream>using namespace std; int add...
Q: How do you compare Categorical Cross-Entropy with Binary Cross-Entropy ?
A: Ans-: With binаry сrоss entrорy, yоu саn оnly сlаssify twо сlаsses. With саtegоriсаl сrо...
Q: Define the term " pointer variable " .
A: Pointer is a variable which is used to point to some variable. We define pointer as int *p; char *p...
Q: pply ABC technique on the following processes. Find total waiting time and utilization a the followi...
A: Using First Come First Serve for tatal waiting time
Q: When does a compiler generate a default constructor?
A: In C++, compiler makes a default constructor on the off chance that we don't characterize our own co...
Q: Q4. (A) Write a program that reads from the user a string matrix with NXN dimension. The matrix is f...
A: Since no programming language was mentioned, the code below is in Java language. Code: import java...
Q: The "variable" defined in the parameter statement is not a variable but rather a constant whose valu...
A: To determine whether the given statement about parameter variable is True or False.
Q: Design a layout in Android Studio Requirements: 1 Image 1 textview 1 button 1 checkbox 1 radio but...
A: Solution. Given, Software = Android Studio Requirements: 1 Image 1 Textview 1 Button 1 Checkbox 1...
Q: Write a C++ program following the instructions below. Please follow the order of the tasks given bel...
A: 1.
Q: A) You need to create two passwords to a system; both these passwords are stored in a string matrix ...
A: As there is no language mentioned, here C language has been used to design the code.
Q: a) Write the code for following output. Hint:Use CSS opacity.(You can take any image)
A: The HTML is stand for Hyper Text Markup Language. It describing the structure of web pages.
Q: Explain what is hardening and the importance of a minimal installation on a Linux OS.
A:
Q: Using MATLAB or Octave (a) prompt the user for what the current wind seed is outside their locatio...
A: %avalue = input('Enter current wind seed outside:')%prompting and reading input%b%displaying type of...
Q: Construct parsing table for given grammar and determine whether given grammar is CLR or Not? S->AA A...
A: Here, one grammar is given, S -> AAA -> aA/b We have to check whether this grammar is CLR or N...
Q: Find the complement and the dual of the function given below and then reduce it to a minimum number ...
A: Given: The given expression is, F=[(ab)'a][(ab)'b]
Q: What is the function of an I/O interface?
A: To be determine: What is the function of an I/O interface?
Q: Write a Java Code for the following question along with the output. Weight of a hill pattern Given, ...
A: Start Input number of levels Input head value Input step value Initialize total to 0 Add head value ...
Q: In the TCP we are using AIMD for congestion control, assume that after every fourth transmission tim...
A: Introduction : Given, A TCP which is using AIMD for the congestion control and slow-start phase star...
Q: __________ is the default behavior when an object is assigned the value of another object of the sam...
A: Ans:- memberwise assignment
Q: Define the term " pointer compatibility " .
A: Two pointer types with a similar sort qualifiers are viable on the off chance that they highlight ob...
Q: Write a code in matlab which enables a user to input the coefficients of a quadratic q(x) = ax2 + bx...
A: Required: Write a code in Matlab which enables a user to input the coefficients of a quadratic q(x) ...
Q: State the purpose of the QCP statement.
A: QCP specifies management and control of design and QCP documents.
Q: The microprocessor has two hardware interrupt inputs: non-maskable interrupt (NMI) and interrupt req...
A: Interrupt is the method of creating a temporary halt during program execution and allows peripheral ...
Q: Give the output from this code fragment: int *p1, *p2; p1 = new int; p2 = new int; *...
A: 1) Above code fragment create two integer pointer variable(p1 and p2) and dynamically allocate memor...
Q: xplain Local Descriptor Table?
A: Local descriptor table (LDT) : There are 3 different types of descriptor table Global descriptor ta...
Q: Q6. (a) Consider a (7, 4) cyclic code with generator matrix g(x) = 1+ x + x³, find the data word sen...
A: The data word sent if the sequence is recieved and Check bits
Q: What does this logic circuit output? 1 1 0 1 1 0 0 0
A: AND Gate: Truth Table: A B Output Y= (A.B) 0 0 0 0 1 0 1 0 0 1 1 1 OR Gate: Trut...
Q: how can you read array of size (4*3) row by row
A: In this problem, we will discuss about how to read from a 4*3 array row by row in Java Language.
Q: How to write a Dialogue
A:
Q: assembly language to machine language . .is Compiler O -Interpreter O Assembler O Comparator O
A: Q1. Assembler is used to assemble the code at the compile time if any library is missing. Therefor...
Q: Design a layout in Android Studio Requirements: 1 ImageView 1 textview 1 button 1 checkbox 1 radio...
A: Que. Design a layout in Android Studio Requirements: 1 ImageView 1 textview 1 button 1 checkbox 1 ...
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
What is the output of given code.
#include<iostream>
using namespace std;
int add(int a,int b){
return (a+b);
}
int main(){
int a=5,b=3;
cout<<add(a,b)<<endl;
}
Step by step
Solved in 3 steps with 2 images
- Here thr____Calculator.java, to accept an expression as astring in which the operands and operator are separated by zero or more spaces.For example, 3+4 and 3 + 4 are acceptable expressions. Here is a sample run:++In java there must be at least two calls to the function with different arguments and the output must clearly show the task being performed. Develop a function that accepts an array and returns true if the array contains any duplicate values or false if none of the values are repeated. Develop a function that returns true if the elements are in decreasing order and false otherwise. A “peak” is a value in an array that is preceded and followed by a strictly lower value. For example, in the array {2, 12, 9, 8, 5, 7, 3, 9} the values 12 and 7 are peaks. Develop a function that returns the number of peaks in an array of integers. Note that the first element does not have a preceding element and the last element is not followed by anything, so neither the first nor last elements can be peaks. Develop a function that finds the starting index of the longest subsequence of values that is strictly increasing. For example, given the array {12, 3, 7, 5, 9, 8, 1, 4, 6}, the function…Output operations are supported by class_________________
- In java there must be at least two calls to the function with different arguments and the output must clearly show the task being performed. (ONLY ARRAYS or ARRAYLIST) Develop a function that accepts an array and returns true if the array contains any duplicate values or false if none of the values are repeated. Develop a function that returns true if the elements are in decreasing order and false otherwise. A “peak” is a value in an array that is preceded and followed by a strictly lower value. For example, in the array {2, 12, 9, 8, 5, 7, 3, 9} the values 12 and 7 are peaks. Develop a function that returns the number of peaks in an array of integers. Note that the first element does not have a preceding element and the last element is not followed by anything, so neither the first nor last elements can be peaks. Develop a function that finds the starting index of the longest subsequence of values that is strictly increasing. For example, given the array {12, 3, 7, 5, 9, 8,…in C for STM32F446RE microcontroller Write a source library that contains the with the following public functions: void keypadInit(void); /Initiallized the GPIO to read the keypad. uint16_t readKeypad(void); //Returns the state of all of the keypad buttons in the return value at the moment the function is called. void decodeKeypad(uint16_t, char *); //Takes the state of the keypad and returns (by reference) an array of the key's pressed. The library should work with the following main: int main (void) { uint16_t key; char carray[17]; keypadInit(); while(1) { while(!(key = readKeypad())); /*Get which keys pressed*/ decodeKeypad(key, carray); /*What are those keys*/ printf("%s\n",carray); /*Print those keys to screen*/ while(readKeypad() == key); /*Wait for the keypad to change*/ }} Problem 1: Write a library that works with the following pin assignments R0 -> PC0 R1 -> PC2 R2-> PC4 R3 ->…In java Develop a function that takes two integers and returns the sum of the values from the first to the second (the two inputs may be in any order). Call the function at least twice with different arguments Develop a void function PrintLineOfChar that accepts a single character and an integer. The function prints a single line of the character repeated the integer number of times. Call the function at least twice with different arguments.
- T/F In Java a constructor must always return an int.In C++ The function below, zeroesToFives takes an array of integers and changes any zeroes in the array to fives and returns the count of array elements that were updated. Write at least ten test cases using assertions for zeroesToFives. You should test at least three boundary/edge cases."Pointers are known to have issues with dangling and wild pointers." With the use of appropriate examples, justify the stated statement.
- This is in c++ The base class Pet has private data members petName, and petAge. The derived class Dog extends the Pet class and includes a private data member for dogBreed. Complete main() to: create a generic pet and print information using PrintInfo(). create a Dog pet, use PrintInfo() to print information, and add a statement to print the dog's breed using the GetBreed() function. main.cpp #include <iostream> #include<string> #include "Dog.h" using namespace std; int main() { string petName, dogName, dogBreed; int petAge, dogAge; Pet myPet; Dog myDog; getline(cin, petName); cin >> petAge; cin.ignore(); getline(cin, dogName); cin >> dogAge; cin.ignore(); getline(cin, dogBreed); // TODO: Create generic pet (using petName, petAge) and then call PrintInfo // TODO: Create dog pet (using dogName, dogAge, dogBreed) and then call PrintInfo // TODO: Use GetBreed(), to output the breed of the dog } Dog.cpp #include "Dog.h" #include…Q3. Write two short programs explaining the use of static data members and functions in java.Need help with C++ Question. The question is attatched as a image, and the code is copied below: #include <iostream> 2 using namespace std; 3 4 class Student { 5 public: 6 friend Student OutputDuplicate (Student obj); // friend function 7 8 Student (); // Default constructor 9 10 Student (string n); // String constructor 11 12 Student (const Student & obj); // Copy constructor 13 14 Student& operator= (const Student & right); // Assignment operator 15 16 ~Student() ; // Destructor 17 18 private: 19 string name; 20 21 }; 22 23 // Default constructor 24 Student::Student() : name("no name") 25 { 26 // Intentionally left blank 27 } 28 29 // String constructor 30 Student::Student(string n) : name(n) 31 { 32 // Intentionally left blank 33 } 34 35 // Copy constructor 36 Student::Student(const Student &…