2. Create a class with a static main that tests the ability to resolve and print a Path: • Create an erray of Path cless. • Instantiate instances of Path with absokite and relative paths. - Print the constructed elemants of the array of Path elass with System.out.printin() method.
Q: Write a class Employee with name and salary. Create an ArrayList whichsorts the Employees based on…
A: import java.util.*; public class test { // Employee class that imlements comparable interface…
Q: 2) Consider a class for a node of a doubly linked list: class node{ String name; String city; node…
A: class node{ String name; String city; node llink, rlink; node(String name , String city){…
Q: Create class IntegerSet for which each object can hold integers in the range 0 through 100.…
A: Sample Response: //Java Programimport java.util.*;// IntegerSet Class Declareclass IntegerSet{…
Q: Define a class StatePair with two template types (T1 and T2), constructors, mutators, accessors, and…
A: Coded using C++.
Q: 6. Given a Stack of holding 7 objects. Show the final contents of the array after the following code…
A: Here in the given piece of code, 7 elements are being inserted into the stack using for loop, that…
Q: Task Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray &…
A: An array is a collection of variables that are the same data type. An array is collection of similar…
Q: Task Create a class IntegerSet for which each object can hold integers in the range 0 through 100. A…
A: Make class IntegerSet as follows: each object of class IntegerSet can hold whole numbers in the…
Q: The Resident class maintains, for a set of addresses, the set of residents living at each address.…
A: addResident method has to first get the Set associated to that particular address and then add…
Q: Suppose we have a method cloakMethod in some class as specified below. Which of the following would…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Write a program to test various operations of the class doublyLinkedList.
A: Programming language is missing in the question. So we will answer this program in C++ language. If…
Q: 7. Given an integer array of size Score CAPACITY, override the method getNext () and hasMore ().…
A: PROGRAM CODE: ArrayList.java package arrays; import java.util.AbstractList; /*** This defines the…
Q: Let a and b denote object modules or static libraries in thecurrent directory, and let a→b denote…
A: Liberary is conditionally linked object. The objects that reference a library are processed by the…
Q: Q1 java : If in the ArrayStack, the first element that we push to the stack, is stored in…
A: We need to find the correct option from the given 4 options for the given stack push method.
Q: Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray & NegativeArray…
A: Actually, program is an executable software that runs on a computer.
Q: It is often the case that two or more classes share a common set of methods. For programming…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Create the RandomList class with instance variables for an array of integers and a Random object.…
A: Code : import java.util.*; public class RandomList { //Instance variable for an array of integers…
Q: Define a class StatePair with two template types (T1 and T2), constructors, mutators, accessors, and…
A: Create the StatePair class, which has two template types (T1 and T2), constructors, mutators,…
Q: Take the following partially completed RoundRobin class that is Iterable, and supplies an Iterator…
A: import java.util.ArrayList;import java.util.Iterator;public class RoundRobin<T> implements…
Q: Implement an immutable data type outcast with the following API: publie elass Outcast ( //…
A: WоrdNet grоuрs wоrds intо sets оf synоnyms саlled synsets аnd desсribes semаntiс…
Q: 3. Write a MapReduce driver program in Java for the given mapper and reducer classes that perform a…
A: Map Reduce: It is a type of framework for the processor with big data in two phases that is Map and…
Q: A. * throws an exception if given an out of bounds index В. & C. int* Best array-based list to…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: It is often the case that two or more classes share a common set of methods. For programming…
A: Given: It is often the case that two or more classes share a common set of methods. For programming…
Q: 1. Write a java program to create a linked list of Employees where each Employee node will contain…
A: Sun microsystems developed the Java language, which is primarily used for the applications which…
Q: Exercise #2 Consider the following linked list L. neader 1 3 2 5 a. Write the method Addlast, which…
A: The answer is given below.
Q: Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray & NegativeArray.…
A: Actually, program is an executable software that runs on a computer.
Q: How many line(s) should be changed/added to make class Res-Visitors a emplate class? nswer: class…
A: Class template which refers to the template that are used to generate the template classes. You…
Q: Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray &…
A: Actually, array is a collection of elements.
Q: Define a class StatePair with two template types (T1 and T2), a constructor, mutators, accessors,…
A: // StatePair.h#ifndef STATEPAIR#define STATEPAIR #include <iostream>using namespace std;…
Q: 1S15 Suermarket rimalation) Write a program that simulates a check-cut line at supermarket. The line…
A: Program Plan Intro Program Plan- Include header files and declare required namespaces. Declare…
Q: Define a Rectangle class that provides getLength and getWidth. Using the findMax routines in Figure…
A: According to the given question the executable code will be like :
Q: Create a People class with the following features: Each People object has a statically allocated…
A: the program is an given below :
Q: Write static void quickSort(T[] array, Comparator cc) Implement the version that picks pivots at…
A: Comparator Interface in Java Comparator interface is used to order the objects of user-defined…
Q: Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray &…
A: Actually, array is a collection of elements.
Q: Let a and b denote object modules or static libraries in the currentdirectory, and let a → b denote…
A:
Q: reate a Book classi w Each book contain- fong integers), and Implement an appi est Book class
A: STEP-1: First of all, we need to create a Book class. To create the Book class, create a new…
Q: Complete the Course class by implementing the dropStudent() method, which removes a student (by last…
A: CODE: Course.java import java.util.ArrayList; public class Course { private…
Q: Task Create a class IntegerSet for which each object can hold integers in the range 0 through 100. A…
A: IntegerSet.h header File : #ifndef INTEGERSET_H #define INTEGERSET_H //defiining the function in…
Q: Task Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray &…
A: main.cpp: #include <iostream>#include <fstream>#include <sstream> using namespace…
Q: B) By using classes, write the appropriate program that implements creation of the head pointer of a…
A: The answer is given in the below step
Q: Assume that list1 is an object of class type ArrayList of Java (similar to KWArrayList class) and it…
A: This question comes under the collection of List in Java Initially "H", "E", "L", "L", "O" is in the…
Q: 1. Write a for-each loop that iterates through the studrecs collection writing out each student’s…
A: 1.This is used a for-each loop that iterates for (int j = 0; j< listNames.size(); j++) {…
Q: Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray & NegativeArray.…
A: Actually, program is an executable software that runs on a computer.
Q: Define a class StatePair with two generic types (Type1 and Type2), a constructor, mutators,…
A: I have mentioned code in step 2, please find in below
Q: Assume that Mylist is an object of class type ArrayList of Java (similar to KWArrayList class) and…
A: Dear learner , hope you are doing well , I will try my best to answer this question. Thank You!!
Q: Create a Triplet class that encapsulatesthree objects of the same data type in a given instance of…
A: Program code: //define class Triplet class Triplet<T> { //declare class members private T…
Q: What happened? When libvector.a is processed, U is empty, so nomember object files from libvector.a…
A: Ans:) If the reference will not be resolved then we get the error. This happens when a library that…
Q: Task Declare and implement 5 classes: FloatArray, SortedArray, FrontArray, PositiveArray &…
A: Actually, array is a collection of elements.
Q: The Resident class maintains, for a set of addresses, the set of residents living at each address.…
A: We need to implement the Resident class as given below:
Step by step
Solved in 3 steps with 1 images
- Which example uses the SOLID SRP principle correctly and does not violate it? (A or B) A. public class DatabaseParser { ParseDirectoryMapFile(); // parse directory map fileParsePasswordFile(); // parse user fileParseReviewDataFile(); // parse review data fileParseTeamFile(); // parse team CalculateGrade(); CalulateRelativeGrade(); } B public class DatabaseParser { ParseDirectoryMapFile(); // parse directory map fileParsePasswordFile(); // parse user fileParseReviewDataFile(); // parse review data fileParseTeamFile(); // parse team file} // seperately with the following: public class Calculator{ CalculateGrade(); CalulateRelativeGrade(); }Rewrite the program in Example 3-1. DigestThread class to output the result of each file on an output file for each one by assigning a new name for the output file. The language is Java Example 3-1. DigestThread import java.io.*; import java.security.*; import javax.xml.bind.*; // for DatatypeConverter; requires Java 6 or JAXB 1.0 public class DigestThread extends Thread { private String filename; public DigestThread(String filename) { this.filename = filename; } @Override public void run() { 56 | Chapter 3: Threads www.it-ebooks.info try { FileInputStream in = new FileInputStream(filename); MessageDigest sha = MessageDigest.getInstance("SHA-256"); DigestInputStream din = new DigestInputStream(in, sha); while (din.read() != -1) ; din.close(); byte[] digest = sha.digest(); StringBuilder result = new StringBuilder(filename); result.append(": "); result.append(DatatypeConverter.printHexBinary(digest)); System.out.println(result); } catch (IOException ex) {…1) Create a daemon in C in the Unix environment, your daemon must create a text file called aitDaemonLog.txt and populate it with 1000 lines of a string each line must be written after 10 seconds, the string must end with the count of the string;. 2)Create a shell script that lists all the files in the present working directory in long format name this file listMyFiles.sh. Write a c program that uses the system() function and uses it to run listMyFiles.sh 3)Write a c program to write a string of your own choosing into shared memory then read the contents of the shared memory created in 4)demonstrate in a c program how to use a fork to create a child process, using pipes let this child process send a message which is read by the parent process 5) Write a c program that shows the PID, PPID, UID and GID of a running process, let this process fork thus creating a child process, let the parent process count from 0 to 50 and the child process from 0 to 25 each process showing while counting…
- Modify rnfile such that it will keep a copy of the old existing file (if available) before the renaming operating. Assume that apple.txt will be renamed as orange.txt. When the command “./rnfile apple.txt orange.txt” is executed, the script will first check whether orange.txt exists under the given path or not. If the file exists then orange.txt will be renamed as orange.txt_old before renaming apple.txt as orange.txt. Make rnfile an executable shell script; try to rename a file to a filename that already exists. Show your shell program and its output to the instructor.Question 5: findWrite a simple version of the Linux find program: find all the files in a directory tree whose namematches a string.Some hints:·Look at ls.c to see how to read directories.·Don’t try to find any files in the “.” and “..” directories.·Changes to the file system persist across runs of QEMU; to get a clean file system run makeqemu.Your solution is correct if produces the following output (when the file system contains a file a/b):$ make qemu ...init: starting sh$ echo > b$ mkdir a$ echo > a/b$ find . b./b./a/b$2. Start with an empty buffer pool of size 4 pages again. This time use this access pattern:♯SAGLIKLIMUTLUBAYRAMLAR♯. At the end of accessing all the pattern, what is the content ofthe buffer pool (write in alphabetical order)? Use the LRU algorithm as the buffer replacementpolicy.
- How can I fix the error and complete my code? In Java. LeagueDriver.java: import java.io.File;import java.io.FileNotFoundException;import java.util.Scanner; public class LeagueDriver {public static void main(String[] args) {Scanner sc = null;try {sc = new Scanner(new File("Players.txt"));} catch (FileNotFoundException e) {System.err.println("No such file");System.exit(-1);} League l = new League();while(sc.hasNext()) {String temp[] = sc.nextLine().split(", ");l.addPlayer(new Player(temp[0],temp[1],Integer.parseInt(temp[2])));}l.printLeague();System.out.println();l.printAverageScore();}} Player.java: public class Player {private String name,team;private int score;public Player(String n,String t,int s) {setName(n);setTeam(t);setScore(s);}/*** @return the name*/public String getName() {return name;}/*** @param name the name to set*/public void setName(String name) {this.name = name;}/*** @return the team*/public String getTeam() {return team;}/*** @param team the team to set*/public void…Java Program ASAP ************This program must work in hypergrade and pass all the test cases.********** I have provided the code instructions and the text files below. The test cases are located in Hypergrade. Down below is a working code. Dont add any import libraries in the program just modify the rest of the code so it passes the test cases. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.HashMap;import java.util.Map;import java.util.Scanner;public class MorseCodeConverter { public static void main(String[] args) { Map<String, String> morseCodeMap = readMorseCodeTable("morse.txt"); Scanner scanner = new Scanner(System.in); System.out.print("Please enter the file name or type QUIT to exit:\n"); do{ String fileName = scanner.nextLine().trim(); if (fileName.equalsIgnoreCase("QUIT")) { break; } try { String…Close the virtual machines now and close the virtual box. Use your real machine to respond to the following : Use notepad to create a txt file containing the following : hello how are you 1234567890!? compute the MD5 hash of this file. Write the hash here …........................................................................................................... what is the size output of MD5 ? …........................................................................... what would be the MD5 size output if you change the input file to be: ello how are you 1234567890!? ….............................................................................. give also the MD5 output of this modified file …..................................................................................... I have changed the last symbol in step 1 (which is the symbol “?”) by a mystery symbol that you need to figure it out. I have only used numbers symbols. What is this mystery symbol if I…
- Compliant/Noncompliant Solutions The following code segment was provided in Secure Coding Guidelines for Java SE: void readData() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream("file"))); // Read from the file String data = br.readLine();} The code is presented as a noncompliant coding example. For this assignment, identify two compliant solutions that can be utilized to ensure the protection of sensitive data. Provide a detailed explanation of factors, which influence noncompliant code and specifically how your solutions are now compliant. Your explanation should be 2-3 pages in length. Submit the following components: Word document with appropriate program analysis for your compliant solutions and source code in the Word file. Submit your .java source code file(s). If more than 1 file, submit a zip file.enlarge.py """ File: enlarge.py Project 7.11 Defines and tests a function to enlarge an image. """ from images import Image def enlarge(image, factor): """Builds and returns a copy of the image which is larger by the factor.""" def block_copy_pixel_to(image, row_index, line, pixel_to_copy, factor): for x in range(factor): for y in range(factor): image.setPixel(row_index + x, line + y, pixel_to_copy) old_height = image.getHeight() old_width = image.getWidth() new_height = old_height * factor new_width = old_width * factor new_image = Image(new_width, new_height) nhi = 0 # new height index for ohi in range(old_height): # original image height index # new left & right indices nli = 0 nri = new_width - 1 # original left & right indices oli = 0 ori = old_width - 1 # Copy blocks of the same pixel to the new image while oli < ori: old_left_pixel = image.getPixel(oli, ohi) block_copy_pixel_to(new_image, nli, nhi, old_left_pixel, factor) old_right_pixel =…AVA PROGRAM ASAP Please modify this program ASAP BECAUSE it does not pass all the test caseswhen I upload it to hypergrade. Its says 0 out of 3 passed when i upload it to hypergrade. The program must pass the test case when uploaded to Hypergrade. import java.util.HashMap;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.Scanner;public class MorseCodeConverter { private static HashMap<Character, String> morseMap = new HashMap<>(); public static void main(String[] args) { loadMorseCodes(); Scanner scanner = new Scanner(System.in); System.out.println("Please enter a string to convert to Morse code:"); String input = scanner.nextLine().toUpperCase(); String morseCode = convertToMorse(input); System.out.println(morseCode); } private static void loadMorseCodes() { try (BufferedReader reader = new BufferedReader(new FileReader("morse.txt"))) { String line;…