Create a program which prints the second greatest element of an array! Modify the previous program by adding another array which determines the weights of the first array's elements. Compute the sum this way For example if the first arrav is [1. 2 3. 4 51 and the second one
Q: (a) The following message was encoded using an affine cryptosystem that encodes A as M and B as B. C...
A:
Q: Computer science In a few sentences, describe machine learning and deep learning.
A: The science of teaching computers to learn without being explicitly taught is known as machine learn...
Q: Is there anyway where you don't have to use return to break the loop?
A: return statement not only breaks out of the loop but also the entire function definition and shifts ...
Q: Write a program that declares a variable that represents the minutes worked on a and assign a value....
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc=ne...
Q: Minicomputer, mainframe and supercomputer are the three different kinds of computers available in th...
A: MINICOMPUTER: A minicomputer is a computer that is smaller, cheaper, and less powerful than a mainf...
Q: In Insertion Sort Ascending Order Show the step by step process on how sorting was done such as ...
A: Insertion sort has the time complexity of O(n2).
Q: 1a.) Explain why an operating system is regarded as a resource manager; and give two examples of Ope...
A: The operating system acts as a manager of the above resources and allocates them to specific program...
Q: Computer science What distinguishes Sqoop from the competition?
A: Introduction: Sqoop is a command-line application that facilitates data transfer between relational ...
Q: Alice and Bob want to play the following game by alternating turns: They have access to a row of n c...
A:
Q: You have many filesystems on your hard drive, each of which is mounted to a different directory in t...
A: Introduction: You have many filesystems on your hard drive, each of which is mounted to a different ...
Q: use the laws of Boolean algebra to obtain a simpler equivalent expression, and draw the correspondin...
A: Final Output = (x' + y) . x . y = x' . x . y + y . x . y [By distributive property] = x . x' . y + ...
Q: In JAVA I need a program that has 5 attributes for one object.
A: A java class can have attributes. The attributes can be defined as the data types of data that is pl...
Q: Justify the use of object-oriented analysis in the development of an information system.
A: To be determine: Justify the usage of object-oriented analysis to define an information system.
Q: humans rationally Thought Systems that act rationally Systems that act like humans Behavior Human Ra...
A: Lets see the solution.
Q: The default access modifier for the classes data and methods is: Select one: O a. Private O b. Inter...
A: By default the access modifier for the classes and methods is Private.
Q: What is the distinction between an EISP and an ISSP?
A: The Answer is
Q: Ex: What is the MIPS code to test if contents of register $18 is less than the constant 10 Siti $8, ...
A: Slti syntax: slti $t, $s, const Meaning: If $s is less than constant, $t is set to one. It gets zero...
Q: code an easy hash function in python to create a message digest for X, then make an RSA algorithm t...
A: Data encryption is a crucial practice wont to protect data transfer on the web . This helps prevent ...
Q: (c) Let 7 be a finite tree on 2 or more vertices. Show that the average degree of the vertices in Ti...
A: The answer is
Q: Consider a network with prefix 182.168.56.128/26. Give an example of one IP address (of form xxx.xxx...
A: Part- 1) Data :- IP address :- 182.168.56.128/26 Presently as may be obvious here that the given IP...
Q: How can you ensure that the pathname of the current working directory is always displayed as part of...
A: Given: How can you ensure that the pathname of the current working directory is always displayed as ...
Q: Explain how to give a text box keyboard access.
A: Introduction: To offer keyboard access to a text box, we must first do the following steps:
Q: Use the laws of Boolean algebra to simplify the following Boolean expressions : (a) yx[x+(xxy)] ух (...
A: Part(a) Following is the calculation of the implications of the boolean expression: Given the expr...
Q: What are the benefits of utilizing cloud computing services? What are the dangers and concerns relat...
A: Introduction : Here's everything you need to know: There are various benefits to storing data over t...
Q: What is the global impact of VR, AR and MR
A: -VR ,MR and AR have the potential to boost GDP globally up to $1.5 trillion by 2030. -it is the majo...
Q: As a result of technological improvements, the vast majority of today's appliances are wirelessly en...
A: Introduction: Wireless data transfers are used to connect network nodes in Wi-Fi networks. Wireless ...
Q: I need a java code for IDE jGrasp software. Design a java application and two embedded static metho...
A: Algorithm: Start Implement a static method named findMax() that takes 2 integer values a, b as argu...
Q: Simplify the following Boolean expressions to a minimum number of literals: (a + b+ c')(a'b' + c) (a...
A:
Q: Modify the following program so it can add two numbers between the values 0 and 9. The current progr...
A: Below Im modifying the code
Q: In the below code segment, the salary item that is with the red font color represents
A: A code segment is also known as a text segment.
Q: Add a main function, three paramters, arguments and variables, to the code: def display_vedefhicle...
A: Given: Add a main function, three paramters, arguments and variables, to the code: def display_vede...
Q: - Encrypt the plaintext message GOLD MEDAL using the RSA algorithm with key (2561,3).
A: The Answer is given below step.
Q: What exactly is the Loop Exit Condition?
A: Introduction: What exactly is the Loop Exit Condition?
Q: Given a BSC with p = 0.8 and P = 0.7 Compute the output probability distribution: q, and pte qo = Pr...
A: A probability distribution depicts the expected outcomes of possible values for a given data gener...
Q: What is the difference between composition and inheritence in cpp
A: Use of inheritance: The advantages of inheritance is code reusability. When the child class inherit...
Q: When a stalemate is identified, the required resources are made available to those who are unable to...
A: Introduction: We must now recover the deadlock after it has been found. There are generally two ways...
Q: 1. ( For the Cities database, discuss one problem with either the correctness of the data or what ca...
A: Introduction 1. ( For the Cities database, discuss one problem with either thecorrectness of the dat...
Q: a) Give an example of a string in the language of (0*10+)*. b) Give an example of a string that is n...
A: Below is the answer to above query. I hope this will meet your requirement...
Q: Describe the contents of a source file, an object file, and an executable file.
A: Introduction: The primary distinction between an object file and an executable file is that an objec...
Q: Write the code to copy values in one array to another. In the following code snippet, we copy values...
A: To allocate space, new operator is used followed by type of variable. To de-allocate memory, delete ...
Q: when a software application invokes a virtual function using base class pointers or references in or...
A: Introduction: A virtual function or method is an inheritable and overridable function or method that...
Q: Consider the following graph: Starting at vertex 1, what is the sequence of vertices visited in a de...
A: Correct option is : 1,2,4,3,5,6
Q: Create a flowchart of the following problem: The manager of a football stadium wants you to ...
A: Start Initialise variables "PremiumCost" as 250, "BoxCost" as 100, "SidelineCost" as 50 and "General...
Q: Write a program to implement Singly Linked List in C++ using Class Template: 1. Create a C++ functio...
A: ALGORITHM: Step 1:Create a class node. Initialize the variable data Step 2: The head of a list and a...
Q: Write a program that will: a. Create an array of bytes containing the values: 12h, 34h, 56h, 78h,...
A: The array is the collection of elements which are having same data type. The values of bytes are a...
Q: all truth assignments. If it is satisfiable
A: Lets see the solution.
Q: Complete the thick.h, thick.cpp, thin.h, and thin.cpp classes in the attached pizza solution. Modify...
A: C++ is a compiled language that follows the concept of oops to make projects. It is used to build se...
Q: What happens if the ios::out function is called by itself to open a file that does not exist?
A: Apple's IOS mobile operating system runs on devices made by the company, The iPhone, iPad, iPod Touc...
Q: Problem 4. For the RSA cryptosystem pick two prims p 29 and q 53 so N = pq = 1537. (1) Calculate o(N...
A: In RSA cryptosystem, given p=29 and q=53, we have Euler totient function φ(N) = (p-1)(q-1)=(29-1)(53...
Q: In any organization, provide a concise definition of information system activities as well as actual...
A: Introduction: Information system: Several components make up an information system, a set of linked ...
in C.
Step by step
Solved in 4 steps with 3 images
- 1. Write a program that fills an array with 10 random integer values between O and 100, your program should then calculate and print the alternating sum of all elements in the array. for example, if the array values are (89, 35, 44, 61, 66, 52, 45, 16, 48, 73) then the sum will = 89- 35 + 44 - 61 + 66- 52 + 45 - 16 + 48 - 73 = 55. Sample Run: The generated numbers are: 2 11 44 38 66 72 38 67 43 13 The alternating sum is -8 2. Write a program that reads 10 characters from user and store them in an array. Then display one or more of the following messages: 1. All characters are letters 2. All letters in the list are upper 3. There is no vowel letter in the list 4. There is at least 2 digits in the list 5. There is at least 3 symbols in the list Sample run 1: Enter 10 characters: AB1OK8 M& ? All letters in the list are upper There is at least 2 digits in the list There is at least 3 symbols in the listThe Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns…The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Processing Requirements - c++ Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number //…
- Write a program which does the following (name=xxx_and_xxx_lab2):1) Create a 2 dim array containing the information using an initializer list.2) If you have additional information which needs to be printed related to the data, youcan use other variables to store the information. For example, consider the tablebelow: A two dim table with 10 rows and 2 columns can be used to represent the percent ofwomen and percent of men for each major.The name of the majors can be stored in a one dimensional array of Strings.There are other better ways to represent the information but for now this will donicely.3) The program should print a line explaining what the data in the array represents.4) Print the information in table format.5) In a comment, cite the source of the informationQ3. Given an array of integers of an arbitrary number of elements, write a program that creates an array with the elements "rotated left" according to an integer denoting the shift. so [1, 2, 3] with shift 1 yields [2, 3, 1] and [1, 2, 3] with shift 2 yields [3, 1, 2].4. Write a program to find kth smallest element in unsorted array?You are given an unsorted array of numbers and k, you need to find the kth smallest number in the array. Forexample if given array is {1, 2, 3, 9, 4} and k=2 then you need to find the 2nd smallest number in the array,which is 2.
- LA You are given a 1D array of integers. Write a program to find the biggest of all the numbers at the Fibonacci sequence locations. Example: If the array is of size 10 and if the elements are (1, 4, 45, 2, 92, 108, 116, 7, 6, 9}. Then output is 45 108. 1_B You are given a ID array of integers. Write a program to find the biggest of all the numbers at the prime number locations. Example: If the array is of size 10 and if the elements are (1, 4, 45, 2, 92, 108, 116, 7, 6, 9}. Then output is 108. (M 2_A A space research organization want to transfer a data securely from one planet to another. But company is concerned about the security of the data. All of their data are transmitted as four-digit integers. They have asked you to write a program that encrypts their data so that it can be transmitted more securely. Your program should read a four- digit integer and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10. Then, swap the first digit with the…Write a program which takes 2 arrays of 10 integers each, a and b. ¢ is an array with 10 integers. The program should do the following: 1. Sort the array a using bubble sort. 2. Sort the array b using bubble sort. 3. put into an array c the first five elements from an array a after sorting ,then put into an array c the last five elements from an array b after sorting. Example : a={572,6,1,4,8,3,9,10} aafter sorting= {1, 2,3, 4,5,6,7,8,9, 10} b ={15,18, 12, 16, 19, 13, 11, 14, 17, 20} b after sorting = {11, 12, 13, 14, 15, 16, 17, 18, 19, 20} c={1,2,3,4,5,16,17, 18, 19, 20}Write a program to simulate a pick-5 lottery game. Your pro-gram should generate and store 5 distinct numbers between 1 and 9 (inclu-sive) into an array. The program prompts the user to enter five distinct between 1 and 9 and stores the number into another array. The program then compares and determines whether the two arrays are identical. If the two arrays are identical, then the user wins the game; otherwise the pro-gram outputs the number of matching digits and their position in the array.Your program must contain a function that randomly generates the pick-5 lottery numbers. Also, in your program, include the function sequential search to determine if a lottery number generated has already been generated.
- Write a program in C to find the Median of an array. The array consists of n numbers entered by the user. For finding the median, we need to arrange the array either in ascending order or descending order. If the array size, n is odd, Median = (n+1)/2. If the array size is even, Median = ((n/2)th term + ((n/2) + 1)th term)/2 Display the median calculation used. The example of the program is shown in Figure 1 below. ..Write a program that: 1. Prompts the user to enter an integer representing the size of an array of integers 2. Fills the array with integers from the user input 3. Creates an array of integers to hold the differences between two consecutive elements, fills it accordingly and displays it Example: In the below sample run, the array is of size 7 and is filled using values entered by the user with the below integers. The array of differences contains -10 which is (22 – 32), 2 which is (32 – 30), -18 which is (30 – 48) and so forth. Sample run: Enter the size of the array: 7 Enter 7 integers: 22 32 30 48 54 26 21 Differences: -10 -18 -6 28 2.Write a program which takes 2 arrays of 10 integers each, a and b. c is an array with 10 integers. The program should do the following: 1. Sort the array a using bubble sort. 2. Sort the array b using bubble sort. 3. put into an array c the first five elements from an array a after sorting ,then put into an array c the last five elements from an array b after sorting. Example : a={572,6,1,4,8,3,9,10} aaftersorting={1,2,3,4,5,6,7,8,9,10} b = {15, 18, 12, 16, 19, 13, 11, 14, 17, 20} b after sorting = {11, 12, 13, 14, 15, 16, 17, 18, 19, 20} c={1,2,3,4,5,16,17, 18, 19, 20} with c++