(b) Person -name:String -address:String Person(name:String, address:String) getName ():String +getAddress():Sstring setAddress(address:String):void +tostring():String "Person(nane-?, address-?)" extends Student Staff progran: String year: int fee:double -school:String payi double +Student (name:String, address:String, progran: String. year: int, fee:double) *getProgram() :String +setProgram(program:String) void getYear(): int *setYear(year int) void getfee(): double +setfee(fee:double):void tostring()iString +Staff(nane:String, address:String, school:String, pay:double) *getSchool():String +setschool(schol:String): void *getPay():double +setPay(pay: double):void +tostrine():String "Staff(Person(nane, address), schoolet,paya?]" "Student (Person[name-?, addresse?]. progran-?, year ?, fee-?}"
Q: Word Separator Write a program that accepts as input a sentence in which all of the words are run…
A: The objective is to write a program code that accepts as input a sentence in which all of the words…
Q: in c# Write a console app that inputs a sentence from the user (assume no punctuation), then…
A: The program is written in step 2
Q: public class StudentsLI extends Students{ public String svName; public String companyName; public…
A: I created a override grading method as per your requirement and also gives the code along with…
Q: 3. Word Counter Write a function that accepts a pointer to a C-string as an argument and returns the…
A: PROGRAM: #include<iostream>using namespace std;int wordCounter(string s){int c=0;for(int…
Q: JAVA Programming Problem 5 – CharacterArray Write a program which will store the following string…
A: i wll provide two solutions for this question public class CharacterArray {public static void…
Q: void addSpouse(string m, string A method that takes the names of the member and spouse, searches for…
A: Explanation here we will discuss a c++ code to do the above task of finding a particular member and…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: I give the code in Python along with output and code screenshot
Q: Part A Find a list of all of the names in the following string using regex. In [ ]: import re def…
A: The answer is given below:-
Q: LabProgram.java Load default template... 1 import java.util.Scanner; 2 3 public class LabProgram {…
A: PROGRAM INTRODUCTION: Import the required header files. Start the definition of the main function.…
Q: I have problem in java 2 code: lease.setApartmentNumber(sc.nextLine()); melt:String cannot be…
A: Scanner class is used to accept input from user nextLine() will return the input in string format…
Q: remove_substring_from_string(s, substr): This function takes two strings s and substr as input. It…
A: PROGRAM CODE: # start definition of function to remove substringdef remove_substring_from_string(s,…
Q: Problem Description Gary being the smartest guy in the town is a friend of you. He challenges you…
A: String In their most basic forms, there are two different sorts of string datatypes: fixed-length…
Q: class Solution { public: }; char repeated Character(string s) { } unordered_set u; char ans;…
A: Introduction The given code snippet is a class in which we are finding the repeated character of…
Q: of ol e @0verride public String toString(){ SYOUR CODE HERE> public static void main(String[] args)…
A: I have implemented the instruction as per the specifications in the images in Java. The code is as…
Q: Owrite a program to readn string, then use the member functions of string to find: > length of the…
A: The required code is as follows:-
Q: Public class Utilities { getDigits Method: public static java.lang.String…
A: Program code: //define a class Utilities public class Utilities { //define a variable index static…
Q: void aSort (string arrl], int length}{ int j= 0; string temp = arr[0]; for (int i = 1; i= 0 && temp…
A: Sorting Algorithm: A Sorting Algorithm rearranges the members of an array or list based on a…
Q: pairRemoval(String,String,String) this is a public static function that takes three strings as…
A: Introduction: In this question, we are asked to remove leftPattern char and rightPattern char from…
Q: Language: JAVA Script Write a function 'mostFrequentLetter(string)' that takes a string as an…
A: Algorithm: Declare a array which contains the count of each character. We iterate over all the…
Q: this is my code and the question need to be continued. #include using namespace std; class…
A: As per the given requirement Implemented the addMember, removeMember and display member functions…
Q: A string object is ______ which means its contents cannot be changed. Select one: a. Absolute b.…
A: Answer to the above question is in step2.
Q: IN JAVA Create a function that takes a string and returns the number of alphanumeric characters that…
A: I give the code in Java along with output and code screenshot
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: function isUnfairHurdle(hurdles) { const tooHigh = hurdles.length >= 4; let tooClose = false;…
Q: #include #include using namespace std; class Staff{ public: int code; string name; public: Staff(){}…
A: Program Approach: In this code, Six class is declared "Staff, Faculty, Typist, Officer, Permanent,…
Q: Aquarium Fish - length: double - width: double - height: double fishes: Fish [ ] - name: String -…
A: If you want to run the code you can run it on online GDB compiler. I have bolded out the code for…
Q: 1. 2. void main (O { int main ( ) { string stl="road ",st2="Trip",st3; st2=st3+st1; cout<<st3…
A: PART 1:- The output will be:- 0 22 5 74 Explanation:- The operation performed is of printing the…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: I give the code in Python (because no language is mentioned) along with output and code screenshot.…
Q: Create an iterator that returns numbers, starting with 1, and each sequence will increase by one…
A: Solution in C++- #include <iostream>using namespace std;void interater(){ for (int i =1;…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: function isUnfairHurdle(hurdles) { const tooHigh = hurdles.length >= 4; let tooClose = false;…
Q: Create a function that takes a string and replaces every nth instance of oldChar with newchar. Your…
A: Step-1: Start Step-2: function replaceNth(str, n, oldChar, newChar) Step-2.1: if n is less than…
Q: Please help! C++ PUBLIC: BinTree::writeFile(std::string fileName) - calls private writeFile PRIVATE:…
A: implementation of above functions are given below in C++
Q: ingVar() i max_length(20) value - new char(max_length+1]; value(0) - '\0': Default constructor $ize…
A: //source code in C++ #include<iostream> #include<memory> #include<string>…
Q: In this question, you will be implementing the following functions int findChar(char * str, char…
A:
Q: What am I doing wrong on this and how can I fix it? #include #include using namespace std;…
A: In this question we have given a C++ code. We have to correct the code then we will paste the output…
Q: o) implement the ReplaceExClanmationg fuiction. Replac haracter in the string with a character.…
A: string ShortenSpace(string sample_text){ int len = sample_text.length(); int i = 0; string…
Q: The files provided in the code editor to the right contain syntax and/or logic errors. In each case,…
A: The code has given
Q: Write a function that accepts a pointer to a C-string as an argument and returns the number of words…
A: PROGRAM: #include<iostream>using namespace std;int wordCounter(string s){int c=0;for(int…
Q: (a) Find the errors in the following also explain what causes the error class Student int getid()…
A: In the above code, List of errors generated by code: 1. In class Student, static int…
Q: . Given a string of at least 3 characters as input, if the length of the string is odd return the…
A: The code has given below
Q: Fix all the errors in the code // Program displays some facts about a string public…
A: Objective: According to the given question, the errors should be determined from the code and fix…
Q: def zigzag(text): Implement a function that takes a string and returns a new string that is a…
A: The new string is formed by taking one element from start and one element from end This continues…
Q: class Metov{ void sum(int i, int j){ System.out.println(i); } void sum(String c,String d){…
A: when the parameters are Strings, they got added which means appended and result is printed when the…
Q: char human[10e], dog[100]; cout <« "Enter a string: "; cin.getline(human, 100); translate(human,…
A: Given: To replace character from 'w' and 'f' by 'o'
Q: Name first: String initial : char last : String Name (): void Name (String aFirst, char aninitial,…
A: Three UML diagrams are given. We need to find the equivalent java code for these diagrams.
Q: public static String pancakeScramble(String text) This nifty little problem is taken from the…
A: Given: This nifty little problem is taken from the excellent Wolfram Challenges problem site where…
Q: In the following declaration: string *var1, var2; O var1 is a pointer to a string, var2 is a string…
A: Pointers must be declared before they can be used, just like a normal variable. A pointer is…
Q: 2. Write a program that converts a numerical string to an integer. For example- if your input string…
A: To convert a numerical character to its corresponding integer - char - '0'To increment a pointer to…
Q: Description - this is a recursive function that prints the string repeatedly. Each time it prints…
A: #include<stdio.h>#include<string.h> #define STR_MAX_SIZE 100 void preserveString(char*,…
Q: Create a function that takes a string and replaces every nth instance of oldChar with newchar. Your…
A: const replaceNth = (str, nth, oldChar, newChar) => { const letters = Array.from(str); let counter…
Q: Welcome Assignment ### welcome_assignment_answers ### Input - All eight questions given in the…
A: Networking allows communication among millions of users worldwide. Besides, there exist several…
Step by step
Solved in 6 steps with 2 images
- The language must be in python. Just do numbers 5-7 Neural Network Units Implement a single sigmoid neural network unit with weights of [-1.2, -1.1, 3.3, -2.1] Calculate the outputs for two training examples:Example 1: [0.9, 10.0, 3.1, 1]Example 2: [0.9, 2.1, 3.7, 1] Note that you don't have to explicitly include a threshold or bias since the examples include a last element of 1 which means that the last weight effectively operates as a threshold. Assuming that a sigmoid unit response >0.5 denotes a positive class and <0.5 is negative class, is example 1 positive or negative? is example 2 positive or negative? Create a single ReLU unit and provide the outputs for those examples. Calculate the derivative of the sigmoid with respect to net input for both examples Calculate the derivative of the ReLU with respect to net input for both examples1. Study the following code and draw a control flow graph. public static void main(String[] args){final int NUMCHARS = 26;Scanner scan = new Scanner(System.in);int[] upper = new int[NUMCHARS];int[] lower = new int[NUMCHARS]; char current; // the current character being processedint other = 0; // counter for non-alphabetics System.out.println("Enter a sentence:");String line = scan.nextLine(); // Count the number of each letter occurencefor (int ch = 0; ch < line.length(); ch++){current = line.charAt(ch);if (current >= 'A' && current <= 'Z')upper[current-'A']++;elseif (current >= 'a' && current <= 'z')lower[current-'a']++;elseother++;} // Print the resultsSystem.out.println();for (int letter=0; letter < upper.length; letter++){ System.out.print( (char) (letter + 'A') ); System.out.print(": " + upper[letter]); System.out.print("\t\t" + (char) (letter + 'a') ); System.out.println(": " +…please write it in C language. import java.util.*; public class EightQDfs { final int X = 4; void dispSol(int brd[][]) { for(int i = 0; i < X ; i++) { for(int j=0 ; j < X ; j++) { System.out.print(" " + brd[i][j]) + " "); System.out.println(); } } boolean isSafe(int brd[][] , int r , int c) //r is for row and c is column { int i , j; for(i = 0 ; i < c ; i++) if(brd[r][i] == 1) return false; for(i = r ; j = c ; i >=0 && j >= 0 ;i-- ,j--) if(brd[i][j] == 1) return false; for(i = r , j = c ; j >= 0 && i < X ; i++ , j--) if(brd[i][j] == 1) return false; return true; } boolean EQsolved(int brd[][] , int c) { if(c >= X) return true; for(int i= 0; i < X ;i++) { if(isSafe(brd , i , c)) { brd[i][c] = 1; if(EQsolved(brd , c + 1) == true ) return true; brd[i][c] = 0 ; } } return false; } boolean…
- Implementation of the solution in the C++ or Java language • Implementation of the solution in ARMv8 assembly, with comments explaining the purpose of each line Task 1 An automorphic number is a number n whose square ends in n. For instance, 5 is automorphic, because 52 = 25, which ends in 5. Design and implement an ARMv8 program that reads a positive integer from the user and then calculates and prints all the automorphic numbers (decimal base) that are less than or equal to the entered integer. If the entered integer is not positive, an error message is displayed. As an example, if 100 is entered, the program will print all the automorphic numbers up to 100: 1, 5, 6, 25, 76.Provide a detailed answer that includes an explanation and a solution. Question: Create a java for loop that maps denotational semantics Please walk me through this step by step!!!The language of the following DFA is { w∈{0,1)* | _________ } a) w ends in a 0 b) w contains a 1 c) w has an odd number of 1’s d) w starts and ends with a 0 and has a 1 e) w contains a 1 and ends in a 0
- Create a java program where you apply the concept of PDA (Pushdown automata) using stack where program will check if the input is a PALINDROME or not. See attached photo for the example (you can use conditionals to make the program possible)Question5: Write a python program to train neural network to classify two clusters in a 2-dimensional space for implementing XOR, where the weight is -0.50 and x>-0.5. Also name the class by your nameCreate two stacks in java which store initial and goal state of block world problem. Display these state to user and then create a heuristic value which give +1/-1 to each block correct position with respect its goal state.
- 4.Draw the recursive flow diagram/memory stack (draw each methods and their behavior in the way they are being called and executed) of the code given below: public class Surprise{ public static int mystery(int n) { System.out.println("h(" + n + ")"); if (n == 0) { System.out.println("value: 0"); return 0; } else { System.out.println("going down"); int temp = mystery (n - 1) + 1; System.out.println("h(" + n + ") --> " + temp); return temp; } } public static void main(String [] args){ mystery(4); } OR class Surprise: def mystery(self,n): print("h(" ,n,")") if(n==0): print("value: 0") return 0 else: print("going down") temp = self.mystery(n-1)+1 print("h(",n,") --> ",temp) return temp #Tester s = Surprise() s.mystery(4) 5.[Hard] Print the following pattern for the given input: Input: 5 Output: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 Print the following pattern for the given input: Input: 5 Output: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5Implement in C programming language Question 1 Write a program in c to detect if the system will face any deadlock in the future. If a deadlock is detected then print “Deadlock Ahead” otherwise print “Safe here”. The situation is given below. (Allowed to use Banker’s Algorithm). Note: The code can be implemented in several different ways, but make sure the parameter remains the same as shown below. n = 5; // Number of processes m = 4; // Number of resources int alloc[5][4] = { { 0, 1, 0, 3 }, // P0 // Allocation Matrix { 2, 0, 0, 0 }, // P1 { 3, 0, 2, 0 }, // P2 { 2, 1, 1, 5 }, // P3 { 0, 0, 2, 2 } }; // P4 int max[5][4] = { { 6, 4, 3, 4 }, // P0 // MAX Matrix { 3, 2, 2, 1 }, // P1 { 9, 1, 2, 6 }, // P2 { 2, 2, 2, 8 }, // P3 { 4, 3, 3, 7 } }; // P4 int avail[4] = { 3,…Write the code in Java language The problem states that there are five philosophers sitting around a circular table. The philosophers must alternatively think and eat. Each philosopher has a bowl of food in front of them, and they require a fork in each hand to eat. However, there are only five forks available. You need to design a solution where each philosopher can eat their food without causing a deadlock.