Read integers from input and store each integer into a vector until 0 is read. Do not store 0 into the vector. Then, output all values in the vector in reverse order, each on a new line. Ex: If the input is -99 100 100-53 0, the output is: -53 100 100 -99
Q: Let's say that an employee's regular pay is rate times hours. If they work more than 40 hours, they…
A: Given, If they work more than 40 hours, they get time and a half. In that case, we subtract 40 from…
Q: Skype offers a service that allows you to make a phone call from a PC to an ordinary phone. This…
A:
Q: Java (Generic Method) - What Order?
A: Coded using Java.
Q: Step3: Create a bash script to print the following output (which will actually create the text 2…
A: Check the code below.
Q: Suppose there is exactly one packet switch between a sending host and a receiving host. The…
A: The question has been answered in step2
Q: You are at home where you have a Wifi network configured to use a Class C private address assigned…
A: A device that communicates between the internet and the devices that are connected to the internet…
Q: Suppose end system A wants to send a large file to end system B. At a very high level, describe how…
A:
Q: QUESTION 3 Write one ARM instruction to do the following operation? LDRH R6, [RO] ADD RO, RO, #10
A:
Q: When the MPU starts up for the first time it goes to the Reset vector Interrupt vector General…
A: In this problem we need to identify When the MPU starts up for the first time it goes to the and…
Q: Show how Ruby can be bootstrapped in two steps on Sun, using two subsets of Ruby called R1 and R2.…
A: The question is to show how Ruby can be bootstrapped in two steps on Sun, using two subsets of Ruby…
Q: QUESTION 8 In Java, objects are explicitly deallocated from the stack. True False
A: In Java. deallocation is done by garbage collector. Garbage Collector is based on object…
Q: Suppose there is exactly one packet switch between a sending host and a receiving host. The…
A:
Q: Create a Java program that will display the student's information. The program should perform the…
A: Implementation: import java.util.*;public class Main{ public static void main(String[] args) {…
Q: Identify the name of the processing that executes several instructions of a single program…
A: C Parallel processing Explanation: Parallel processing is characterized by the simultaneous…
Q: The following needs to be in python For this application, you will need to create a Python…
A: Code: #!/usr/local/bin/python3 def main(): # initalizing filename and valid months filename =…
Q: In C++ Write a program with a function that implements the Addition Algorithm with base 10 addition…
A: Algorithm: The resultant algorithm for given problem is: Main function: Start Initialise the…
Q: Part 3: Factorial function In computer science, and other fields, we frequently need to know how…
A: 1) Factorial Function : Code : function factorial(num){ // Step 1 : set -1 for invalid input…
Q: What is the difference between an external iterator and an internal iterator? Describe an advantage…
A:
Q: You have been asked to write an application that automatically grades a quiz. The quiz has 15…
A: Here is complete program in python of QUIZ GRADING APP ;
Q: How can you aid in preventing internal and external threats?
A: External assaults are generally pernicious, with disturbing help, vandalism, and burglary as the…
Q: Buffers are used to minimise access latency between various levels of the memory hierarchy. List the…
A: A section of memory within a programme dedicated to storing the data being processed. Buffers are…
Q: Discuss the below in detail: 6. to maintain and improve our technical competence and to undertake…
A: As per the guidelines of bartleby we have answered first three questions. you can find the solutions…
Q: R12. Consider an e-commerce site that wants to keep a purchase record for each of its customers.…
A: When a user visits the e-commerce site for the first time, the website will return a cookie number,…
Q: Which command is used to install software from a repository on Enterprise Linux/Centos? Group of…
A: The command used to install software from a repository on Enterprise Linux/CentOS is yum. YUM…
Q: 1. In each row, four items are given: function to which runtime is proportional, original input…
A: 1. logn : New input = n2, so new runtime will be twice for 2*old time (as logn( n2 ) = 2 log(n)) =…
Q: Identify the line coding schemes based on the requirements and convert this data: 1011110010100…
A: I have mentioned hand writened image answer in below, please find in below
Q: Protocols are fundamental to data transmission. Compare and contrast Transmission Control Protocol…
A: Protocols are a fundamental part of digital communication as they direct how to organize, transmit…
Q: Buffers are used to minimise access latency between various levels of the memory hierarchy. List the…
A: Introduction: A designated memory section within a program for storing the data being processed.…
Q: Statistics are often calculated with varying amounts of input data. Write a program that takes any…
A: Coded using Java.
Q: Total = a + b + c; Average = Total / 6; A. B. C. D. Logic Errors Run-time Errors None of the above…
A: A programming language must follow rules and regulations to execute task successfully. Logical…
Q: What would be printed out by System.out.println(m.toString())
A: Given Member m=new BoardMember(); If the reference variable of Parent class refers to the object of…
Q: In a short paragraph, explain what the "method" attribute of a form is, and why it is needed within…
A: Method attribute: Method attribute will specifies how to send form-data. The form-data can be sent…
Q: Skype offers a service that allows you to make a phone call from a PC to an ordinary phone. This…
A: Skype: Skype is a video conferencing and voice calling application programming thing that empowers…
Q: Create a Java program that will display the student's information. The program should perform the…
A: logic:- read users first name, mid name and last name. Read choice O or N.…
Q: Assuming a file consists of fixed-length logical records, whose type is defined as t_record. The…
A: For Read t_record*read(int n) { Int i; t_record*p; reset(); for (i=0, I< (n-1);i++){ p =…
Q: Find the angular velocity from velocity and radius in python
A: Required:- Find the angular velocity from velocity and radius in python Approach:- Take the…
Q: Suppose end system A wants to send a large file to end system B. At a very high level, describe how…
A: Answer:-
Q: , describe the is-a and has-a relationship
A: Summary In Java, we can exercise our law using the Is- A relationship or using the Has- A…
Q: Write one ARM instruction to do the following operation? LDRH R6, [RO] ADD RO, RO, #10
A: Given ARM instructions LDRH R6, [R0] ADD R0, R0, #10
Q: n advantages of Computer
A: Computer network: A computer network is a set of computers sharing assets situated on or given by…
Q: Disk Parameters: Transfer size is 8K bytes, Advertised average seek is 6 ms, Disk spins at 3600 RPM,…
A: the answer is:-
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: Write a program that reads the student information from a tab separated values (tsv) file. The…
Q: What is the difference between a host and an end system? List several different types of end…
A: Host system: A device that connects to other devices on a network is referred to as a host. End…
Q: Find the angular velocity from velocity and radius in python
A: Required:- Find the angular velocity from velocity and radius in pyth Approach Take the…
Q: The exercise of specialist knowledge and competencies is called a. data mining b. informatics c.…
A: The above question is solved in step 2 :-
Q: IN JAVA SCRIPT Given an input string, reverse the string word by word, the first word will be the…
A: Algorithm - Create a method calculateScores with one string as argument. Now use the below logic…
Q: Write a new static method of the IntBTNode class to meet the following specification. public…
A: BELOW A NEW STATIC METHOD OF THE intbtnode CLASS
Q: assuming any input queue scheduling order you want (i.e., it need not have HOL blocking)? What is…
A:
Q: M/M/1 Queuing Model Write a function that prompts the user for the arrival rate (λ) and service…
A: In this python program represents the Queuing Model.
Q: How can I print the address and value of an variable in python.
A: Required:- How can I print the address and value of a variable in python? Approach:- Take the value…
Step by step
Solved in 4 steps with 2 images
- Integers are read from input and stored into a vector until 0 is read. If the vector's last element is odd, output the odd elements in the vector. Otherwise, output the even elements in the vector. End each number with a newline. Ex: If the input is -9 12 -6 1 0, the vector's last element is 1. Thus, the output is: -9 1 Note: (x % 2 != 0) returns true if x is odd. int value; int i; bool isodd; 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 } cin >> value; while (value != 0) { } for (i = 0; i > value; Check return 0; 1 Next level 2 X 1: Compare output 3 4 For input -9 12 -6 1 0, the vector elements are -9, 12, -6, and 1. The last element, 1, is odd. The odd elements in the vector, -9 and 1, are output, each on a new line. Not all tests passed. 2 V 3Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector. Then, output the values in the vector that are less than the last value in the vector, each on a new line. Ex: If the input is 26 -98 -39 -14 -1, the output is: -98 -39Integers are read from input and stored into a vector until 0 is read. If the vector's last element is odd, output the odd elements in the vector. Otherwise, output the even elements in the vector. End each number with a newline. Ex: If the input is -9 12 -6 1 0, the vector's last element is 1. Thus, the output is: -9 1 Note: (x % 2!= 0) returns true if x is odd. 4 5 int main() { 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20} vector vect1; int value; int i; bool isodd; cin >> value; while (value != 0) { vect1.push_back(value); cin >> value; } V* Your code goes here */ return 0; 2 3
- Integer numInputs is read from input. Given the integer vector hourlyScores with the size of numInputs, write a for loop to output the integers in the second half of hourlyScores in reverse order. Separate the integers with a vertical bar surrounded by spaces ("I Ex: If the input is 8 86 88 97 116 132 146 148 163 then the output is: 163 | 148 | 146 | 132 Note: The vector size is always even. int i; int numInputs; 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} cin >> numInputs; // Creates a vector of size numInputs and initialize all values to 0 hourlyScores.resize(numInputs); for (i = 0; i > hourlyScores.at(i); } * Your code goes here */ cout << endl; return 0;Write the following function #input: a numerical vector x #output:the normalized vector, i.e. the vector rescaled into [0,1] # the formula to normalize is (x-min(x))/ (max(x)-min(x)) # you can NOT use the functions min and max # you can use %%, nrow, ncol, and length # you can write multiple functionsVector Arithmetics M A function named arithGym requires an input variable h, and returns three outputs: (1) column vector u, column vector z. and scalar variable count. The input variable h is a column vector of random numbers with values between 100 and 100. The length of h is also randomly chosen between 30 and 60 elements. Perform the following operations. 1. Calculate u with the same length as h that has evenly spaced values ranging from the minimum value in h to the maximum value in h. 2. Each element of column vector z is equal to the square of the corresponding element in h divided by 2 times the corresponding element in u 3. Compute the scalar variable count that counts the number of instances an element in z has a value less than the value of the corresponding element in h. Make sure to assign the results to the output variables as indicated Solve this problem using only vectorized code with no loops or if statements. Note the variable h is defined as a function input. Do not…
- Define an integer vector and ask the user to give you values for the vector. because you used a vector, so you don't need to know the size. user should be able to enter a number until he wants(you can use while loop for termination. for example if the user enters any negative number, but until he enters a positive number, your program should read and push it inside of the vector). then6 4 3 7 3 4 9 6 A. Let A = 1. Using the column operator (:), create a column vector that contains all the columns of A.Integer numin is read from input. Given the integer vector yearlySalary with the size of numin, write a for loop to initialize the first half of yearlySalary with the remaining integers read from input. Ex: If the input is 6 116 132 134 then the output is: 116 132 134 0 0 0 Note: The vector size is always even. 5 int main() { 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21} vector yearlySalary; unsigned int i; int numIn; cin >> numIn; // Creates a vector of size numIn and initialize all values to 0 yearlySalary.resize(numIn); /* Your code goes here */ for (i = 0; i < yearlySalary.size(); ++i) { cout << yearlySalary.at (i) << " "; } return 0;
- (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int vector and the ratings in another int vector. Output these vectors (i.e., output the roster). Ex: Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Player 1 -- Jersey number: 84, Rating: 7 Player 2 -- Jersey number: 23, Rating: 4 ... (2) Implement a menu of options for a user to modify the roster. Each option is represented by a single character. Following the initial 5 players' input and roster output, the program outputs the menu. The program should also output the menu again after a user chooses an option. The program ends when the user chooses the option to Quit. For…Q1 Write a MATAB function will return the distance between two vectors of arbitrary dimensions. Inside the function you must check if the dimensions of the vector are the same.In C++ please: Read integers from input and store each integer into a vector until 0 is read. Do not store 0 into the vector. Then, output all values in the vector (including the last value) each multiplied by the last value in the vector. Output each value on a new line. Ex: If the input is -63 79 -48 7 0, the output is: -441 553 -336 49 #include <iostream>#include <vector>using namespace std; int main() { //place code herereturn 0;}