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:Need to complete in Rust and also pass the test which are given in zip file You can use VScode for codingSee Answer
  • Q15:Question 1 (30 marks) a. A sinewave has a period (duration of one cycle) of 620 us. What is the corresponding frequency of this sinewave in kHz, expressed to three significant figures (see Study note 7.1 in the Using numbers (maths) booklet)? If the frequency of the sinewave is now reduced by a factor of 2.75, what will be the new period value? Express your answer in ms to three significant figures. Note: in the second part of this question, to avoid rounding errors in your calculations, use the full frequency value from the first part, not the value rounded to three significant figures. (10 marks) b. In a specific, high-quality coaxial cable, it was found that the power drops by a factor of 10 approximately every 0.85 km. If the original signal power is 0.125 W (1.25 x 10- ¹ W), how far will a signal be transmitted before the power is attenuated to 1.25 µW? C. Include a table showing the signal power (in W) versus distance in 0.85 km intervals (similar to Table 1.2 in Section 1.4.4) as part of your answer. If optical fibre is used instead of the coaxial cable, briefly explain how you would expect the above calculated distance value to change (see Section 1.4.4). You are not required to include another table, or a new calculation, for this last part. (10 marks) Express the following 48-bit binary MAC address in hexadecimal (see the Using numbers (maths) booklet). 001001001100110110111001 - 111000001000100110101101 (10 marks)See Answer
  • Q16:Question 2 (30 marks) An industrial monitoring system uses an loT network comprising many different sensors, IoT devices, detectors and cameras to measure and check a range of parameters from temperature, pressure and fluid levels to fire and gas detection within a remote working environment. The following calculations relate to Section 4.2 Data for the Internet of Things'. i. a. il. The monitoring system includes an accurate temperature sensor which provides a 10-bit °C reading which comprises an 8-bit integer with 2 extra bits (to the right of the binary point) giving additional numerical precision for each measurement (Section 4.2.2). If the current sensor reading value is 01110111.11, what is the equivalent °C denary value? (2 marks) The current loT sensor monitoring fluid levels has five possible output values (Empty, Low, Medium, High, Full). If fixed-length coding (Sections 4.2.3 and 4.2.4) is used, how many bits are required to represent this loT sensor's output? Comment on whether fixed-length coding is the most efficient way of representing this loT sensor's readings. If not, and by providing a reason, explain what alternative method you would recommend is used. (4 marks) iii. It emerges that the current five output levels of the loT sensor in part (ii) provide inadequate resolution for the fluid level measuring application. The sensor is therefore to be replaced by a new sensor which has 32 output levels. If fixed- length coding is again used, how many bits are required for the new sensor's outputs? If all the output levels for the new loT sensor have the same likelihood of occurring, state whether using fixed-length coding is the best option for this application, giving a reason for your answer. (3 marks) iv. For surveillance purposes, a video camera is used as part of the monitoring environment, which has a frame resolution of 1920 by 1080 pixels. If the colour information in each frame is 24 bits per pixel and the number of frames per second is 15, what will be the total amount of data stored, in MB (Section 1.5 and Activity 3.20) for 1 second of video? Give your answer in scientific notation to two decimal places. Hint: firstly, calculate the total number of pixels in a single video frame. (5 marks) (14 marks)/nb. (14 marks) I. A mobile base station (BS) in an urban environment has a power measurement of 45 µW at 285 m. If the propagation follows an inverse 4th power law (Section 3.2.2), what is a reasonable power value, in µW, to assume 1.14 km from the BS? Express your answer in scientific notation to 2 decimal places. (5 marks) ii. While you are travelling, the mobile phone app you have installed displays a received signal strength of 72 nW. Assuming the same propagation law as in part (i), how far are you from the BS? Give your answer in km to two decimal places. Copyright © 2023 The Open University Question 2 (30 marks) Hint: see Activity 3.6 and Tables 3.1 and 3.5. (3 marks) 4 of 13 08/09/23/nC. 1. The 7-bit ASCII code for the character 'X' is: 1011000 An even parity check bit is included at the start of this code (left-hand end), so that 8 bits are transmitted. What will be the transmitted code for the ASCII character 'X'? (2 marks) il. If this 8-bit ASCII character is transmitted using frequency shift keying modulation (Section 3.3.3), sketch the transmitted waveform. (3 marks) iii. If even parity check bits are used, which of the following 8-bit received ASCII codes are invalid? In each case, give a reason for your choice. • 10110101 • 11110110 • 10100100 (3 marks) (8 marks)See Answer
  • Q17:Question 3 (30 marks) a. In this part of Question 3, you will contribute a resource to a wiki and then comment on a resource contributed by another student. Make sure that you contribute your resource at least five days before the TMA deadline (L.e. by 23:59 on Saturday 9 March 2024) so that other students have an opportunity to read and comment on it. i. In Block 3, Part 5, Activity 5.12, you found a web resource and added a section about it to a wiki. Now that you have studied Part 6 of Block 3, find a web resource that you think is interesting and relevant, specifically to Part 6. Add a section about this resource to the TM111 TMA 03 tutor group wiki. To do this, follow the instructions below, which you will also find on the Start page of the wiki Follow the link (at the bottom of the Start page) to the page for sharing resources. You can edit the new page to share resources with other students in your tutor group and comment on their resources. You cannot edit the Start page. On the new page, add a new section (using the 'Add new section' button near the bottom of the page). In your new wiki section, you should include a link to your chosen resource, a short explanation of what the resource is about, and an explanation of why it is interesting and how it is relevant to Part 6. You should write no more than 150 words. As your answer to part () of Question 3(a): *paste a copy of the text in your wiki section into your TMA document take a screenshot showing your wiki section and paste it into your TMA document. (6 marks if contributed five days before TMA deadline: 3 marks otherwise) Il. Choose a section of the wiki, contributed by another student, that you find interesting. Using the wiki's 'Edit section facility, add a comment to the wiki section that you chose, explaining why it is of interest to you. You should write no more than 100 words. Precede your comment with 'A comment from your name so that your tutor and other students can tell who the comment is from. As your answer to part (i) of Question 3(a) paste a copy of your comment into your TMA document take a screenshot showing your comment in the wiki section and paste it into your TMA document. (3 marks) i. Write a short piece of text about your experience of the wiki's usability. You should relate your answer to three of the following concepts that you learnt about in Block 1, Part 6.5.1, "What is usability": * effectiveness • efficiency • satisfaction leamability *recoverability. The maximum word limit for Question 3(a)(iii) is 250 words. (6 marks) (15 marks)/nb. ChatGPT is an online tool that uses artificial intelligence (Al) methods, and a wide range of information sources, to answer questions and carry out tasks (see Introducing ChatGPT). You can try ChatGPT from the link above, if you wish. I tried ChatGPT in June 2023 by asking it to Tell me about the new social networking site Bluesky, in about 500 words. This is the answer it provided (after just a minute or two). Bear in mind that the version of ChatGPT I tried was using data only up to November 2022 Bluesky is an innovative social networking site that has gained significant attention since its launch in recent years. Developed with a focus on privacy, user control and decentralised architecture, Bluesky aims to redefine the way people connect and communicate online. With its unique approach and commitment to user empower- ment, Bluesky has quickly emerged as a promising platform in the social media landscape. One of the standout features of Bluesky is its decentralised nature. Unlike traditional social media platforms that rely on a centralised infrastructure, Bluesky operates on a decentralised protocol, allowing users to have greater control over their data and online presence. This means that instead of relying on a single company or server. Bluesky's network is distributed across various nodes, ensuring better security. privacy and resistance to censorship. Privacy is a paramount concern for Bluesky and the platform incorporates robust privacy features to protect users personal information. Bluesky implements end-to- end encryption, ensuring that messages and content shared between users are secure and inaccessible to unauthorised parties. Moreover, Bluesky gives users control over their data by allowing them to choose what information they share and with whom. This focus on privacy distinguishes Bluesky from other social networking sites that have faced criticism for their handling of user data. Bluesky also emphasises user control and customisation. It provides a highly flexible and customisable user interface, allowing individuals to personalise their profiles and feeds according to their preferences. Users can easily curate their content, prioritise specific topics, and fine-tune their overall social media experience. Additionally, Bluesky aims to tackle the issue of algorithmic blas by offering transparency and control over the algorithms that determine content visibility, ensuring a more diverse and inclusive user experience. Another notable aspect of Bluesky is its commitment to open-source development The platform encourages collaboration and participation from developers worldwide, allowing them to contribute to its codebase and shape its future direction. This open approach fosters innovation and enables the platform to evolve rapidly based on the feedback and expertise of a diverse community of developers. Bluesky's user base has been steadily growing, attracting individuals who value privacy, customisation and a more democratic approach to social media. The platform has gained popularity among activists, journalists and individuals seeking a secure and reliable space for communication and networking. Moreover, Bluesky has drawn attention from organisations and initiatives focused on decentralisation and open-source technologies, further contributing to its growth and development. As Bluesky continues to expand, it faces both opportunities and challenges. On one hand, its commitment to privacy and user control aligns with the growing demand for more transparent and ethical social media platforms. On the other hand, it will need to overcome the network effect of established social media giants to attract a broader user base. Collaborations with existing platforms or partnerships with like-/nminded organisations could help Bluesky overcome these challenges and expand its reach. In conclusion, Bluesky is a promising social networking site that offers a decentralised, privacy-focused and user-controlled alternative to traditional social media platforms. By priortising privacy, customisation and collaboration, Bluesky aims to reshape the social media landscape and provide individuals with a more secure, transparent, and empowering online experience. As the platform continues to evolve and gain traction, it has the potential to drive positive change in the realm of social networking. (Produced by ChatGPT, 2023) We can compare this with an article about Bluesky written by a journalist for the magazine New Scientist in June 2023. Here are the first 400 (or so) words of that article. Note that Twitter has since been renamed 'X. You may have heard some buzz about a new social network called Bluesky, which is the latest app trying to seize the throne once occupied by Twitter. Here in the States. journalists are going wild for Bluesky-publications from TechCrunch to The New Yorker have covered its hip culture, analysing whether it is a sign of what's to come in the world of social media. I have been on Bluesky for about a month now, and so far it feels like a fast-motion replay of everything that went wrong on Twitter. It has only taken months, rather than years, for gooty memes and friendly posts about lunch to descend into bloody, ideological battles. Bluesky was founded by Jack Dorsey, who is a co-founder of Twitter, and its initial funding came from Twitter as well. So it is no surprise that the app looks almost exactly like Twitter, with slightly different functionality. You have your feed of pithy, 300-character "skeets" (a tongue-in-cheek portmanteau of sky and tweets). You can follow the people you like and mute or block the ones you don't. But you can't send direct messages, which is a little annoying. There are pictures, but no video. Sometimes, everything breaks. The app is brand new, after all, and it is still in an invite-only, beta-testing phase. At first, it was kind of fun when Bluesky broke. People made jokes and filed helpful bug reports for its software developers. It felt like we were building a barn together and everybody was pitching in to make sure the roof didn't collapse. When threading broke-causing people to receive tonnes of notifications if they replied to a long enough chain of skeets-users created the "hellthread", an infinitely long, chaotic conversation, full of posts about getting intoxicated and hooking up. Yes, it was completely silly, but it was also a legitimate way to figure out what was causing the problem with threading. For people working at Bluesky, like CEO Jay Graber, the appeal of the applies in its code. Unlike Twitter, Bluesky's code is open source - anyone can download it and build apps that work with it. Bluesky is also designed to be decentralised, like its rival Mastodon. Graber has written several essays about turning Bluesky into an app ecosystem, where many companies can develop products that work with Bluesky's burgeoning community. She is especially interested in something she calls "composable moderation, which is basically a way for users to build systems that control what they see on Bluesky, muting Twitter-style harassment and abuse. (Newitz, 2023)/ni. What would you say are the main differences between the two articles? You should consider the main thrust of each article, together with the tone of the writing. (4 marks) II. Which of the articles did you find most helpful for learning about the Bluesky social network? Briefly give your reasons. (2 marks) The New Scientist article mentions two other social networks (Twitter (now "X") and Mastodon) - and more recently Threads' (by Meta) has emerged. By referring to Block 3 Part 5, and searching the internet, explain the differences between Mastodon and Twitter. You may wish to consider aspects such as: aim/purpose; user base; functionality: organisation structure; and security/ privacy. (9 marks) You should write your answers to Question 3(b) in your own words as sentences and paragraphs (not as notes, bullet points or tables). Your writing should be clear and well structured, with correct spelling, punctuation and grammar. The maximum word limit for Question 3(b) is 400 words. Use the marks for each part as a guide to how much to write for that part. (15 marks)See Answer
  • Q18:or-vector Multiplication 4.1. Inner or dot product The inner product or dot product of the vector a CR with the vector b c R produces a scalar given by abba[b₁ When a E C™ and b = C, then we have Fact: a b = ba= (b)*a ele2 == e2 el' e2 == e2¹ 61 am e1'e1 e2' =a₁b₂+ +amba;b; Suppose e1 = e1(1, 3) and e2 = e1(2, 3). Then? (select all that apply) ele2 = 1 x 0+1x1+0x0 e1¹ e2 = 1 × 0+0x1+0x0 a∙b=b²a=Σab;. e1 will return false e1 will return true e2 == 1.0 will return false, because c, c, 1 except when i = 1 e1¹e1 == e2¹ * e2 == 1.0 will return true, because e, - e, = 1 for every valid i ✓ PassedSee Answer
  • Q19:The command dot (a, b) once we have included the dot function from the Linear Algebra corresponds mathematically to dot (b, a) - ba = Suppose using Linear Algebra: dot a = [1, 2, 3] b = [4, 5, 6] 1p = dot (b, a) then ip equals? (select all that apply) 4 [1 2 3 5 1x 4+2x5+3x6 30 32 a' b by definition dot (a, b) because ba=b₁a₂+...+ ban = a₁b₂+...+ a₂b₁ = a¹b ✓ Passed Fact: We cannot take the inner product of two vectors of different dimensionality. We illustrate this with an example next. 1 noina linaartlahra: datSee Answer
  • Q20:Fact: We cannot take the inner product of two vectors of different dimensionality. We illustrate this with an example next. using LinearAlgebra: dot a = [1, 2, 3, 5] [4, 5, 6] 4 b 5 dot (b, a) Run Revert LoadError: Dimension Mismatch("first array has length 3 which does not match the length of the second, 4.") DimensionMismatch("first array has length 3 which does not match the length of the second, 4.") Stale outputs x Code arrcred (15m) Stacktrace: [1] dot (::Array [Int64, 1), Array (Int64,1)) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Linear Algebra/src/generic.jl: 889 [2] top-level scope at In[38]:4 [3] include_string(:: Function, ::Module, ::String, ::String) at ./loading.jl:1091 What does the following code do? a = [1, 2, 3, 5] b = [4, 5, 6] using Linear Algebra ip = dot (b, a) It returns the inner product value of 32; Julia guesses that I meant for it to do what it did in previous example! It produces a DimensionMismatch error indicating that the lengths of the arrays do not match, so their dot product is not defined. ✓ PassedSee 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.