tutorbin

programming language principle and paradigm homework help

Boost your journey with 24/7 access to skilled experts, offering unmatched programming language principle and paradigm homework help

tutorbin

Trusted by 1.1 M+ Happy Students

Recently Asked programming language principle and paradigm Questions

Expert help when you need it
  • Q1:Programming Languages - Project WJ Inc., is a company with offices around the world. The HR team wants to build reports on the number of employees around the world, in different departments. But they do not want to use the raw data for the reporting purpose. They want some consolidation and aggregation to be done prior to being loaded into their reporting system. The data is provided to the software engineer in CSV files. There are 3 CSV files, each holding the department, location and employee headcount data. The department and location information is provided as a flattened hierarchy. Given below is a snapshot of the department file content: level1 WJ Group WJ Group WJ Group level2 WJ Inc. WJ Inc. WJ Ino level? level3 level4 level5 level5 DEPT 1 DEPT 11 DEPT 111 DEPT 1111 DEPT 11111 DEPT 1 DEPT 12 DEPT 1 DEPT 13 DEPT 133 level! The department hierarchy has 7 levels. The file has columns level1 - level7 and an additional column to indicate the the bottom level. The department hierarchy is a jagged hierarchy meaning not all hierarchies have 7 levels. Similarly the location data is also provided. The screen shot is given below: level1 level2 laval3 World North America USA Califomia World North America USA Califomia World North America USA Califomia laval7 level5 loval6 leve! bottom_level Northern California San Jose Main Campus SJG1 8JC 1 Northern Califomia San Jose Main Campus SJC2 SJC2 Southern California Los Angeles LA Techspace LA 1 LA 1 The head count data includes the department, location. Each row in the file gives the number of employees for a particular department at a particular location. The headcount data is only available at bottom levels. Given below is a screenshot of the data: location department DEPT_11111 SJC 1 SJC 1 SJC 1 SJC 1 SJC 1 DEPT 12 DEPT 133 bottom_level DEPT 11111 DEPT 12 DEPT 133 DEPT_2222 DEPT_2244 head_count 12 42 122 3 12See Answer
  • Q2:2. Add a method to the builtin Integer class that will return return the double. e.g.: 2.double should return 4.See Answer
  • Q3:3. Write a recursive function that returns the nth number in Fibonacci series. But instead of addition of previous 2 numbers, the function will take a code block and apply the code block to the previous 2 numbers. So the regular fibonacci series is a special case where the code block specifies summation.See Answer
  • Q4:4. Write a recursive function that accepts an array, and returns an array with the order reverses. [1, 2, 3, 4, 5, 6] should return [6, 5, 4, 3, 2,1].See Answer
  • Q5:5. Write a class Fraction to represent a fraction. It has a constructor to accept a numerator and denominator. The denominator should be 1 by default. The constructor should automatically simplify the fraction. So if 2 and 4 are passed to the constructor the fraction should be 1/2. Implement a method that takes another Fraction, adds it to the current fraction. The addition function should be chain able, i. e. if function name is add, the we should be able call f.add (1/2).add (1/3). Leverage the add function to implement a + function that can add two fractions and returns the result, (1/2 + 1/3 should return 5/6). Use helper methods as needed, with appropriate access levels. The numerator and denominator attributes should not be accessible outside the class. Implement a to_s to return the fraction as a string in proper format (like "1/2").See Answer
  • Q6:1. Write a recursive function (range) that takes 3 numbers as arguments (begin, end, inc) and return a list that starts at begin and each subsequent number increases by inc and the list has a last value which is less than or equal to end. Assume that end > begin and inc is always +ve. (range 2 15 3) should return (2, 5, 8, 11, 14) 1See Answer
  • Q7:2. Write a function that takes a list of strings and a suffix, and returns a list of strings, in which each string is built by appending the suffix to each string in the original list. eg: (my- append (list "util" "main" "delta") ".cpp") will return ("util.cpp", "main.cpp", "delta.cpp"). Use the builtin string-append function to append strings.See Answer
  • Q8:3. In an academic institute, students records include id, first name and last name. Write a function that accepts a list of student records. Each record is a list of integer, string, string - eg: '(1, "Sam", "Roger"), and records of new students may not have the id, they have only first and last name as in' ("Kang" "Lee"). The function should return a list ids. If the student has an id then that is used, if the student does not have an id, full name is used as id so the returned list would look like (1 "Kang Lee" 2 3 "Ravi Kumar" "Sarah Smith")See Answer
  • Q9:4. Write a tail recursive function that returns the nth number in Fibonacci series, assuming first 2 numbers to be 1, 1.See Answer
  • Q10:5. Write a function that removes duplicates in a list of strings. ' ("a", "b", "a", "b", "a", "b", "c") should return ' ("a", "b", "c").See Answer
  • Q11:1. Write a Ruby class that represents an Item ordered by a customer. The attributes include item id, item name, item price, item count and total price. The class should include the Ruby builtin mixin Comparable, so that Items in a list can be sorted by item count in descending order, followed by total price in descending order, followed by item name in alphabetic order. Documentation for Comparable can found at https://rubyapi.org/2.6/o/ comparable.See Answer
  • Q12:2. Given below is SML code that implements a simple way to define expressions and operations on them: datatype exp = Constant of int Negate of exp | Add of exp * exp fun eval e = case e of Constant (i) => i Negate el => ~ (eval el) | Add (el, e2) => (eval el) + (eval e2) eval (Add (Constant 19, Negate (Constant 4))); (* result is 15 *)See Answer
  • Q13: Write a shellscript to append two files accepted as command line input, if they exist. Display the content of the new file, and the number of words in all the files. Write a shell script to input a file name. If the file exist, perform the following using menu-driven programming according to the options given below: Option 1 2 Any other value Process to be done Display the line at the middle of the file Display the background processes display all the files in the current directory that has size ranging from 100 kb to 500 kb A user is typing a Shell script in vi editor. He wants to delete a line in his file. To which mode should he change and how? A user wants to get a list of devices and the points at which they will be attached to the main filesystem. From Choose... which of the following files can he get the required information? An administrator types the following command on an RPM- based Linux distribution: # rpm -ev nx-3.5.0- Choose... 2.el6.centos.i686.rpm What is the effect of is command? Choose... ◆ * What is the output of the following shell script? #! /bin/bash x=3 y=5 if [ $x -eq 3 -a $y -ge 5 ] then echo -n $(($x+2)) FL echo "$y+2 Choose... Match the Following: A user is typing a Shell script in vi editor. He wants to delete a line in his file. To which mode should he change and h✓ Choose... A user wants to list of devices ar points at which will be attached main filesystem. which of the foll files can he get t required informa An administrato types the follow command on an based Linux Choose... 3+27 5 5+2 Command, press Esc key /etc/fstab Remove the package Insert, press Esc key /etc/filestab enable the package distribution: # rpm -ev nx-3.5.0- el6.centos.i686.rpm Choose... ◆See Answer
  • Q14: A list of 5 unsigned numbers (1H,68H,64H,65H,0H,34,100,101,70H,4,98H) is stored starting at memory location LIST in code memory (ROM). Write a program that will: Copy the numbers from code memory (ROM) to program memory (RAM)starting at address 40H. Sum the value of the numbers then output the result on PO. Find the number of values that are greater than 1510 and output the result on P1 LEDS. 2. (5 points) Write a program that will convert a string of characters in to an all-upper-case string: The string named "MyString " defined using appropriate assembler directives and ended with 0. The original string consists of a mixture of upper- and lower-case characters in addition to spaces. - The converted string should be stored RAM starting at address 40H.See Answer
  • Q15: 3. (2 points) Answer the following questions. If necessary, consult a reference on C (and cite your source). (a) What is the scope and what is the lifetime of a static local variable? (b) What is the scope and what is the lifetime of a static global variable?See Answer
  • Q16: 1. public int summation (int start, int end) { 3.return start; 2. if (start == end) 4.else 5.return start + summation (start+1, end); Show the runtime stack that is built in order to calculate summa-tion(3,6). You should show the stack's state whenever an activation record is pushed on or popped off. Be sure your representation of the stack includes all dynamic links, current values for all parameters, and,when appropriate, give the return value of the function.See Answer
  • Q17: Consider the following C++ program, where &i means i is passed byreference: (a) What is the value of sum at the end of the function fool? Brieflyexplain why. (b) What is the value of sum at the end of the function foo2? Brieflyexplain why.See Answer
  • Q18: Consider the following function written in the C syntax: 1. int foo(int a, int b) { bb 10:+ 3.a = b*2; 4.return a + b; In each of the cases below, assume that the initial values of the vari-ables are x-1, y=2, and z=3. Write down the values of x, y, andz after the following calls to foo(). If necessary, assume that outputparameters are copied back to arguments in the left-to-right order. (a) z foo(x,y) where all parameters are passed by value= (b)=foo(x,y) where all parameters are passed by reference (c) Z =foo(x,y) where all parameters are passed by value-result (d)=foo(y,y) where all parameters are passed by value (e) z = foo(y,y) where all parameters are passed by reference (f) :Zfoo(y,y) where all parameters are passed by value-resultSee Answer
  • Q19: 2. (3 points) Find some online material to learn C#'s namespace mecha-nism (cite your source). Explain briefly how it works and its benefits.See Answer
  • Q20: 1. (8 points) Consider the C program given below. You will be asked to determine which variables are visible in a number of different situations. In each case, identify each variable by its name and the line number of its declaration. Note: for this problem, only list visible variable names, not function names. (a) C uses static scoping. Say which variables are visible in the bodies of each of the functions: main, A, B. (b) If C used dynamic scoping and the calling sequence is main calls B. Say which identifiers would be visible in B. (c) If C used dynamic scoping and the calling sequence is main callsA. Say which identifiers would be visible in A. (d) If C used dynamic scoping and the calling sequence is main callsA; A calls B. Say which identifiers would be visible in B.See Answer

TutorBin Testimonials

I found TutorBin Programming Language Principle And Paradigm homework help when I was struggling with complex concepts. Experts provided step-wise explanations and examples to help me understand concepts clearly.

Rick Jordon

5

TutorBin experts resolve your doubts without making you wait for long. Their experts are responsive & available 24/7 whenever you need Programming Language Principle And Paradigm subject guidance.

Andrea Jacobs

5

I trust TutorBin for assisting me in completing Programming Language Principle And Paradigm assignments with quality and 100% accuracy. Experts are polite, listen to my problems, and have extensive experience in their domain.

Lilian King

5

I got my Programming Language Principle And Paradigm homework done on time. My assignment is proofread and edited by professionals. Got zero plagiarism as experts developed my assignment from scratch. Feel relieved and super excited.

Joey Dip

5

TutorBin helping students around the globe

TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.