2.1) The program in Figure 2 performs certain task. Compile the program and answer the following questions: a) What is the value of d? b) What is the value of d if num[] is stored with {33,44,55,77,66,55,44,99,22,11}? c) (2 marks) (2 marks) What is the value of d if num[] is stored with the numeral digits of your student number? (for example BK20123456, will be stored as 2,0,1,2,3,4,5,6) d) Based on the values of d, what does the Mystery function do? (2 marks) (2 marks)
Q: explain Bounded-Degree Spanners of the Unit-Disk Graph
A: Bounded-Degree Spanners of the Unit-Disk Graph:
Q: How would you decide between ODBC/JBDC and an ORM framework when creating a new software…
A: Object Relational Mapping (ORM) is a programming approach that is developed in object-oriented…
Q: Design an O(E) time algorithm for recognizing a palm polygon P where E is the number of visible…
A: an O(E) time algorithm for recognizing a palm polygon P where E is the number of visible pairs of…
Q: Why are sophisticated and widespread cybercrimes on the rise?
A: Introduction: Cybercrime rehearses are reliably filling in each industry. Each industry is pondering…
Q: Problem 4 Assume XO holds the value 0010 0100. What is the value of X1 after the following…
A: Here is the explanation.
Q: What are the most significant distinctions between hardware and software? What similarities do these…
A: Hardware and software are essential parts of a computer system. Hardware components are the physical…
Q: 2. Code a JavaScript closure appender that will a) initialize a protected variable to "" and b) on…
A: The algorithm of the code:- Step 1: Define a function name appender Step 2: Create an empty string…
Q: - For the given IP address 128.168.0.1/20, calculate the Subnet mask, Network address, total number…
A: Internet Protocol Address An IP address (Internet Protocol address) is a numerical label assigned…
Q: Which is the correct way to tell the compiler that the class being declared (ChildClass) is derived…
A: Inheritance is the capacity of a class to derive traits and properties from another class. One of…
Q: Do hardware and software serve different functions?
A: Introduction: This topic examines the distinction between two key branches of computer science. I…
Q: What happens if the integrity of your database is not enforced? Where are mistakes most likely to…
A: 1. A database management system (or DBMS). 2. It is essentially just a computer-based data storage…
Q: What is wrong with the following member function definition given the class below? class Rational {…
A: 1) Program in question creates a class Rational with Private member variables numerator and…
Q: Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma…
A: Here is the C code that uses a for loop to print all NUM_VALThe code's output ends with the last…
Q: How can autonomous computing enhance the cloud computing environment?
A: Autonomous computing is the use of artificial intelligence and machine learning to automate the…
Q: Would you be able to provide me an example of a SQL database and explain how it works?
A: Structure query languages is one of the language used to operate on the database which can insert…
Q: 1. Using the grammar in Example 3.2, show a parse tree and a leftmost derivation for the following…
A: Here is the left most derivation and parse tree shown. I have provided handwritten solution.
Q: Explain the following term: i. Intranet ii. Extranet iii. Internet iv. Converging network
A: According to Bartleby Guidelines we need to answer only one question so I have answered first…
Q: (II) Given a grammar: S-aS IT T-bT|U U-13 Give an equivalent PDA transition diagram for CFG above…
A: PDA transition diagrams for CFG: PDA transition diagrams are diagrams used to show the…
Q: What function does study serve in the realm of cybercrime?
A: The complexity of cybercrime, which occurs in the borderless realm of cyberspace, is exacerbated by…
Q: In tennis, a set is finished when one of the players wins 6 games and the other one wins less than…
A: The below code defines a function called is_set_finished that takes two arguments: score1 and…
Q: #include using namespace std; class TestClass { public: TestClass(int x) { cout << x << endl; TO
A: Answer of this question is as follows.
Q: Using the op codes described in the table below. Write a program in assembly to compute the…
A: Assembly language programming is a low-level programming language that is used to write programs for…
Q: Define a class StatePair with two generic types (Type1 and Type2), a constructor, mutators,…
A: Declare a generic class StatePair that takes two generic parameters Type1 and Type2, both of which…
Q: In RSA, given that the primes p and q are approximately the same size, approximately how big is (n)…
A: RSA:- The Rivest-Shamir-Adleman (RSA) encryption algorithm is an asymmetric encryption algorithm…
Q: -.Write a program that converts a hexadecimal digit into a decimal value. (The output your program…
A: In the below program, the hex_to_decimal function takes a single argument, the hex digit to be…
Q: This is used to protect important data. OA) public access specifier O B) protect () member function…
A: In C++, access specifiers are keywords that determine the accessibility of class members (i.e.,…
Q: 11. Show final cache where block size =2, N = 4 Memory 20 21 22 23 24 25 26 27 28 29 30 31 hits =…
A: Below I have provided the solution to the given question
Q: Can you Define in 1500 words, the access control as well as the means and components of security.?
A: Solution: Access control: Access control, a security method, limits who or what can access…
Q: Let G be an undirected, connected graph with vertex set V(G) = {V₁, V2, ..., Vn} and edge set E(G) =…
A: In computer science, a graph is a data structure that is used to represent relationships between…
Q: Add an onclick event handler that calls the content() function to the button element in the main…
A: Please find the answer below :
Q: Some people find cybercrime intriguing, while others find it revolting
A: Introduction Cybercrime is becoming more prevalent across all industries. Because these thefts take…
Q: Is there a cause for the rise in frequency and complexity of cybercrime?
A: The answer to the question is given below:
Q: Using systems thinking concepts, explain the key operations TGL works. Pay a particular attention to…
A: Systems thinking is a holistic approach to analysis that focuses on the way individual parts of a…
Q: Why is the web the arena of so much competition today?
A: Answer is
Q: Create a directory of databases that hold your information. I was wondering how the information in…
A: Introduction Then we need to identify the databases that contain information about you and can get a…
Q: The LinkedBinarySearchTree class is currently using the find and contains methods inherited from the…
A: Below is the complete solution with explanation in detail for the given question about method…
Q: Identify reasons that caused inflation in Argentina during 2022? Is there any evidence of inflation…
A: Single-digit inflation rates were rare in Argentina in the twentieth and twenty-first centuries, and…
Q: Write a computer code that calculates the element value up to the 4-digit largest element of the…
A: Step 1: Initialize n = 0 Step 2: Calculate Fn = 1/sqrt(5) * (pow((1+sqrt(5))/2,n) -…
Q: Any discussion of the Domain Name System (DNS) must contain iterated and non-iterated requests, root…
A: Answer:
Q: Here, you'll learn the ropes of working with a real-deal SQL database.
A: Introduction: When learning SQL, one of the most effective strategies is to concentrate not on…
Q: B. Write the following knowledgebase, then answer the following: Type of building Number of rooms…
A: Given table contains three columns that are Type of building, Number of rooms, Price of room and The…
Q: NTFS supports various permissions that enable each user to share entire drives or individual folders…
A: The default file system for Windows NT and all subsequent versions of the Windows operating system…
Q: Problem Statement: In tennis, a set is finished when one of the players wins 6 games and the other…
A: According to the information given:- We have to follow the instruction in order to get desired…
Q: This article provides a comprehensive overview of the Domain Name System (DNS), including such…
A: Introduction: This thorough description of the DNS describes in detail iterated and non-iterated…
Q: I keep getting this error message TextMsgAbbreviation.java:3: error: class LabProgram is public,…
A: Below I have provided the solution to the given question.
Q: What are the most significant distinctions between hardware and software? What similarities do these…
A: Definitions of hardware vs. software Hardware: By use of hardware, people may interface with a…
Q: In an overloaded insertion or extraction operator, which object should be the first parameter, the…
A: In an overloaded insertion or extraction operator function defined in a class, the first parameter…
Q: When would it make sense to have a large computer system comprised of several smaller systems, each…
A: Circumstances: When several processes share the same collection of resources, it makes sense to…
Q: Exists a computer hardware component that must be included in every personal computer?
A: Computer hardware: It is the physical components that a computer system must requires to function.…
Q: (a) Write commands to create an R data frame out of the data in the following table. Manager Sales…
A: Algorithm: START Create a vector for Manager, Sales, and Gender. Create a data frame using the…
Step by step
Solved in 2 steps
- Task related to pointers : Write a c++ program that asks the user to enter integers as inputs to be stored in the variables 'a' and 'b' respectively. There are also two integer pointers named ptrA and ptrB. Assign the values of 'a' and 'b' to ptrA and ptrB respectively, and display them. ( Drop code in words , explain the code and drop the screenshot of output as well )C Programming Write function updateHorizontal to flip the discs of the opposing player, it should do the following a. Return type void b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. Structure Player (i.e. player) as a pointer c. If the square to the left or right is a space, stop checking d. If the square to the left or right is the same character as the player’s character, stop checking e. If the square to the left or right is not the same character as the player’s character, flip the disc (i.e. X becomes O, O becomes X) Write function updateVertical to flip the discs of the opposing player, it should do the following a. Return type void b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. Structure Player (i.e. player) as a pointer c. If the square above or below is a space, stop checking d. If the square above or below is the same character as the player’s character, stop checking e. If the square above or below is not the same character as…1) A C++ program to add two numbers using pointers. 2) A C++ program to swap two numbers using pointers. 3) A C++ program that creates a two-dimensional integer array (4x3) initialized with user given data. The program should have the following functions: • Print the sum of all values in the array. • Print the average of all the values in the array. • Take row number from user and print the sum of the values in that specified row.(use loop and no if statement) • Take column number from user and print the sum of the values in that specified column.(use loop and no if statement)
- C language for solution Note: soution this program Use Array 1. Write a program to do the following: a. Write a Cover Page function to print the HW details passing the needed parameters and has no return. b. Write a function that gets student grades and ID (maximum number of students is 20) then the function has a switch statement to enable the user to choose one of the following operation: i. Call MaxMin function to find and print the maximum and minimum grades as well as their ID ii. Call function Average to return the average grade of the class. iii. Call mark function to print students ID, their grades, and marks (as in the below table) iv. Call Sort function to sort the student ascending or descending based on their grades. The program will repeat the operation tile the user wish to terminate the program. Note: Student's grades are between 0 and 100 (use data validation technique). • You will get zero if you don't use comments and print HW details (your name, course name, course…c++ program write a recursive function to find the factorial of a number. main points : 1) n and r are stored in two parallel arrays. 2) you have to read the arrays n and r at run time. 3) compute nCr for each corresponding terms in the array n and r and display it properly formatted 4) also in the program you should print the current date and time using the library functionsattempt the following questions.1. Write a C++ program to find the sum and product of all elements of an array of size 10. Take input from the user.2. Write a program in C++ to find the transpose of a 3x3 matrix input by the user, store it in another array and display it.instructions:1. avoid copy-pasting and plagiarism.2. write a self-written code.3. give "comments" with each line in the code.
- Month Day Calculator in C Using basic concepts of Pointers and Structures (Pointers and Multi-dimensional arrays), create a C program that calculates the month's day from a given year and year's day. Use pointers for the month and month's day variables. Don't forget to add proper errors handling in your program. - Follow the instructions below for handling error. - Invalid Input- Invalid year- Invalid year day Modify the provided monthAndDay.c class file to receive the parameters in the way and also print the proper formatted output. Example: # ./month_day <year> <yearday> # Example for Feb 2nd, 2019:\$ ./month-day 2019 33Feb 02, 2019 class- monthAndDay.c - #include <stdio.h> /* monthAndDay function's prototype*/void monthAndDay(int year, int yearday, int *pmonth, int *pday); int main() {return 0;}Do the following in the most efficient way possible in C Language: 1. Take an Array of 10 integer values (automatically should be converted to ascending order). 2. Insert Values - Value should be inserted automatically as per the ascending order. If array is {1,7,28,45,67,81} and the user inserts 31; the program should automatically insert at the 3rd index and array size should increase by 1. 3. Delete Values by Range - the user will be asked to two indexes (<sizeofArray) and all values in between those indexed should be deleted. E.g. If array is {1, 7, 28, 45, 67,81} and user enters the indexes 2,4. Then the values 28, 45, 67 should be deleted.USE C++ The Malaysian Ministry of Health published data on the number of deaths by disease type. There are two types of diseases: dengue and malaria. Write a complete C++ program to accomplish the following tasks: Task 1: Declare parallel arrays in the main function to store the following types of information: a) The year. b) The mumber of deaths caused by each disease type (dengue and malaria). Task 2: Write a function named "readInput". a) This is a non-retuming function. b) It receives parallel arrays defined in Task 1. c) The function should assign the required values to each element of the parallel arrays by reading the data from the text file named "input.txt". The file includes the year as well as the mumber of deaths caused by dengue and malaria. Figure lis the content of the "input. txt" file. Please ensure that the program only contimues reading the file if it is successfully opened; otherwise, print the error message and exit the program. Figure 1: 2007 82 18 2008 112 30…
- Do the following in the most efficient way possible in C Language: 1. Take an Array of 10 integer values (automatically should be converted to ascending order). 2. Insert Values - Value should be inserted automatically as per the ascending order. If array is {1,7,28,45,67,81} and the user inserts 31; the program should automatically insert at the 3rd index and array size should increase by 1. 3. Delete Values by Range - the user will be asked to two indexes (<sizeofArray) and all values in between those indexed should be deleted. E.g. If array is {1, 7, 28, 45, 67,81} and user enters the indexes 2,4. Then the values 28, 45, 67 should be deleted. Note: If at any time, the array becomes unsorted, then; some values need to be deleted at runtime to make the array sorted again. At any given time, the array shouldn't be unsorted. Please do not use Pointers and only use Array as a Data Structure.program Credit Card Validator - Takes in a credit card number from a common credit card vendor (Visa, MasterCard, American Express, Discover) and validates it to make sure that it is a valid number (look into how credit cards use a checksum) - it's a C++ program so use #include <iostream> - And please use an array, use files, and use pointers in this program. -Pointer Activity You do not need getopt for this program as there are no arguments. Call the executable pointers. Create variables for a character, a string, an integer, and a floating point number. Create pointers for each of those variables. Ideally, use the same name as the variable but add a p in front of the name. (For example: (total and ptotal) Ask the user to enter information for each of these variables one at a time. For each variable tell them what they should enter. (For example: “Enter a single character” or “Enter a floating point number”) Read in the information and put it in the variables. Make each pointer point to the respective variable. Print out values for the four variables without using the variables themselves. Only use the pointers. In addition print out the addresses of the memory locations that each pointer points to. You can use %p for that. Output should look like the bottom sample. Copy and paste the code and the output into a Word document and submit.…