Computer Science II Mid Exam for Second Course 2020-2021 Theory Exam Q1) Write a C++ Program to find highest and lowest element of array.
Q: H.W1: C Program to Sort Elements of Array in descending Order
A: As per our guidelines we are supposed to answer only one question. Kindly repost other question as a…
Q: Create a Food Ordering Using C langauge it should demonstrate array and functions
A: C program to implement Food ordering with the following functionalities: Login & Signup Search…
Q: in c language Use one-dimensional arrays to solve the following problem. Read in two sets of…
A: 1. Read array 1 having 10 numbers. 2. Read array 2 having 10 numbers. 3. Declare array 3 that will…
Q: Fill-in-the-Blank When a two-dimensional array is passed to a function, the number of _________ must…
A: EXPLANATION - When a one dimensional array is initialized at the time declaration then it is not…
Q: C++ Write the one line of C++ code to assign the value 88 to the array element at the index.…
A: Answer : Answer is - grades[index]=88; Array of integers is --> grades Integer variable -->…
Q: C program for the longest common array of 2 arrays. Use the: function void…
A: so we have to write a C program for the longest common array of 2 arrays. and we have to Use the:…
Q: Array Challenge 3. Write a program in C# to find the sum of all elements of the array. Test Data :…
A: Code using for loop: Alternative solution using System.Linq:
Q: int A[] = {12, 34, 67, 19, 23, 66, 100, -10, 222}; Write the complete code in C language to input…
A: Solution: Given,
Q: Q5) Write C++ program to create a function to read and find the summation of array values. The array…
A: Please find the answer below :
Q: Exercise#1: Write a complete C++ code that creates an integer array of 10 elements. Use a loop to…
A: Your C++ program is given below as you required with an output.
Q: Lab Assignment Question 1- Program in C++ to take input size of array from user and show how to…
A: In C++, cin function is used to take input a variable and syntax of declaration of array is: int…
Q: Write the C programming function that prints a 23 numbered array sent into it with the main…
A: Answer is given below .
Q: Q2: Write the code of C++ which is used to find out the first & second maximum element from Arrays.…
A: Write the code of C++ which is used to find out the first & second maximum element from Arrays.…
Q: C automatically passes arrays to functions by reference, the called functions can modify the element…
A: Function Calling: A call to a function is a crucial feature of the C programming language. When a…
Q: Q4) An (5,10) array with integer elements from 1 to 50. Write a program in C++ to find the number…
A: Subject: C++ Programming An(5,10) array with integer elements from 1 to 50. Write a program in C++…
Q: Write the differences between structures and arrays.
A:
Q: Step1: Write a C program to do a bubble sort. You must use a bubbleArray() function to perform…
A: E need to provide C code to read integer file , sort them and rewrite sorted data in other file
Q: return
A: A function which will find the average of all elements of an array of integers. float average(int…
Q: In C++I need to compose a function that accepts an array of integer values as an argument and…
A: Here in this question we have asked to write a program which take an array of integer as input and…
Q: iii) Write a C program to create the prefix sum array for the array given below, where sum[i][j]…
A: Write a C program to create the prefix sum array for the array given below, where sum[i][j] contains…
Q: Lab Assignment Question 2-Program in C++ to take input size of array from user and then take input…
A: To find sum of all elements in the array, initialise a variable sum=0 and run a loop from i=0 to…
Q: H.W1: C++ Program to Sort Elements of Array in descending Order
A: #include <iostream>using namespace std; void bubbleSort(int arr[], int n) { int i, j;…
Q: 2) Implement this C program using at least three arrays to store the interest, principle and balance…
A: Answer: C Source Code: 2. #include <stdio.h>#include <stdlib.h>#include <math.h>…
Q: Code for this in C: You have already created an array named NUMBERS with 20cells. You are to…
A: #include <stdio.h> int main(){ int NUMBERS[20]; for(int i=0;i<20;i++) //Loop for…
Q: if i have an array like eg: string colour[8] = { "Bliss", "Gray", "boy", "Young","riley",…
A: Given: An array of string datatype is given: string colour[8] = { "Bliss", "Gray", "boy",…
Q: in code c++ Assuming an array declared as: int numbers[SIZE]; Write an expression to access: a)…
A: Algorithm : Step 1 : declare constant integer variable SIZE. Step 2 : declare integer array with…
Q: C function please Write a C function named(Count_elements), that accepts a one-dimensional array…
A: NOTE - In the given example there is only one such value that is divisible by both 2 and 3 and that…
Q: Complete the C function that prints all elements of an array using pointers. The elements of each…
A: Please find the answer below :
Q: one-dimensional array: Write a C++ program that defines an array of integer intArray and find the…
A: This is coded in C++ by using one-dimensional array.
Q: C program for array Get 10 elements from user and print it on screen
A: logic:- declare an array of size 10. iterate from i=0 to i<10 read arr[i] end loop iterate…
Q: T/F 4) A double, boolean, or String cannot be used as an array index.
A: please see the next step for solution
Q: An array of 100 elements is specified. Identify the first negative element of this array and print…
A: C++ language is an object-oriented programming language, It will be supported by procedural,…
Q: Q1. Using the term of Class, develop a C++ program that finds the summation of all prime numbers and…
A: Task: Our task is to provide the sum of array using the c++ program.
Q: one-dimensional array: Write a C++ program that defines an array of integer intArray and find the…
A: #include <bits/stdc++.h>using namespace std; int main(){ int i,j,n,sum=0,avg,temp;…
Q: I
A: Coded using C language.
Q: Q2: Write a complete program to calculate the sumation of the primary diagonal elements in a square…
A: It is provided that there is an square array having 36 elements. So to find the number of rows and…
Q: /hat will be the c rogram: import array array (" V=a rr
A: Code:- import array as arrx=arr . array ("i" , [20, 40, 60 , 70, 90, 100])for i in range(4, 6,2) :…
Q: Assign the pointer style C-string a to the array style C-string b. You can assume that b is large…
A: Algorithm : Step 1 : initializing pointer style c-string a. Step 2 : declaring c-string array b.…
Q: Write a C program that will accept n integers and display the sum of the even- indexed elements in…
A: Input n and the declare array of size n and then use loops to input array elements and then print…
Q: Q3 Q3/ Write a program to reserve an array 7x7, like the shape below using loop function only. в в в…
A: You have not told in which way we have to reverse the array so I reversed in both ways you can…
Q: Subject : Programming Language : C + + Question : Write three C++ functions which accepts an…
A: C++ Program: #include <iostream>using namespace std; // Function that computes the sum of an…
Q: Question 2. Write a complete C++ program that uses a 2-dimensional array with 4 rows and 30 columns.…
A: Program Instructions:In main, declare an array and call function fillarray() that fills the array…
Q: Please code in C Pascal’s Triangle Version 2 The Pascal triangle can be used to compute the…
A: Here have to determine about pascal triangle print code
Q: har zetta[10] = {'B','A','D','G','U','Y','H','E',’L’,’P’}; Write a C programing code that will…
A: Array indexing starts from 0 and thus index values will be from 0-9 for this array Here, we have to…
Q: q3/write program in c++ language read 2D array and print the elements that are not divisible 7 le…
A: function main(): Start Declare row, column Read row, column Declare arr[row][column] for i = 0 to…
Q: A function in C++ that takes input from the user and stores it in an array #include using…
A: Arrays are a single variable data structure utilized to hold multiple values instead of declaring…
Q: C program for the longest sequence of increasing numbers for one array. Use the function: void…
A: Algorithm: Start Read array size n Read n numbers and store them in an array 'a' Implement a method…
Q: the mean of the 10 float number array according to a decimal array
A: the c code is an given below : // C# program to find mean // and median of an array using System;…
Q: An array consists of integers.Write a C program to count the number of elements less than,greater…
A: Array is one the basic data structures that is used to store the element of the same data type. For…
Q: c++ program Q2 Write a C++ program to store values in a two-dimensional array i.e., 3x4 and then…
A: Initialize global variables row as 3 and col as 4. Initialize the 3x4 array 'arr' in the main…
Step by step
Solved in 2 steps
- (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard into an array named grade. The grades are to be counted as they’re read, and entry is to be terminated when a negative value has been entered. After all grades have been input, your program should find and display the sum and average of the grades. The grades should then be listed with an asterisk (*) placed in front of each grade that’s below the average. b. Extend the program written for Exercise 1a to display each grade and its letter equivalent, using the following scale: Between90and100=AGreaterthanorequalto80andlessthan90=BGreaterthanorequalto70andlessthan80=CGreaterthanorequalto60andlessthan70=DLessthan60=F(Numerical) Given a one-dimensional array of integer numbers, write and test a function that displays the array elements in reverse order.(Electrical eng.) Write a program that specifies three one-dimensional arrays named current, resistance, and volts. Each array should be capable of holding 10 elements. Using a for loop, input values for the current and resistance arrays. The entries in the volts array should be the product of the corresponding values in the current and resistance arrays (sovolts[i]=current[i]resistance[i]). After all the data has been entered, display the following output, with the appropriate value under each column heading: CurrentResistance Volts
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.(Electrical eng.) a. An engineer has constructed a two-dimensional array of real numbers with three rows and five columns. This array currently contains test voltages of an amplifier. Write a C++ program that interactively inputs 15 array values, and then determines the total number of voltages in these ranges: less than 60, greater than or equal to 60 and less than 70, greater than or equal to 70 and less than 80, greater than or equal to 80 and less than 90, and greater than or equal to 90. b. Entering 15 voltages each time the program written for Exercise 7a runs is cumbersome. What method could be used for initializing the array during the testing phase? c. How might the program you wrote for Exercise 7a be modified to include the case of no voltage being present? That is, what voltage could be used to indicate an invalid voltage, and how would your program have to be modified to exclude counting such a voltage?(Data processing) Construct a three-dimensional weather array for a two-week time period. Include this array in a C++ program that displays the temperatures correctly in response to any of the following user requests: • Any day’s high and low temperatures • Average high and low temperatures for a given month • Month and day with the highest temperature • Month and day with the lowest temperature
- Question 2. Write a complete C++ program that uses a 2-dimensional array with 4 rows and 30 columns. Row represents sections of a course and column represents the students, value inside each position of the array is the final exam grade for each students. Fill the array with random numbers between 40 and 100. Calculate the total, average, maximum, minimum for each section.C program for the longest common array of 2 arrays. Use the: function void longestMutualSequence(int firstArr[], int secondArr[], int sizeA, int sizeB);C++ QUESTION define an array with 10 elements, and enter the initial values from the keyboard. Compute the maximum value using function, finally print the result on the screen in the main function.
- char zetta[10] = {'B','A','D','G','U','Y','H','E',’L’,’P’}; Write a C programing code that will display the list of vowels and consonantsposition in the array, zetta.C++ programming Assume an integer array of size 12 named arrSales stores the sales of a product for eachmonth. For example, sales for January should be stored in 1st position of the array, andFebruary is stored in 2nd position of the array and so on for the rest of the months.Write a segment of code in C++ that perform the following: 1. Define a string array of size 12 and initialise the values of the array with the values tothe calendar months from “January” to “December”.2.. Prompt user to enter a month in integer (e.g 1 for January). Then, display the salesfigure based on that month. Make sure month is display in letter format by using thearray defined in (i). Sample program runs as below:Enter a month:2The sales for February is RM60003.. Using loop structure, count the number of months where the sales is below RM2000.You should display the result, list the affected months (by using the array defined in(i)) and its actual sales figures respectively. For example if April, September…c program, Fill an array with 10 random integers between 0 & 100. Write a function that accepts this array and calculates both the minimum and maximum values in it. Print these values in the main() function. use pointers