User A wants to read a data through any of the input device and need to perform the following task using shell script, Find the reverse of a given number
Q: Accept from the user today’s date and your Date of birth in the format dd-mm-yyyy. Assuming you…
A: The program is to find the total time user had spend in sleeping, eating an reading. Sleeping and…
Q: Which of the following operations is not associative? Select the correct response O XOR O AND O NOR…
A: Associative law says that changing paranethesis doesn't impact on result.
Q: Which data directive is responsible for the creation of a 64-bit unsigned integer variable?
A: Integer with a length of 64 bits, not signed. This variable has a maximum value of (2^64)-1 and a…
Q: Which of the following is the correct representation for a storage capacity of a tape? a. Data…
A: Data Recording density is the number of bytes of memory that can be stored in unit length which is…
Q: Which of following function declaration makes a double parameter x to be passed-by-reference?…
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: Which action fixes the error in the given code? OA) replacing line 6 with Long c2 = vI; O B)…
A: Java Code:- public class App { public static void main(String[] args) { int vI = 10; float vF =…
Q: f I want to redirect standard output to the file, and standard error to the terminal, how many…
A: Redirect standard output to the file:- In output redirection the file to which the output is…
Q: Which of the following arguments Is valıd
A: Argument: In mathematics, an argument is a sequence ofpropositions (called premises) followed by…
Q: Given the following C++ code'snippet, provide the code to store the address of test grade in…
A: - We need the exact code snippet to store the address of test_grade in ptr_test_grade in c++. -…
Q: 1.below is my code for shell script using gitbash l want it to produce an output like: 2→→1x2…
A: As per the given problem, we have to modify the given program such that the output is of the format…
Q: Exercise 5: Write script that take two arguments, and output the every number between from arg1 to…
A: Exercise: 5 #!/bin/bashx=$1while [ $x -le $2 ]do echo "$x" x=$(( $x + 1 ))done
Q: unction based on the following information: Your mission is to encrypt a secret message (text only,…
A: Cryptography is technique of securing information and communications through use of codes so that…
Q: What is the return value in the function call frame for c? O 110 O 111 O 112 O 221 O 222 O 223 O…
A: GIVEN:
Q: Which of the following is called ?insertion/put to operator اخترأحد الخيارات ;a. > ;b. < ;c.…
A: Please give positive ratings for my efforts. Thanks. ANSWER &lt; stands for lesser than…
Q: Write a program to permanently store the data entered by the user. When user is done with Input,…
A: (1)First we need to open a file using ofstream (2)Now read the string and save it into the file…
Q: What value will remain in the accumulator after executing each of the following program segments?…
A: There are four parts in this question that is A,B,C,D , so let's see one by one with solution...
Q: What will be the contents of AX and DX after the following operation?mov dx,0mov ax,222hmov…
A: Instruction: The given instruction is as follows: mov dx, 0 mov ax, 222h mov cx, 100h mul cx
Q: ) How many bytes are contained in each of the following data types? I) word II) doubleword III)…
A: word 2 bytes (16 bits)
Q: Which INT 21h function writes a single character to standard output?
A: INT 21h function to write a single character: The INT 21 function 2 and INT 21 function 6 writes…
Q: What is the content of the accumulator after executing each of the following instructions? Answers…
A: The instructions, their meaning, and contents of the accumulator after every execution have been…
Q: Which function is used to read a single character from the console in ?++C
A: ch is the character used for storing single character data
Q: (A) Write a program in a script file to solve these three equations using the command (solve). Make…
A: For script A. Read the value of x1 x2 x3 and x4. Then solve the three equation for the value of x1…
Q: Which of the following preprocessor directive is correct? a. import iostreamb. #include…
A: Correct option is c
Q: 3. Write an m-file program to calculate x1 and x2, where -b7 V6? - 4ac X1, x2 = %3D 2a Find the…
A: Kindly change the values of a, b and c as per the parts. clcclear all a = 6;b = 5;c = 8;…
Q: If you run the following part of a code via EMU8086 emulator: … .DATA MSG DB 13 DUP (‘$‘) .CODE ……
A: Please give positive ratings for my efforts. Thanks. ANSWER Here , DUP instruction is used over…
Q: Which of the following commands inserts an integer operand into ST(0)?
A: Introduction: The FIELD (Load Integer) instruction converts an integer operand in memory to…
Q: Which INT 21h function reads a single character from standard input?
A: INT 21h is the assembly language mnemonic used to perform a system call. Several functions are used…
Q: 1. Write a shell script using else if to read input X, Y and calculate Z based on the following…
A: Complete answer in shell programming is given below:
Q: Show the argument below is invalid s VpAm 8 m
A:
Q: echo command, answer: (i) the ASCII number code for new line (enter key) and (ii) for any one letter…
A: part (i) Prints ASCII code for newline character echo "\n" | xxd -p
Q: Create a function called tempF2C that will accept as input a single temperature in degrees…
A: Given :- In the above question, the term function is mention in the above given question Need to…
Q: Which of the following diagrams doesn't represent the function (F=AB+CD)? Select one: :D B :D D
A: - The given gates are (AND) and (OR) gates with some inversions in between them. - Functionality of…
Q: Which data directive creates a 64-bit unsigned integer variable?
A: QWORD data directive creates a 64-bit unsigned integer variable.
Q: nvert the following python regex to a DFA: ^(A?(B|CD)*A+
A: SUMMARY: -Hence, we discussed all the points.
Q: Implement the following function using? a)8x1 MUX b)4x1 MUX F=ABC'+A'BC'+A'BC+AB'C
A:
Q: 7. Which function is used to read a single character from the console in C++? a) cin.get(ch) b)…
A: Given, Choices: cin.get(ch) getline(ch) read(ch) scanf(ch) We have to find among the given…
Q: The DateAdd function returns which data type? Select an answer: integer long date decimal Question…
A: The int data type is the primary integer data type in SQL Server.
Q: SIG_ERR is a global variable returned by std::signal, indicates that an error has occurred. When we…
A: In this problem, we only need to explain why we got this error in the program. This program looks…
Q: ite a shell script to print sum of digits of the given number. Get input from user and display the…
A: Required: Write a shell script to print sum of digits of the given number. Get input from user and…
Q: Which of the following matches regexp /[a-z][\.\?!]\s+[A-Z]/
A: First [a-z] Match a single character present in between small a to small z. Then [\.\?!]…
Q: IF AL = FFH and CL=02H, then after adding both registers, what will be the value/status of ZF flag?…
A:
Q: Q1/Write ALP and machine code to find the number of ones to the contents of memory locations…
A: Step 1 Memory Mnemonics Operands Comment 3000 MVI B, 00 [B] <- 00 3002 MVI C, 08 [C]…
Q: Which of the error is raised when the quantity of data is too much? A. too_large_err B.…
A: Answer is in step 2
Q: Which of the below statements is true? a. The .mat format is a binary format. i.e if we try to open…
A: The .mat format is not the binary format file. i.e we can open the file using notepad and can read…
Q: Write a shell script to accept two number and if the number is positive display even numbers from 2…
A: Shell Script Program: a. Using while loop CODE: #user inputecho "Enter number: "read necho "The…
Q: Which is the correct output of the following code? a. 8 b. 10 c. 9 d. 7
A:
Q: 2-Give the full term of the following: RST, INTA, INTR
A: The Answer for the given question in step-2.
Q: Which of the following diagrams doesn't represent the function (F=AB+CD)? Select one: B D.
A: Which of the following diagram doesn't represent the function F=AB+CD?
Q: three functions that each generate 10 unique dataset files of integers separated by a comma ",".…
A: Here is the answer below:- Code:- #include iostream.h #include SelectionSort.h #include BubbeSort.h…
Q: Q6) Which of the following function is used to print the output of a variable? a. printer b.…
A: Scanf is used to read input So option 3 is wrong
Step by step
Solved in 2 steps with 2 images
- Which of the following is/are valid ways to allocate memory for an integer by dynamic memory allocation in CPP? a. int *p = new int(100); b. int *p; p = new int; *p = 100; c. int *p = NULL; p = new int; *p=100; d. Only 1,2 e. All of theselinux fix this code to pure system IO calls and redo it into standard IO calls("12345\n 6789\n 10"-->info in the text file.) #include<stdio.h>#include<fcntl.h> void main(){ char a[9999];int b,line=0; int x=open("list.txt", O_RDONLY);while (b=read(x, a, sizeof(a))){for (int i=0; i<b; i++){if (a[i] == '\n'){line++;}}} printf("#lines: %d",line+1); }Review the following program: import urllib.request, urllib.parse, urllib.error fhand = urllib.request.urlopen('http://data.pr4e.org/romeo.txt') counts = dict() for line in fhand: words = line.decode().split() for word in words: counts[word] = counts.get(word, 0) + 1 print(counts) 3.1 Provide an explanation for EACH line of the following program. 3.2 Run the above program and include a full window screenshot with system time and date in the answer. 3.3 Run the above program with https://www.py4e.com/code3/romeo-full.txt and include a full window screenshot with system time and date in the answer.
- By using Linux (Centos 7 or 8) develop a C program to apply the memory times and times, run with this shellprogram, then show the MemToal,MemFree,Active with excel file. Here are the codes for reference. Code no.1: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> main(int argc, char *argv[]) { void * p[100]; int i,times,msize; if(argc!=3) { times=20; msize=1024; } else { sscanf(argv[1],"%d",×); sscanf(argv[2],"%d",&msize); if(msize>10240) msize=10240; msize=1024*msize; if(times>100) times=100; } for( i=0; i<times; i++) {…4) Which of the following is/are valid ways to allocate memory for an integer by dynamic memory allocation in CPP? a. int *p = new int(100);b. int *p; p = new int; *p = 100;c. int *p = NULL; p = new int; *p=100;d. Only 1,2e. All of these 5) Choose the correct option?#include<iostream>using namespace std; class Base {}; class Derived: public Base {}; int main(){Base *bp = new Derived;Derived *dp = new Base;} a. No Compiler Errorb.Compiler Error in line “Base *bp = new Derived;”c. Compiler Error in line ” Derived *dp = new Base;”d. Runtime ErrorThe following code must be written in python for this HW assignment. I will provide a skeleten for the code and you must write some lines of code to satisfy the objective of the prorgram. You will develop a web server that handles one HTTP request at a time. Your web server should acceptand parse the HTTP request, get the requested file from the server’s file system, create an HTTP responsemessage consisting of the requested file preceded by header lines, and then send the response directly tothe client. If the requested file is not present in the server, the server should send an HTTP “404 NotFound” message back to the client. Put an HTML file (e.g., HelloWorld.html) in the same directory that the server is in. Run the serverprogram. Determine the IP address of the host that is running the server (e.g., 128.238.251.26). Fromanother host, open a browser and provide the corresponding URL. For example:http://128.238.251.26:6789/HelloWorld.html‘HelloWorld.html’ is the name of the file you…
- IN SCALA PLEASE COULD YOU COMPLETE THE CODE OF FUNCTIONS: get_csv_url, process_ratings, process_movies, groupById, favourites, suggestions and recommendations import io.Source import scala.util._ // (1) Implement the function get_csv_url which takes an url-string // as argument and requests the corresponding file. The two urls // of interest are ratings_url and movies_url, which correspond // to CSV-files. // // The function should ReTurn the CSV-file appropriately broken // up into lines, and the first line should be dropped (that is without // the header of the CSV-file). The result is a list of strings (lines // in the file). def get_csv_url(url: String) : List[String] = ??? val ratings_url = """https://nms.kcl.ac.uk/christian.urban/ratings.csv""" val movies_url = """https://nms.kcl.ac.uk/christian.urban/movies.csv""" // testcases //----------- //: //val movies = get_csv_url(movies_url) //ratings.length // 87313 //movies.length // 9742 // (2) Implement two functions that…the following must be done using shell scripting in linuxThe script will read from stdinThe format of the matrix is fixed write a script that prints the sum of each row the matrix can also include 1 and 2 digit numbers input| 106 150 || 100 125 || 115 215 | output256225330QUESTION ATTACHED KINDLY SEE AND MATCH INPUT-OUTPUT AS IT IS. ALSO, USE THE BELOW TEMPLATES WHILE MAKING A SOLUTION ---------TEMPLATES------------ main.cpp #include <iostream>#include <sstream>#include "Donor.cpp"using namespace std;int main(){//Fill your code heretry{//Fill your code here}catch(const char* c){//Fill your code here}return 0;} Donor.cpp #include <iostream>#include <sstream>using namespace std;class Donor{protected:string name;int age;int weight;string bloodGroup;public:Donor(){}Donor(string name, int age, int weight,string bloodGroup) {this->name = name;this->age = age;this->weight = weight;this->bloodGroup = bloodGroup;}bool validateDonor(Donor donor){//Fill your code here }};
- // switch_stdout.c: demonstrates use of dup2() and dup() to redirect // standard output to a new location temporarily and then restore it. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> int main(){ int stdout_bak = dup(STDOUT_FILENO); // make a backup of stdout system("rm -f mystery.txt"); // remove file using a shell command int out_fd = open("mystery.txt", // open file mystery.txt O_WRONLY|O_CREAT, // for writing, create if needed S_IRUSR|S_IWUSR); // give user read/write permission if(out_fd == -1){ // check for errors opening file perror("Couldn't open file 'mystery.txt'"); exit(1); // bail out if open fails } printf("1. Now you see me.\n"); // print to the screen dup2(out_fd, STDOUT_FILENO); // change stdout to go to mystery.txt printf("2. Now you don't!\n"); // print goes to…I have a "user.json" file that looks like this { "something@somewhere.com": "maybe", "john@beatles.uk": "lennonj!", "paul@beatles.uk": "mccartney", "mick@rollingstones.uk": "jaggerm!" } using java script i have to parse this file and then check this email and file conbinations against user input This is the code i m using to parse the file. function lookUpCredentials(filePath, cb) { fs.readFile(filePath, (err, fileData) => { if (err) { return cb && cb(err); } try { const object = JSON.parse(fileData); return cb && cb(null, object); } catch (err) { return cb && cb(err); } }); } lookUpCredentials("./user.json", (err, data) => { if (err) { console.log(err); return; } credentials = data; }); and this is the code i m using to get input from the user app.post('/login', (req, res) => { let username =…Trace the following Code and then print the output. msg db 'hello world$' newline db 10,13,'$' buffer db 10 dup mov ah,9 mov dx,offset msg int 21h ;new line mov ah,9 mov dx, offset newline int 21h ;enter a string from the keyboard lea dx,buffer mov ah,0ah int 21h ;new line mov ah,9 mov dx,offset newline int 21h ;adding the $ symbol at the end of the string mov bx,0 mov bl,buffer[1] mov buffer[bx+2],'$' mov ah,9 mov dx,offset buffer+2 int 21h