Hi, could help find the error in my code please. here what the exercise ask: Name the script for.sh. This script will create a shopping list. Ask the user to enter items separated by a space. Read the list. Use a for loop to write (use echo) the items to a file called shopping_list. You should use >> to append the output to the file, so each time the script is run the list should get longer. After the for loop finishes, display (use cat) the contents of the shopping list with 1 item per line. This is what i have put so far: what should i add or change
Q: 3. Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer. ...
A: The Answer is in given below steps
Q: If we know that the CPU is printed and electricity speed can't be changed, how can we change the clo...
A: Introduction: Energy Transitions: The Central Processing Unit-CPU is a term that refers to a compute...
Q: What is the purpose of using a group clause?
A: What is the purpose of using a group clause?
Q: Figure out how many subnets are available given the following network addresses: 1. 244.0.0/20
A: Below is the answer to above question. I hope this will be helpful for you....
Q: Read the two statements. Write A if Statement I is true and Statement II is false B if Statement I i...
A: What is mathematical language:- The word itself have the answer as we know what is language why we ...
Q: A workstation motherboard is a piece of hardware that connects the computer to the rest of the compu...
A: Just like workstations , a motherboard a single platform to connect all of the parts of a computer ...
Q: a)Write a small piece of code that defines a vector of integers V with 100 elements and then initial...
A: Required Code Code in Text int V[100];for (int i = 0; i < 100; i++) { V[i] = i*i;}
Q: Which of the following will work when trying to hack a login screen? O Try a list of commonly used h...
A: For the given question, option c i.e. all of these will work is correct.
Q: Let G=(V,E) be a graph. Let |V|=n and |E|=e. What is the complexity of BFS (breadth first search) as...
A: Ans: Let G(V,E) be a graph, Let |V| = n and |E| = e, so the time complexity of the BFS(breadth first...
Q: Implement the doubly link list with all the functions as one code. Your doubly link list performed t...
A: Given :- Implement the doubly link list with all the functions as one code.Your doubly link list per...
Q: Q3: complete the function that returns the area of a segment of a circle with radius r and angle the...
A:
Q: What role do data models play in database development?
A: Introduction: Data modelling is a method for defining and organising business operations. It allows ...
Q: What is the output of the following program segment? * c = putchar (c); putchar (F(c)); putchar (c);...
A: As per the requirement program is executed in c language. If we execute the same program as it is we...
Q: Instructions InchConversion.java 1 import java.util.Scanner; 2 public class InchConversion { public ...
A: Actually, Java is a high level programming language. And also object oriented . It. Is a platform ...
Q: What is included in the user interface?
A: Introduction: The user interface (UI) is the point at which humans communicate with computers and co...
Q: Then, create a basic menu system that allows a user to select which one of the functions they want t...
A: PROGRAM INTRODUCTION: Include the required header files. Declare the prototype of all the functions...
Q: Problem 5 Imagine that client A needs to send 4 messages reliably to a server B over an unreliable n...
A: There is a two systems one is client A and another one is server B, these two are communicating over...
Q: what is the big O version of 5N^2 + N^2 + 1000?
A: Solution:
Q: Suppose you are using an authentication token in a key fob or credit card. Which of the following is...
A: passive version of such a token
Q: . (a) Is 2 드 {2, 4, 6}? (b) Is {3} E {1, 3, 5}?
A: When subset symbol is used. Check for {} symbol for each element except variables. When belongs to s...
Q: ular nowadays and you can get connected almost anywhere:- at home, at work, in libraries, schools, ...
A: given - Wi-Fi stands for Wireless Fidelity. It is a technology that uses radio waves to send and rec...
Q: Write a C program that will start an editor process, get its PID, wait 3 seconds, and terminate the ...
A: Given :- Write a C program that will start an editor process, get its PID, wait 3 seconds, and termi...
Q: Why do storage facilities hold auctions without first divulging the contents of the lockers?
A: An auction is a system used to get and sell homes and things.
Q: Understanding the function of information in the generation and use of business intelligence is refe...
A: Introduction: Business intelligence is the process through which businesses employ strategies and te...
Q: Given the following IP address and Number of computers in the subnet, answer the questions that foll...
A: Below is the answer to above question. I hope this will meet your requirements.
Q: Give context-free grammars to generate the following languages: (a) L = {b"c™ :n m+ k} (c) L3 = {a"b...
A: Lets understand context free grammar: Context free grammar has following type of productions: A->...
Q: I am trying to creat a html/css/javascript page that looks like this.... I am almost done ...
A: html code: <html> <head lang="en"> <meta charset="UTF-8"> <title>Quiz</t...
Q: Show the state of the queue with the corresponding characters during the following sequence of queue...
A: Queue: Queue is an abstract data structure,queue is open at both its ends. One end is always used to...
Q: Provide a comparison between a Hub, a Switch and a Router. no plagiarism work. thanks.
A: Introduction: Provide a comparison between a Hub, a Switch, and a Router.
Q: 5. In Python language, write a program to remove all negative elements from the list given below. [-...
A: Write a Python program to remove all negative elements from the list given below. [-1, -1, 0, 2, -2,...
Q: Given the context-free grammar G below: S → aSb|bSa[SS|A Give derivations for the strings ababab, ba...
A:
Q: The manager of the company has informed his assistant to enter the age of all the workers working i...
A: Answer: Step 1: Code: while True: x = input('\nenter age:') age = x.split() for i in age: if i i...
Q: for Row = 2:N for Column = 2:N Pascal (Row, Column) = Pascal (Row-1, Column) + Pascal (Row, Column-1...
A: so in the above picture, a Matlab code is given for Pascal Triangle.
Q: What are the many types of interactions that DBMS can accommodate?
A: Dear learner , hope you are doing well , I will try my best to answer this question. Thank You!!
Q: USING MATLAB ANSWER THE FOLLOWING QUESTION
A: the answer to the following questions:-
Q: Create a toolbar and a layout.
A: Introduction: A toolbar (formerly known as a ribbon) is a graphical control element on which on-scre...
Q: Explain the distinction between the throw and throws keywords, which are used for exception handling...
A: Throw Keyword: It is used for explicitly throwing a single exception and it can be from within a met...
Q: Make a list of the many sorts of cursors
A: Answer: An SQL statement results in a cursor being created in system memory, which serves as a tempo...
Q: Given sphere_radius and pi, compute the volume of a sphere and assign to sphere_volume. Volume of sp...
A: C++ code to find volume of sphere of given radius #include <iostream> using namespace std; in...
Q: 1. If a node x is the inorder successor of node y then node x must appear in y's subtree. (In Binary...
A: inorder traversal means traversal through left root right.
Q: Ox80483ec Ox80483ed Ox80483ef Ox80483f1 Ox80483f3 Ox80483f5 Ox80483f7 Ox80483fc Ox80483fd %...
A: b) log(base10)2 value : 0.30103
Q: nceton.cs.algs4.LinearProbingHashST; import edu.princeton.cs.algs4.SeparateChainingHashST; import ed...
A: The complete code for all the files, plus an additional test file test.cpp containing the main funct...
Q: When Windows first came out, it didn't support true preemptive multitasking. "Cooperative multitaski...
A: Introduction: A multitasking approach allows two or more applications to share the host processor's ...
Q: What exactly is disc storage, and how does it function?
A: First of all, we should know what is Data Storage? The digital recording of data and documents, as w...
Q: Use an inline assembler and the cpuid instruction to write a program that finds out what type of pro...
A: срuid instruсtiоn саn be used in intel рrосessоr tо get срu sрeсifiс infоrmаtiоn. Оutрu...
Q: What is a multi-layer switch (or "L3 switch")? a networking device which can perform both routing an...
A: Given: We are asked to give an appropriate definition among the options given of the Layer 3 switch
Q: Because microprocessor CPUs are incapable of understanding mnemonics as they are, they must be trans...
A: Introduction: The microprocessor is the heart of a computer system, performing arithmetic and logic ...
Q: Show how to minimize the following logic function using switching algebra. F= AB + ABCD' + ABDE' +A'...
A: Given:F = AB + ABCD' + ABDE' +A'B'CE + ABC'E' + ABC'E'Boolean logic entities used to minimize F:Iden...
Q: Sample Output 1 Would you like to take out a loan? maybe Invalid choice; please enter yes or no. Wou...
A: code #include<bits/stdc++.h> using namespace std; double askIncome(){ double income; ...
Q: erical calculation from forward Eulerian to backward Eulerian approach?
A: Question: How can I revise this model code so that to change the numerical calculation from forward ...
Hi, could help find the error in my code please. here what the exercise ask:
- Name the script for.sh. This script will create a shopping list.
- Ask the user to enter items separated by a space.
- Read the list.
- Use a for loop to write (use echo) the items to a file called shopping_list. You should use >> to append the output to the file, so each time the script is run the list should get longer.
- After the for loop finishes, display (use cat) the contents of the shopping list with 1 item per line.
This is what i have put so far:
what should i add or change
Step by step
Solved in 5 steps with 2 images
- Turn this into a flowchart/pseudo code. //This is where the functions go void insertfront(int data);void insert(int data);void display();void deletedata(int data);void reverselist();void searchdata(int data);void swap();void datasort();void deleteList(); #include <iostream>#include <stdlib.h>using namespace std; struct Node {int data;struct Node *next;}; struct Node* head = NULL;struct Node* rhead = NULL;int count1; //insert in front for reversedlistvoid insertfront(int data){Node* new_node = (Node*) malloc(sizeof(Node)); new_node->data = data; new_node->next = rhead; rhead=new_node;}//insert at endvoid insert(int new_data){Node* ptr;ptr = head;Node* new_node = (Node*) malloc(sizeof(Node)); new_node->data = new_data; new_node->next = NULL;if (head == NULL) { head = new_node; } else{while (ptr->next!= NULL) { ptr = ptr->next;}ptr->next=new_node;}count1++;}//display listvoid display() {struct Node* ptr;ptr = head;if(head==NULL){cout<<"Sorry the list…6. sum_highest_five This function takes a list of numbers, finds the five largest numbers in the list, and returns their sum. If the list of numbers contains fewer than five elements, raise a ValueError with whatever error message you like. Sample calls should look like: >>> sum_highest_five([10, 10, 10, 10, 10, 5, -17, 2, 3.1])50>>> sum_highest_five([5])Traceback (most recent call last): File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode exec(code, self.locals) File "<pyshell#44>", line 1, in <module> File "/homework/final.py", line 102, in sum_highest_five raise ValueError("need at least 5 numbers")ValueError: need at least 5 numbersGiven helper function: (Hint: This function is to be used to complete the docstring of the function below)def is_number(value: str) -> bool: """Return True if and only if value represents a decimal number. >>> is_number('csc108') False >>> is_number(' 108 ') True >>> is_number('+3.14159') True """ return value.strip().lstrip('-+').replace('.', '', 1).isnumeric()QUESTION: Complete the docstring using the information provided. def convert_data(data: List[list]) -> None: """Convert each string in data to an int if and only if it represents a whole number, and a float if and only if it represents a number that is not a whole number. >>> d = [['abc', '123', '45.6', 'car', 'Bike']] >>> convert_data(d) >>> d [['abc', 123, 45.6, 'car', 'Bike']] >>> d = [['ab2'], ['-123'], ['BIKES', '3.2'], ['3.0', '+4', '-5.0']] >>> convert_data(d) >>> d…
- •is Valid Phone Number(): ReturnsTrue if the provided phone number (represented as a string) is cor-rectly formatted, otherwiseFalse. To be considered correctly formatted, phone numbers must bewritten as###-###-####, where#is a digit between 0 and 9 .•validatePhoneBook(): A phone book is a list where each entry is a phone book record (represented asa dictionary; see below for more details). This function checks each phone book record in the phonebook for correctly formatted phone numbers.A phone book record is a dictionary which initially has two keys: the key"name"mapped to thecontact’s name (string) and the key"phone number"mapped to that contact’s phone number (alsoa string).validatePhoneBook()adds a new key"valid"to the record with the valueTrueif the phonenumber is formatted correctly, otherwiseFalse. 1. Write white-box and black-box tests for the function is ValidPhoneNumber(). You should do this with-out Python, either on paper, or in a simple document. Don’t worry about…Modify the sample code to prompt the user for a name. Have theprogram search the existing list for the entered name. If thename is in the list, display the corresponding phone number;otherwise display this message,The name is not in the current phone directory. #include<iostream>#include<iomanip> using namespace std;const int MAXNAME = 30;const int MAXTEL = 15;struct Tele_typ{char name[MAXNAME];char phone_no[MAXTEL];Tele_typ* nextaddr;};void display(Tele_typ*);int main(){Tele_typ t1 = { " Cage, Mark", "(555) 898-2392" };Tele_typ t2 = { " Dolan, Nick", "(555) 682-3104" };Tele_typ t3 = { " Lennon, John", "(555) 718-4581" };Tele_typ* first; first = &t1;t1.nextaddr = &t2;t2.nextaddr = &t3;t3.nextaddr = NULL;display(first);return 0;}void display(Tele_typ * contents) // of type Tele_typ {while (contents != NULL){cout.setf(ios::left);cout.width(25); cout << '\n' << contents->name;cout.width(20); cout << contents->phone_no;contents =…Modify the sample code to prompt the user for a name. Have theprogram search the existing list for the entered name. If thename is in the list, display the corresponding phone number;otherwise display this message,The name is not in the current phone directory. #include<iostream>#include<iomanip> using namespace std;const int MAXNAME = 30;const int MAXTEL = 15;struct Tele_typ{char name[MAXNAME];char phone_no[MAXTEL];Tele_typ* nextaddr;};void display(Tele_typ*);int main(){Tele_typ t1 = { " Cage, Mark", "(555) 898-2392" };Tele_typ t2 = { " Dolan, Nick", "(555) 682-3104" };Tele_typ t3 = { " Lennon, John", "(555) 718-4581" };Tele_typ* first; first = &t1; t1.nextaddr = &t2; t2.nextaddr = &t3; t3.nextaddr = NULL; display(first); return 0;}void display(Tele_typ * contents) // of type Tele_typ {while (contents != NULL){cout.setf(ios::left);cout.width(25); cout << '\n' << contents->name;cout.width(20); cout << contents->phone_no;contents =…
- Write a loop that finds the smallest value. Print it and the index code format: #include <iostream>using namespace std; #include <cstdlib> // required for rand() int main(){// Put Part2 code here // Declare smallestFoundSoFar// Q: what should be its initial value?int indexOfSmallest = -1;// sign that it is not initialized Part 2 code #include <iostream> using namespace std; // part 1 code#include <cstdlib> int main() { srand(17); const int ARRAYSIZE = 20; // size for the array int RandArray[ARRAYSIZE]; // array declared int i; // to iterate the loop // this loop will store thei random number in the array for (i = 0; i < ARRAYSIZE; i++) RandArray[i] = rand() % 100; // this loop will print the array for (i = 0; i < ARRAYSIZE; i++) cout <<"randArray["<< i <<"]=" << RandArray[i] << endl; int largestFoundSoFar=-1; // anything is larger than this! int indexOfLargest = -1; // sign that it is not initialized for (i = 0; i…The foreach loop is intended to function with the __________, a temporary, read-only variable. a. variable element b. variable loop c. variable index d. variable iterationCreate a Flowchart for this code. #Declaring and initializing the listcars = ["Buick","Ford","Honda"]colors = ["Red","Blue","Black","White","Green"]aType = ["Sedan","SUV","Sports","Coupe","Truck"]#Using list comprehension to generate a listarr = [[0 for i in range(len(cars))] for j in range(len(cars)*len(colors))]#Outer for loopfor i in range(0, len(colors)*len(cars)): #Inner for loop for j in range(0, len(cars)): #Check if j =0 if j == 0: #Initializing the list with cars(i%5) arr[i][j] = cars[int(i/5)] #chck if j = 1 if j == 1: #Initializing the list with colors(i%5) arr[i][j] = colors[int(i % 5)] #check if j = 2 if j == 2: #Initializing the list with aType(i%5) arr[i][j] = aType[int(i % 5)]#Iterating through the 2D listfor i in range(0, len(arr)): #Print each list one by one print(arr[i])
- ava problem: Write an application that allows a user to enter the names and birth dates of up to 10 friends. Continue to prompt the user for names and birth-dates until the user enters the sentinel value “ZZZ” for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birth-date or an error message if the name has not been previously entered. The loop continues until the user enters “ZZZ” for a name.this is code #include <iostream> using namespace std; struct Node { int data; struct Node *next; }; struct Node* head = NULL; void insert(int new_data) { struct Node* new_node = (struct Node*) malloc(sizeof(struct Node)); new_node->data = new_data; new_node->next = head; head = new_node; } void display() { struct Node* ptr; ptr = head; while (ptr != NULL) { cout<< ptr->data <<" "; ptr = ptr->next; } } int main() { insert(3); insert(1); insert(7); insert(2); insert(9); cout<<"The linked list is: "; display(); return 0; } i want Re-implement it on doubly linked list take in account the set-position method and the operator overload and coy constructor and destructor ? in c++The code below prompts the user to enter their full name, and then converts the name to a list. Complete the code to output the person's initials. For example, if the user enters 'Adam Jones', then your code will output 'AJ'. If the user enters 'Adam Daniel Jones', then your code will output 'ADJ'. name = input('Enter your full name: ')nameList = name.split()nameList