13. Consider a freight company. This company may deliver packages around the world. Each package has a tracking code which consists of a string in the following format: destination, country code, a suburb location code 16 which is an integer number, the character 'C', an integer number represent- m ing the customer id code, the character 'W', followed by an integer which di contains the weight of the package. An example of a tracking code in this format is AU2010C42W74. Write a program which reads a tracking code ln from the console and uses regex to determine if the tracking code is valid.
Q: Write an assembly program to set R0=1 if there's a 5 in one of ten memory locations, starting at x31...
A:
Q: Write code that outputs variable numDays as follows. End with a newline. Ex: If the input is: 3 the ...
A: Java program which user input and print the given Output : Days: 3
Q: What does it mean to have a gaming laptop computer?
A: Introduction: A gaming laptop is a small and portable computer that has a monitor.
Q: Using C program. Create an array named NUMBERS with 10 cells. You are to initialize all of the cells...
A: PROGRAM INTRODUCTION: Include the required header files. Declare the array to store ten values. Use...
Q: Answer the following questions 1. Rewrite the following code using one if-else statement If (aCh...
A: We are given a code and we are going to rewrite the code using if-else statement. We use if-else sta...
Q: Computer Science - Describe two information systems/technology concerns that you believe organisatio...
A: Introduction: Data Backup IssuesA backup copy of the data is something every business should do, eac...
Q: Message Formatting in E-Mail A buddy sent an e-mail message with a photo to your work e-mail account...
A: Introduction: The question is about Message Formatting in E-MailA buddy sent an e-mail message with ...
Q: of Thing
A: given - What is the impact of Internet of Things on the world today.
Q: Using SQL Query: 1. Find the d_ids of Dealers who sell some Black Car and some Yellow Car 2. Find ...
A: SQL: SQL (Structured Query Language) is a programming language that is used to conduct operations on...
Q: In which cases you can transform an else-if statements to switch? Provide an example
A: The solution to the given problem is below.
Q: Suppose that Alice and Bob agree to hash an integer by taking the sum of the digits modulo 1212. Als...
A: The Answer for the following question is given in next step.
Q: Describe a cloud storage programme and discuss the benefits and drawbacks of using one over a standa...
A: Introduction Cloud storage: Cloud Storage is a service where data is remotely maintained, managed, ...
Q: (a) Using a true table
A: A b a⇎b ¬(a⇎b) a ⊕ b 0 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 0
Q: Consider this scenario: An exception is thrown when a function is called. What are the three things ...
A: An exception is thrown when a function is called. Things can do by the function is try-catch, throw...
Q: What are the two most compelling reasons for using layered protocols? Provide examples to back up yo...
A: The main reason behind layered protocol: 1.Providing abstraction in between layers: Layering of prot...
Q: 3. Let ,, and . a. Find ANB. b. Find AUB. c. Find A-B. d. Find. e. Find AXC. f. Is CCA? Explain. g. ...
A: Assume A= { a,b,c,d } B= { c,d,e,f } C={ c,d,e,f }
Q: Building and using DNA Motifs Background Sequence motifs are short, recurring (meaning conserved) pa...
A: Apart from the conventional strings which start and end with a single quote in python. There is also...
Q: Give a recursive definition for an (where n=1,2,3,...) if an=2n+5
A: Below is the recursive definition for an=2n+5: a1=7,a2=9........an=2n+5 Now from above we get : lang...
Q: Create a C program that do exactly the same as the sample below
A: #include <stdio.h>#include <string.h>// horizontal linechar dline[] = "=================...
Q: Question 18 "With ISAM, Overflows of data blocks cause insertion into an overflow area Selected Answ...
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions ...
Q: Which of the following is NOT true about emoticons
A: Emoticons are facial expressions that express a person's emotions, such as happiness, sadness, and f...
Q: Define and describe Debugging
A: Introduction Define and describe Debugging
Q: For this question you will be using a doubly linked list containing Strings and Node class which con...
A: I have answer this question in step 2.
Q: A drink costs 2 dollars. A taco costs 3 dollars. Given the number of each, compute total cost and as...
A: start Accept numDrinks ,numTacos from the user totalCost <- numDrinks*2 + numTacos*3 print total ...
Q: statement. What is the final value of the variable "number"? int number = 5; number = 10; number ...
A: Here the value of a number is 5 That is integer type then again it is modified to 10 and again it i...
Q: what are the data structures that one needs to implement a radix sort algorithm? What is the purpose...
A: Radix sort sorts integers on the basis of digits of the number. It sorts the numbers from least sign...
Q: This is a proof by induction over, The property P =
A: This is very simple. The question is based on Propositional Logic proposition, proposition Solutio...
Q: 1. Write a C++ function to find the sum and average of one dimensional integer array. (COLUMN = 4) 2...
A: Ans 1: code: #include <iostream> using namespace std; int main(){ int n; cout<<"E...
Q: So
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful. Tha...
Q: C Language Explain what is the difference between a doubly linked list and singly linked list? Give...
A: The solution to the given problem is below.
Q: Develop ethical guidelines for information technology professionals and professional ethics?
A: Intro Many resources support IT professionals who seek ethical guidance in their work. For example, ...
Q: using Huffman encoding. What is your binary representation of the message? Draw your Huffman trie ...
A: Given message: “algorithms design and analysis is an art" We need to encode using Huffman encoding a...
Q: How can the repeated calls to itself in a recursion function be managed? What kind of control system...
A: A function calling itself is called as Recursion function. In these type of functions, the logic for...
Q: How a conflict theorist would view the American domination of websites and other informational sourc...
A: Conflict theory focuses on the existence of a limited source and creating the competition between th...
Q: What does the word "personal computer" mean exactly?
A: Introduction: You've probably heard of a personal computer before, but the first thing that comes to...
Q: Can polling and DMA be used together? If yes, give an example
A: Polling is the course of action in which the the procedure written or developed in the software whi...
Q: Drawing Things Out Consider an array of integers: 2, 4, 5, 9, 11, 13, 14, 16 Draw out how the array ...
A:
Q: What is ALE? Calculate ALE
A: ALE (annualized loss expectancy). In calculating risk, there are two general formulas that are used...
Q: Q1/ Please answer the following questions. 1- Briefly describe the Computer Characteristics and Capa...
A: AS PER OUR POLICY “Since you have posted a question with multiple sub-parts, we will solve the first...
Q: Naive recursive solution Implement the naive cut rod algorithm using pure recursive strategy. Note t...
A: Algorithm: Start Implement a method named naive_rod_cutting() that takes prices list and length of ...
Q: dvantages of virtual memory? And Describe three advantages of virtual memory and how they have affec...
A: Virtual Memory Virtual memory is a memory management feature of an operating system (OS) that allows...
Q: Write a MATLAB program to solve this equation (using function) X=((V-B) /(2.3A/5S))
A: Given function is X = (V-B)/((2.3*A)/(5*S)) Take the required values to solve the equation.
Q: Which type of image is best for the design of images for a webpage? Why?
A: answer is
Q: Q1) Write a C++ program to compute the value of S using function called Compute_S(x, n), where the v...
A: Below is the code
Q: 3. Explain the output of this program
A: As per the requirement program explanation is given below.
Q: Program to input the elements(integer type) of a array of size 17 and check if all the elements of t...
A: Code: class Main{ public static void main(String args[]){ int a[]={33,3,4,5,5,8,96,23,11,56,78...
Q: Some viruses are hidden in macros, which are instructions saved in software such as a word processi...
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions ...
Q: What do you mean by stages in multimedia? Each one should be explained.
A: Introduction: The production stage of a multimedia project is when all of the pieces come together. ...
Q: Having generated and saved a bitmap and vector-based image, explain why the files of these documents...
A: I have answer this question in step 2.
Q: ber function of a class is handled by the compiler in a unique way.
A: When the program runs the call certificate of the function, the CPU stores the memory address of the...
can you help me to do no.13 in c++?Thanks
Step by step
Solved in 4 steps with 2 images
- 1) Write a thread class TabPrinter that prints the elements of an array of integers (in one line)every 2 seconds 5 times. Use the way of extending the class thread. Write the main methodwhich creates and starts three threads Printer which will print different arrays of integers.After that it prints "Main won’t wait. Main exits".2) Modify the above thread program so that you implement the interface Runnable. Make themain thread waiting till all other threads finish execution.Subject Name: Advanced Object-Oriented Programming 1. Complete the below given code (1) class NyThread Thread t: Runnable ( MyThread (String n, int pl t (2) (3) : / creates teh Thread t with nane n : // changen the priority to p Syster.out.printin ("Thread "+n+* created with priority "+p): t. (4) : // exexcute the thread t. I // The only abatarct aethed in Runnable public for (int 1=10: 1>=1: 1--) { Syaten.out.prántin ("Thread *t.getName ()+"\e i - "a) : (5) try { (6) :/ ma ke the Thead t eleep to 2 seconds } catch (Exception e) Syater.out.printin ("Exception in Child"): System.out.printin ("Thread "+t. getName ()+" 1s Exiting"): public statie void main (Stringt) arga) { MyThread t1, 12; ti - new MyThread ("R1", 7): t2 = new MyThread ("R1", 3): try ( :// 2 atatements to aake the Threads ti a v2 exit at same time (8) ) catoh (Exception e) ( Syster.out.printin("Exception in main"): System.out.printin ("Thread Main is Exiting"): 1. 2. 3. 4. 6. 7. 8. 5.Lab Activities: Exercise 1: 1) Write a thread class TabPrinter that prints the elements of an array of integers (in one line) every 2 seconds 5 times. Use the way of extending the class thread. Write the main method which creates and starts three threads Printer which will print different arrays of integers. After that it prints "Main won't wait. Main exits". 2) Modify the above thread program so that you implement the interface Runnable. Make the main thread waiting till all other threads finish execution.
- Create a program that creates and runs 3 threads A, B, C and displays the string “Thread complete” after it has displayed the threads 50 times. It should display thread 50 times and displayed string "Thread complete". Use C language.using C language Write a program that creates an array of size 10000, then creates two threads.should requests entrance to the critical section that is controlled through semaphores, reads the values written in the array, and writes it to the screen with the following format: "Consumer consumed item number - from position - with the value -" And to a file named Consumer activity, then exits the critical section, and repeats till the producer finishes production2. Write a program that creates two threads. The first thread will ask the user to enter three students' names and ids and put them in two lists namel and idl, the second thread must use namel and idl lists to generate the students' emails and put them in a list called emails, student email has the first three letter of the email with his/her id followed by @std.psut.edu.jo. enter your name: Yasmeen enter your ID: 1111111 enter your name: Ali enter your ID: 2222222 enter your name: Sama enter your ID: 3333333 ['Yas1111111@std.psut.edu.jo', 'Ali2222222@std.psut.edu.jo', 'Sam3333333@std.psut.edu.jo']
- IN C LANGUAGE Please write a program to scan an integer number N entered by the user. Create 4 threads andassign them to find ALL prime numbers between 1 to N. NOTE: YOU MAY ASSUME 1 and 2 ARE PRIMEExercise 1: Write a thread class TabPrinter that prints the elements of an array of integers (in one line) every 2 seconds 5 times. Use the way of extending the class thread. Write the main method which creates and starts three threads Printer which will print different arrays of integers. After that it prints "Main won’t wait. Main exits". Modify the above thread program so that you implement the interface Runnable. Make the main thread waiting till all other threads finish execution. ____________________________________________________________________________________________ Exercise 2: Write a thread class TextThread that prints a text every 1 second 10 times. Read the following main class. Try to guess what will be its output. class Test { public static void main(String s[]) throws Exception { TextThread x = new TextThread ("I am thread x"); TextThread y= new TextThread ("I am thread y"); System.out.println("I am Main thread"); } } Write it and execute it. Is the…The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, .... Formally, it can be expressed as: fib0 = 0 fib1 = 1 fibn = fibn−1 + fibn−2 Write a multithreaded program that generates the Fibonacci series using either the Java, Pthreads, or Win32 thread library. This program should work as follows: The user will enter on the command line the number of Fibonacci numbers that the program is to generate. The program will then create a separate thread that will generate the Fibonacci numbers, placing the sequence in data that is shared by the threads (an array is probably the most convenient data structure).When the thread finishes execution, the parent thread will output the sequence generated by the child thread. Because the parent thread cannot begin outputting the Fibonacci sequence until the child thread finishes, this will require having the parent thread wait for the child thread to finish.
- Computer Science Using Java Write a program that opens up 2 threads of the same class. The threads say "I'm a thread".// please don't copy from chegg in java: Use multithreading and thread synchronization to code an application simulating a bank deposit and withdrawal process. Set up an account containing an initial balance of $1000.00 for both of the two shared threads, Husband and Wife. When a thread makes a deposit in an account, the other thread must wait. If the account balance is $0.00, no withdrawals are permitted. Assume a deposit transaction requires 0.2 seconds to complete and a withdrawal transaction requires 0.5 seconds to complete. Generate random number 1 as deposit and 2 as withdrawal, respectively. Write a driver class MultiThreadAppt o test your application, repeat, and display the operations 50 times. Document all source code as required above.Write a server and client programs that do the following based on the written pseudocode: Client Server Client create a socket that directed to port 3344, local host Server creates a server socket on port 3344 Server is capable to receive requests for more than one client at the same time.(threads) Client sends a linked list object to the server For each client , server creates a file named after containing n elements (size is given from user) generated randomly the threadID Server reads the list object and writes its content into the file created above Clients waits for the written confirmation from server , which is the number of elements found on the list object send above After writing, Server send number of elements written to the file to the client. Server closes sockets and files. Client check if number received is equal to the size of the list Client closes socket