Create a function that takes two integers, num and n, and returns an integer which is divisible by n and is the closest to num. If there are two numbers equidistant from num and divisible by n, select the larger one. Examples roundNumber (33, 25) <-> 25 roundNumber (46, 7) → 49 roundNumber (133, 14) 140 Notes n will always be a positive number.
Q: A lapindrome is defined as a string that, when split in the middle, gives two halves with the same…
A: Input-Output Details: First line of input contains a single integer T, the number of test cases.Each…
Q: The cook must participate in the presence before each class, i.e. call out the names of the students…
A: Step-1: StartStep-2: Declare variable testCase and take input from userStep-3: Start a loop till…
Q: The message received at the receiver end is 1011011. Assuming even parity from left to right, state…
A: Given that, The message received at the receiver end is 1011011. It is even parity from left to…
Q: What are the two types of time, and how are they different? Why does t make sense to have both types…
A: The temporal database consists of two time intervals: • Valid time and • Transaction time Valid…
Q: An I/O-bound program is one that, if run alone, would spena more time waiting for I/O than using the…
A: This is a method of putting the Shortest Remaining Path Time First algorithm's principle into…
Q: Using C# and Windows Presentation Foundation (WPF), design and implement a standalone desktop time…
A: In this problem, we need to design the code in the C# programming language. desktop time management…
Q: What are the return values of the following statements in R x<-5 & y<-6
A: Given statements: x<-5 & y<-6 Let's perform addition operation with return value. R…
Q: Mr. Cook is the manager of Code cinemas and after a long break the theatres are open to the public…
A: Input-Output Format: The first line of input will contain a single integer T, denoting the number…
Q: A signal with 60 milliwatts power passes through a device with an average noise
A: The answer is
Q: What protocols are used to configure trunking on a switch?
A: VLAN Trunking Protocol (VTP): To exchange VLAN data, Cisco's proprietary VTP protocol is employed.…
Q: Questions P17 and P18 are related to the code skeleton of the function below. The function…
A: Read Dictionary From File in Python:- A Dictionary in Python is collection of key-value pairs, where…
Q: In a dual core processor, consider first four letters of your name coming as processes each having…
A: Assumptions and given data Given that the size of each process is equal to its ASCII code in MBs.…
Q: the part B
A: Part B) The algorithm starts from the root node by initializing the null value 1. If the root is…
Q: The IBM System/370 architecture uses a two-level memory structure and refers to the two levels as…
A: The question has been answered in step2
Q: Discuss the three types of mobility in a wireless LAN.
A: Answer:- i) No-transition ii) BSS-transition iii) ESS-transition
Q: how to declare this ? c programming
A: Let us see the answer below.
Q: In a two-class, two-action problem, if the loss function is A11 = A22 A12 = 10, and A21 = 1, write…
A: Given loss function is λ11 = λ22 = 0, λ12 = 10, and λ21 = 1 Expected loss or Conditional risk…
Q: NEED HELP PYTHON CODING: Create a program to calculate the following. Store the solution in a…
A: Introduction Python has a straightforward syntax that resembles that of English. Python's syntax…
Q: Create a function that outputs the result of a math expression in words. Examples wordedMath("One…
A: const calc = { zero: 0, one: 1, two: 2, 0: 'Zero', 1: 'One', 2: 'Two', plus(n1, n2) { return…
Q: With persistent communication, a receiver generally has its own local buffer where messages can be…
A: Background information A persistent communication server keeps a message for as long as it takes to…
Q: Input 1 gaga Output YES
A: Python program
Q: Q: Suppose you were asked to develop a distributed application that would allow teachers to set up…
A: A distributed application consists of one or more local or remote clients that communicate with one…
Q: Write a declaration for floating-point variable lastVal that’s to retain its value between callsto…
A: Lets see the solution.
Q: What is the difference between a port address, a logical address, and a physical address?
A: Port address : There square measure several applications running on the pc. Every application run…
Q: Pros & Cons of an Open Source Operating Systems
A: The open-source operating system allows the use of code that is freely distributed and available to…
Q: With persistent communication, a receiver generally has its own local buffer where messages can be…
A:
Q: Q2 4-7. A four-bit binary number is represented as A3A2A1A0, where A3, Az, A1, and Ao represent the…
A: four-bit binary number is represented as AзA2A1A0, where A3, A3, A1, and A0 represent the individual…
Q: Create a function using currying that will add a car maker name as a property to the carLot object…
A: In this problem, we need to design the code in the java Script programming language. Input -…
Q: To achieve totally-ordered multicasting with Lamport timestamps, is it strictly necessary that each…
A:
Q: Create a function that returns an Earned Run Average (ERA). An ERA is calculated by multiplying 9 by…
A: The JS code is given below with output screenshot
Q: Create a function that tweaks letters by one forward (+1) or backwards (-1) according to an array.…
A: function tweakLetters(str, arr) { return Array.from(str).map((char, index) => { let code =…
Q: Whether VRC error detection method is used for single bit error or burst error.
A: 1) VRC stands for Vertical Redundancy Check 2) It is also known as Parity Check. In this method, a…
Q: briefly define three file allocati
A: Introduction: Allocation methods specify how files are stored in disc blocks. There are three main…
Q: 5. Find the minimum bandwidth of a FDM system which multiplex five devices, each requiring 4000 Hz.…
A: Number of channel = 5 Each channel bandwidth = 4000 Hz Guard Band = 200 Hz So, Bandwidth = (No. of…
Q: Compare and contrast a circuit-switched network and a packet- switched network.
A: Switching a circuit: Circuit Switching is a service that emphasizes connections. It offers a direct…
Q: Label the Recursion Requirements. int fact (int n) { int result; } if(n==1) return 1; result fact…
A: The following are the requirements for a successful recursion: Termination condition to break out…
Q: An input string S of length N is transferred through the network using a special protocol. The…
A: Algorithm The first line of input will contain a single integer T, denoting the number of test…
Q: How does a VLAN reduce network traffic?
A:
Q: Q: Suppose you were asked to develop a distributed application that would allow teachers to set up…
A: INTRODUCTION: distributed application A distributed application's definition. One or more local or…
Q: Java
A: Answer in Step 2
Q: Suppose a computer sends a packet at the network layer to another computer somewhere in the…
A: What happens to the packet? The packet passes through error checking before utilizing the…
Q: Which of the following statements are correct about the given code snippet? class A: def…
A: Introduction: Inheritance allows us to construct a class that inherits all of the methods and…
Q: Distinguish between multilevel TDM, multiple slot TDM, and pulse- stuffed TDM.
A:
Q: Explain why transient synchronous communication has inherent scalability problems, and how these…
A:
Q: Explain the Pros and Cons of layer design?
A: Software design refers to the basic structure of any software system and incorporates any aspect…
Q: List and briefly define three file allocation methods.
A: The answer to the question is given below:
Q: More than 90% of the microprocessors/micro-controllers manufactured is used in embedded com
A: The answer is
Q: Problem 2. An electricity board charges the following rates mentioned in the table for the use of…
A: As per the given question, we need to calculate the monthly bill of a user based on the selected…
Q: In your own words, describe the two motivations for defining functions inyour programs.
A: A function is a section of code that only executes when called. You can supply parameters—data—to a…
Q: With asynchronous RPCs, a client is blocked until its request has been accepted by the server. To…
A:
provide the solution onthe problem in JS
Step by step
Solved in 2 steps with 1 images
- To translate a sentence into pig Latin, create a function. When a word is written in pig Latin, its first character is dropped, shifted to the word's tail, and the letters "ay" are added. For instance, "hello world" would be "ellohay orldway" in pig Latin. Your function can be written to presume that each word has at least two letters, that there is one space between each word, and that there are no punctuation marks.Create a function sumofAllOdd(s,e) that will return the sum of all odd numbers in a range of inputted numbers s (starting number), e(ending number). For example: Test Result sumofAllOdd(22,55) sumofAllOdd(5,10) Answer:(penalty regime: 10, 20, ... %)‘Write a function get_names(), which prompts the user for a sequence of names, where each name can contain an arbitrary mix of uppercase and lowercaseletters and space characters, until the user enters "exit". The function should then return a list of capitalized names, whith no leading or trailing space, and with‘one space character separating adjacent words, Write a main() function to test the get_names() function. For example: Enter a name (exit to stop): bill clintonEnter a name (exit to stop): john tigER sMith Enter a name (exit to stop): mary beautiful Graceland Enter a name (exit to stop): exit [Bill Clinton’, “John Tiger Smith’, ‘Mary Beautiful Graceland’ ]
- To translate a sentence into pig Latin, create a function. When a word is written in pig Latin, its first character is dropped, shifted to the word's tail, and the letters "ay" are added. For instance, "hello world" would be "ellohay orldway" in pig Latin. Your function can be written to assume that each word has at least two characters, is separated by a space, and is free of punctuation.//Write a function that loops through and console.log's the numbers from 1 to 100, except multiples of three, log (without quotes) "VERY GOOD" instead of the number, for the multiples of five, log (without quotes) "SUPER AWESOME". For numbers which are multiples of both three and five, log (without quotes) "VERY GOOD SUPER AWESOME" Console log out: 12VERY GOOD4SUPER AWESOMEVERY GOOD78VERY GOODSUPER AWESOME11VERY GOOD1314VERY GOOD SUPER AWESOME1617VERY GOOD19SUPER AWESOMEVERY GOOD2223VERY GOODSUPER AWESOME26VERY GOOD2829VERY GOOD SUPER AWESOMEPYTHON!!! Write a function that receives 3 assignment grades, a1, a2, a3, and a final grade, f, for a student and returns the corresponding letter grade of the student. The weights for the assignments and the final are 0.2, 0.2, 0.2, and 0.4, respectively. You can use the following table for matching grades to letters: 95-100 -> A1 90-94 -> A2 85-89 -> A3 80-84 -> B1 75-79 -> B2 70-74 -> B3 65-69 -> C1 60-64 -> C2 55-59 -> C3 40-54 -> D 0-39 -> F For example, compute_letter(80, 60, 40, 70) returns "C2" because 80 * 0.2 + 50 * 0.2 + 40 * 0.2 + 70 * 0.4 = 62 and 62 corresponds to C2. Note that, you are expected to do rounding. For example, 39.4 is F, whereas 39.5 is D. You can use the builtin round() function for this. Please google this function and learn how to use it. """ def compute_letter(a1, a2, a3, f):
- Write a function that converts a phrase into pig Latin. A word is convertedto pig Latin by removing the first character of the word, placing it at theback of the word, and adding the characters “ay” to the word. For example,“hello world” in pig Latin is “ellohay orldway.” Your function can assumethat each word consists of at least two letters and that each word is separatedby one space, with no punctuation marks.Write a function validate_date(date_string) which takes in a datestring and checks if the datestring is valid. If the string is valid, we want to return a tuple containing True and the date_string itself. If the string is invalid for a specific reason, we want to return a tuple containing False and the error code explaining what was wrong with the date string passed in. Below is the error codes for reasons why a string can be invalid (based on criteria on validity, read above): -1 --> date_string does not separate the day, month, and year with slashes. -2 --> day, month, or year are not numeric. -3 --> month out of range (not between 1 and 12) -4 --> day is out of range (not between 1 and last day of the month) For instance, if validate_date(date_string) is called with "01/12/2022" as the argument, the return value is (True, "01/12/2022") because "01/12/2022" is a valid string. If validate_date(date_string) is called with "01/44/2022" as the argument, the return value is…Create a function that translates a sentence into pig Latin. To convert a word to pig Latin, remove the initial character, move it to the rear of the word, then add the characters "ay" to the word. In pig Latin, "hello world" is "ellohay orldway." Your function can presume that each word has at least two characters and is separated by a single space with no punctuation marks.use c#
- In python, create a function adjust_values() with the arguments binaries and data. Binaries are only composed of binary values, and data are made up of integers. If binaries[0] is ‘0,’ the data should only be an even number. If it is, don’t change its value. If not, subtract 1 from it. If binaries[0] is ‘1,’ the data should only be an odd number. If it is, don’t change its value. If not, add 1 to it. Return the edited data in tuples of 3. Should the length of data be greater than the length of binaries, simply keep the remaining values as it is. To do (example below): binaries = 01001101 data = [201, 22, 93, 23, 344, 21, 53, 56, 22] The output should be in tuples of 3: [(200, 23, 92), (22, 345, 21), (52, 57, 22)]Define a function called digits that accepts two integer numbers m and n , and that displays m rows of n columns using the following pattern of digits. The first row starts with 1, the second row with 2, and so on until the 10th row starts with 0. Then the counter returns to 1 for the 11th row, then to 2 for the 12th, etc. For columns, the numbers are always incremented by 1 from the previous column, Except for the 9 that goes to 0. For example, the call digits(4, 7) must produce: 1234567234567834567894567890and the call numbers(12, 23) must produce: 123456789012345678901232345678901234567890123434567890123456789012345456789012345678901234565678901234567890123456767890123456789012345678789012345678901234567898901234567890123456789090123456789012345678901012345678901234567890121234567890123456789012323456789012345678901234Note that your function should not return anything, only display at the console.Write a function find_phone_numbers(text, code='357') that uses a regex to find and extract all the Cypriot phone numbers in a given text sequence. A valid Cypriot phone number starts with either 00 or + followed by the country code 357 and afterwards, 8 numeric digits. Examples: >> find_phone_numbers("""dkdkkdldld +35799394903 dkdkfk 0035799802358 fkfkfld.\n dldld;s;sdd dkdk +30690040404 and +3579933040""") ['+35799394903', '0035799802358'] and also Write a function is_zip_code(zipcode) that uses a regex to test if a given string evaluates to a correct zip code. A correct zip code has a length of 6 characters with the 3 first being letters and followed by 3 digits. Examples: is_zip_code('ABC123') -> True is_zip_code('FYA598') -> True is_zip_code('wyz940') -> True is_zip_code('AB123') -> False is_zip_code('ABCD123') -> False is_zip_code('ABC12') -> False