Q2) write a C++ program to generate the following pattern using the functions SpacesOnesLine(S, Ones) and SpacesZerosLine(S, Zeros) to produce each line in the pattern. The functions SpacesOnesL ine(S, Ones), and SpacesZerosLine(S, Zeros) is a 11111 1111 111 value returning function that produce a string consists of S spaces followed by Ones of '1' 11 for the first function or Zeros of 0' for the second function. 1 Ex: str= SpacesOnesLine(3, 2); will produce str=" cout<< SpacesZerosLine(2, 3)< St=" "; Then St-St+'A'; => St=" A"; Then St-St+'A'; => St=" AA"; 11" and 000" 00 000 0000 "e) 00000
Q: Assume you want to keep track of changes to the takes relation. Can the above approach ensure that m...
A: Introduction: The basic principle of an audit trail is the supervision ( or tracking) of the usage a...
Q: Write a Python program to show the binary values of all the entries in the list below in string form...
A: #method to convert decimal to binary #and returns in string formatdef dectobin(d): if d>0: ...
Q: What are the software engineering applications of trustworthy software development?
A: Introduction: To work, many systems rely on software. With the digitalization movement that includes...
Q: 7. For each of these lists of integers, provide a simple formula or rule that generates the terms of...
A: 7. For each of these lists of integers, provide a simple formula or rule that generatesthe terms of ...
Q: Explain what the following MIPS code does: li $v0, 5 syscall
A: MIPS is a machine architecture, included with instruction set MIPS CPU has 32 General Purpose Regi...
Q: In data integrity, mention four main considerations that are put in place to validate collar data
A: four main considerations that are put in place to validate collar data In data integrity are
Q: Rewrite the following code using one if-else statement If (aChar ==’A’) c++; if (aChar !=’A’) pri...
A: syntax of if else if(condition){statement} else {rest statements}
Q: How do you determine what test cases are appropriate for automation?
A: The main capability of computers are the automation, save the time and labour. It can explain the co...
Q: Which of the following can be exploited to direct host to malware-laced servers?
A: An exploited server is one that is no longer fully under your control. Someone else is using it for ...
Q: Explain rounding briefly.
A: Introduction the question is about Explaining rounding briefly and here is the solution in the next ...
Q: A) Create a super (parent) class called Course. The Course class represents any course that does not...
A: NOTE: Programming language is not mentioned, so I am doing in JAVA In this question, there are three...
Q: What are the distinctions between the synoptic and incremental approaches?
A: Introduction: Although there is no explicit handling of power in transactive and incremental plannin...
Q: Explain what it means to synchronise desktops and mobile devices in detail. In your response, includ...
A: Introduction: Explain what it means to synchronize desktops and mobile devices in detail. In your re...
Q: 4. Consider the following languages. • ANFAFIN = {(N) |N is an NFA and L(N) is finite} • EREX = {(R)...
A: Answer:- No,All strings of the form 10n are contained in L(N) (in addition to other strings as well...
Q: PLEASE WRITE IN C++ Implement a program that uses an array based binary tree (sequential tree) that...
A: Answer: This question based on binary search tree and insert the how will work i have shown in the C...
Q: Trailing zeros at the end of a number, but before an implied decimal point, are ambiguous. True F...
A: Trailing zeros at the end of a number but before an implied decimal point are ambiguous and should b...
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 exactly is Internet filtering, and how does it function? Determine which nations are having sev...
A: Introduction: Internet filtering and its effectiveness
Q: What are the different models for software requirements, and their advantages and disadvantages in r...
A: Advantages and disadvantages of different software models Thesoftware model is an abstract represent...
Q: safeguards against wireless credentials being intercepted by Man-in-the-Middle (MITM)
A: Examine several safeguards against wireless credentials being intercepted by Man-in-the-Middle (MI...
Q: What exactly is globbing? What exactly is a wildcard?
A: Introduction: Here we are required to explain the meaning of Globbing and Wildcard.
Q: 3. Define a function to count how many 1's in an integer number. Return this count: int countOnes(in...
A: Based on the given syntax, the required function is in C or C++ programming language. For this funct...
Q: The infix string require to store in linked List using following structure typedef enum TokenType {...
A: Let's see the solution in the next steps
Q: How do you remove a form from a project and erase its associated file from the hard drive?
A: Introduction the question is about How do you remove a form from a project and erase its associated ...
Q: Describe how to make an array of struct elements.
A: Introduction: The question is about to Describe how to make an array of struct elements. and here is...
Q: What is the memory space and computer time overhead associated with the execution of a recursive fun...
A: Introduction the question is about What is the memory space and computer time overhead associated wi...
Q: What are the different types of virtual servers and services?
A: Introduction: the question is about different types of virtual servers and services? and here is the...
Q: Why is it that the single-precision real format does not support an exponent of 127?
A: Introduction: the question is about Why is it that the single-precision real format does not support...
Q: 7. Find the remainder of when divided by a. 2. ь. 5. c. 7. d. 9. 8. Solve the following congruences ...
A: Here is the detailed explanation of the solution.
Q: NVIDIA chip set architectures: complete information please
A: The NVIDIA Turing architecture is a combination of GeForce RTX platform, It fuses together in real-t...
Q: 16 bit memory. T n Cs required is 1ur
A:
Q: ks' topologies.
A: Types of Network TopologiesStar Topology: A wire connects all of the devices in a star topology to a...
Q: generate intger random number ranged (1,100) in matrix(a(1,100)). The find the Index and number in r...
A: Since no programming language is mentioned, I am using matlab Code: a=randi([1,100],1,100)for i=1:le...
Q: e forefront of Artificial Intelligen
A: AI ethics is a set of moral principles and techniques aimed at guiding the development and responsib...
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: Explain the how many type of server.
A: INtro Servers are massive data storage and processing equipment that may be purchased as hardware or...
Q: Question 8 - distinct_words In this problem you will produce a sorted list of the distinct words fou...
A: The below code can be changed according to your method calls and with your wished test input samples...
Q: To 3 7 $ 3 6 %24 2.
A:
Q: Computer Science using this data data <- data.frame(no = seq(1,1000), offers = c(rep(0, 550), r...
A:
Q: What further quandaries do you see emerging when modern technology and/or the epidemic continue to a...
A: Introduction: The Innovators Dilemma is perhaps the most important book on how innovation occurs, an...
Q: 8. Use Prim's algorithm and Kruskal's algorithm to find a minimum spanning tree for the weighted gra...
A:
Q: Describe the procedures involved in the programming analysis phase.
A: Introduction the question is about to Describe the procedures involved in the programming analysis p...
Q: What is the decimal representation of 27?
A: Introduction the question is about the decimal value and here is the solution in the next step.
Q: provide an explanation and definition for microcontrollers
A: A microcontroller is a computer that is contained within a single integrated circuit and is dedicate...
Q: Write code that outputs variable numDays. End with a newline.
A: The java code for the program is given with explanation in the next step.
Q: Create a JavaScript Arrow function that meets the following requirements: Authored using arrow expre...
A: // arrow function of _replaceCharacterconst _replaceCharacter = (string) => { let ans = ""; // in...
Q: When do you believe it is best to keep all data and applications in-house, and when do you believe i...
A: Introduction: Yes, your knowledge is comparatively safe within the cloud—likely far more thus than o...
Q: In the two-phase commit protocol, describe what happens if a subordi- (a) nate receives a PREPARE me...
A: Two Phase Commit it is a atomic commitment protocol. Two Phase Commit is either all commit or all ab...
Q: Write code that outputs variable numBirds as follows. End with a newline. Ex: If the input is: 3 the...
A: The required Java program is in the next step with explanation given in code comments.
Q: Differentiate between combinational logic circuits and sequential logic circuits. HOW DO THE DESIGN ...
A: Introduction: A digital circuit works with a limited number of voltage levels. They're in everything...
Step by step
Solved in 3 steps with 2 images
- C++ format please, thanks Write a function named "FriendsWithPets" that takes a const reference to a std::map of my friends names (std::string) to the number of pets they own (int) and returns the number of friends (int) that have at least one pet. You should be using the STL algorithms to achieve this and no looping (no "while" or "for" keywords anywhere in the solution). #include<map> #include<algorithm> #include<iostream> #include<regex>3. String (a) Write a Python function that accepts a string s and an integer n with a single digit (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9) as its arguments, and returns a new string that replaces every digit n found in s by a new digit that equals to (n + 1) %10. The function returns an empty string if n is not a single digit integer or is negative. COMP132 Assignment #2 replace_string("He330", 3)-> "He440" "He331" replace_string("He330",0)-> replace_string("He330",-4) replace_string("He330", -> 12)-> 11 11 11 11 (b) Write a Python function that accepts a string as the argument, moves the first 3 characters of the string to the end, and prints it out. If the length of the string is less than 3, your function should print an error message. move_string ("Hello") ->loHel move_string ("Hi, My name is Mark.") -> My name is Mark. Hi, move_string ("Hi")->Invalid StringComplete the function below: string makePalindrome(string s){ //returns the palindrome of string s } Complete the function and also test the function for sample string "ABC" , Output should be "ABCCBA" C++
- PYTHON Problem Statement Implement a function which takes two arguments: the first is a string and the second is a single character (as a string). This function should move every instance of the given character in the string to the end of the string, and then return (do NOT print) the final string. NOTE: Only write code within the function. You do not need to utilize the "input()" function. The autograder passes inputs directly to the function as arguments, and the checked output is the returned value from the function. Sample Input "hello how are you?", "o" Sample Output "hell hw are yu?ooo" Starter Code def move_character(word, character):Assignment#1-Part-2write a c# program which takes 2 inputs for alphabet(sigma) and your program will generate different combinations/ concatenation string(10 length). Then you give the string as a input, so your program validates/match this string with your generated-concatenation-string by using Regular-Expression.Military to Regular Time Create a function called MilitaryToRegularTime that converts time in the military time format into the regular format. For example, convert 2249 to 10:49 pm. The function should receive a single int parameter that represents the military time. It should return a std::string that contains the regular time counterpart of the given military time. Please see the sample output below to guide the design of your program. Note: Consider possible edge cases in user input to ensure your program works correctly. Sample output: Please enter the time in military time: 1433 The equivalent regular time is: 2:33 pm Make sure that you examine the MilitaryToRegularTime function prototype in time_converter.h, implement it in time_converter.cc, and call it from inside of main.cc. You'll find that skeleton code has already been provided and you simply need to call the function, which can be called from inside main.cc because we include the header file via: #include…
- Objective: string and character manipulation, string.h and ctype.h libraries For each of the problems, create a user-defined function. Then write a driver program for the functions inside the main. 1- Write a function that takes a word less than 25 characters long and returns the letter that word starts with (in capital letters). 2- Write a function that has a string as formal parameter. The function then replaces all spaces and punctuation marks in the string with the asterisk (*). 3- Write a function that takes as input one line and reverses the words of the line 4- Write a function that takes nouns (a string) as inputs and forms their plurals based on these rules: a. If noun ends in “y”, remove the “y” and add “ies”. b. If noun ends in “s”, “ch”, or “sh”, add “es”. c. In all other cases, just add “s”. Now create the driver program - Ask the user for their first and last name. Store the names in separate arrays. - Greet the user by their full names. - Let them know what their…C++ code please Write a program that uses the function isPalindrome . Test your program on the following strings: madam, abba, 22, 67876, 444244, trymeuemyrt Modify the function isPalindrome so that when determining whether a string is a palindrome, cases are ignored, that is, uppercase and lowercase letters are considered the same. Your program should print a message indicating if a string is a palindrome: madam is a palindrome Use expressions: .+*isPalindrome\(\"Madam\"\).+* .+*isPalindrome\(\"abBa\"\).+* .+*isPalindrome\(\"22\"\).+* .+*isPalindrome\(\"67876\"\).+* .+*isPalindrome\(\"444244\"\).+* .+*isPalindrome\(\"trYmeuemyRT\"\).+* in the code.(Conversion) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and the corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet. b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data. c. Modify the program written in Exercise 6a to request the starting meter value, the ending meter value, and the increment. Instead of the condition checking for a fixed count, the condition checks for the ending meter value. If the number of iterations is greater than 20, have your program substitute a default increment of (ending value - starting value) / 19.
- (Program) Using the at() function, write a C++ program that reads in a string by using getline() and then displays the string in reverse order. (Hint: After the string has been entered and saved, retrieve and display characters, starting from the end of the string.)(Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.Write a program that reads in a line consisting of a students name, Social Security number, user ID, and password. The program outputs the string in which all the digits of the Social Security number and all the characters in the password are replaced by x. (The Social Security number is in the form 000-00-0000, and the user ID and the password do not contain any spaces.) Your program should not use the operator [] to access a string element. Use the appropriate functions described in Table 7-1.