2.An electrical manufacturer tests 4 generators by measuring their output voltages at 3 different times. Write a C++ program that uses a nested loop to enter each generator's test results(be sure to store the results in a 2D array). The program then computes and displays the average voltage for each generator. Display also the test results for each generator in table form. Analysis: Test results Output 1 Output 2 Output 3 Average Generator 1 2 2 Generator 2 3 3 3 3 Generator 3 4 4 4 Generator 4 3 3 1.Modify the generator program such that it will also calculate and display the average voltage of all generators.
Q: I). Write a program in c++ with class that will help an elementary school student learn…
A: A C++ program for the practice of multiplication is given as follows,File name: “main.cpp”//Declare…
Q: I need a code of this in C language. Instructions: Your task is to ask the user for the number of…
A: Here is the detailed explanation of the c program
Q: Given an array containing 'N' even number of elements, the task is to read a number from the user…
A: We need to write a C program to take input from the user in numbers and if the input number is a…
Q: Write a program in c bullet: to Input data into an array of 5 elements Calculate the sum and average…
A: Note : since its mentioned to provide input and output on c++ . we are providing code in c++…
Q: .Write a C program that will ask the user to enter 50 positive integer. If the user enters an…
A: Given: Write a C program that will ask the user to enter 50 positive integer. If the user enters an…
Q: Suppose that you are having a 2D double array with (50][5] sizes. Write a C program having only one…
A: C code for the given question :- #include <stdio.h> int main(void) { double arr[50][5];…
Q: Using C Code A. Write a program that after initializing a 4x6 array of numbers ranging between 0-9,…
A: Answer A. By using for loop to convert each elements of 2D array: #include<stdio.h>void…
Q: N real numbers entered by the user on the keyboard are in order from the smallest to the largest.…
A: C is indeed one of the most popular programming language of present time. It is one of the simplest…
Q: Write a C++ code that does the following. Q.2) 1. The program asks the user to enter the size of the…
A: A program is asked which takes a set of inputs from the keyboard and using those values prints a…
Q: matrix of 0s and 1s) Write a function that displays an n-by-n matrix using the following header:…
A: Code: from random import randintdef printMatrix(n): for x in range(n): for y in range(n):…
Q: Suppose you have the following array: int findtarget[10] = { 4, 3, 100, 3, 1, 5, 10, 90, 9, 101 };…
A: C++ code to find number and its count of occurrence in an array
Q: Write a C program that declares and initializes two integer arrays of equal size as shown below.…
A: Sample output: Input Array A: [-1 2 5 3]Input Array B: [20 -8 4 1]Sum of the arrays: [19 -6 9 4]Dot…
Q: Write a C Program using Concepts of Arrays and string functions. Create a code that satisty the…
A: Algorithm to find the average, largest number in an array and indexes. Input an array of n length.…
Q: Write a C++ program that generate 20 random integers between 10 and 90 and then stores it in an…
A: Declare an array of size 20. Then assign 20 random number using loop and rand() % 90 + 10 Mean is…
Q: Write a C++ program that simulates online shopping. Declare a variable cart to be an empty…
A: I give the code in C++ along with output and code screenshots.
Q: Write a program in C++ which takes two 4 x 4 matrices as input from the user and displays the…
A: c++ program is as given below : // C++ Program to Make a Calculator #include<iostream> using…
Q: A bank’s customer records are to be stored in a file and read into a set of arrays so that a…
A: Program: // including essential headers file #include<iostream> #include<fstream>…
Q: Write a C programming to find out maximum and minimum of some values using function which will…
A: There Are two questions I have solved first one means 2.
Q: Write a C++ program using array and loop that prompts a user to enter 15 Students' marks in Program…
A: #include<bits/stdc++.h>//Imports all library using namespace std; int main() { // your code…
Q: Suppose that you are having a 2D double array with [50][5] sizes. Write a C program having only one…
A: C Code :- #include<stdio.h> int main() { float arr[50][5]; float s; int…
Q: Write a C++ program based on the following requirements (using 2-D array): Program will display the…
A: Sample Response: //C++ program to calculate the total gross pay of a company#include…
Q: a. Write, compile, and run a C++ program to input 10 integer numbers into an array named fmax and…
A: Here you posted multiple questions, as per the policy we can answer only one question. Here doing…
Q: An integer double-dimensional array called hotel is used to keep track of reservations in an hotel…
A: The solution for the above given question is given below:
Q: Write a C program using arrays to input 3 Grade Points, store them in an array and calculate the…
A: Here I have created an array of float data types with a size of 3. Next, I have taken input from the…
Q: Write a C program that declares and initializes two integer arrays of equal size as shown below.…
A: The solution for the above given question is given below:
Q: ng C++ Language In this program, you will write a program that uses a function to compute the…
A: I have written c++ code below:
Q: our program should prompt the user for an integer and then for either 8 for base 8 conversion or 16…
A: Approach: In the program, a switch statement is used in which case 1 executes to convert decimal to…
Q: A bank's customer records are to be stored in a file and read into a set of arrays so that a…
A: •¢ Include the header files iostream for input-output operation, fstream for file operations,…
Q: Suppose that you are having a 2D double array with [50][5] sizes. Write a C program having only one…
A: #include<stdio.h>void main(){double arr[100][5]; //used to store array inputint chk;…
Q: Write a C program that read 10 highest mountain in Malaysia in meter entered by the user and store…
A: 1) Below is C Program to read 10 heighest mountain in malaysia in meters entered by user, store them…
Q: 1. Write a C program to take 10 integer values from user. Then take an integer value from user and…
A: we take a array of 10 element then we take a number from user square that number perform linear…
Q: Write a Menu Driven C++ program that creates a character array/string by taking input from the user…
A: Program code: #include <iostream>#include <fstream>using namespace std;//function to…
Q: a) Write a C function to find the most repeated odd number in an array. b) Write a C function to…
A: Given: Write a C program
Q: Suppose that you are having a 2D double array with [50][5] sizes. Write a C program having only one…
A: C program for the given problem.
Q: Write a C program using arrays to input 3 Grade Points, store them in an array and calculate the…
A: Hello Student Greetings Hope you are doing great. I will try my best Thank You!!!
Q: Write a C++ program that declares an array alpha of 50 components of type double. Initialize the…
A: Program code: //include the required header files#include <iostream>#include…
Q: in c++ Given the following, use a range-based for loop to load the array with user input (include a…
A: The C++ program to enter and display the content of an integer array by using range-based for loop,…
Q: have to write a C++ Program to store temperature of 1 city for a week. It shall ask what is unit of…
A: C++ language is a direct descendant of C programming language with additional features such as type…
Q: Write a c++ program and test the “digit” function: Function Prototype: int digit(int n,int k) This…
A: int digit(int n,int k){ string str; str = to_string(n); if(k>=str.length()) return…
Q: Suppose that you are having a 2D double array with (50][5] sizes. Write a C program having only one…
A: The code in C has been given in step 2.
Q: Write a program that would initialize two 2D-Arrays (matrix A and matrix B) using numbers n the…
A: code #include <iostream> using namespace std; int main(){int…
Q: I need to solve this in C++ code When analyzing data sets, such as data for human heights or for…
A: A C++ program for the given criteria is as follows,//Declare header files#include…
Q: The table below shows the deformed lengths of four (4) springs of length 10 cm each when stretched…
A: Algorithm: Start Initialize maxLength array with given data Declare another array spring of length…
Q: Write a C++ program using array and loop that prompts a user to enter 15 Students’ marks in Program…
A: Program code: #include <iostream> using namespace std; int main(){ //Declare variables…
Q: Write a complete C program that declares an array of size 10 of datatype double, inputs 10 values…
A: function main: Start declare arr of size 10 declare i display Enter the elements in array for i = 0…
Q: Write a C++ program using array and loop that prompts a user to enter 15 Students' marks in Program…
A: Code: #include <iostream>using namespace std;float findMaximum(float a[], int n){ float mx…
Q: Write a program in C++ to input attendance as 0 (for absent) and 1 (for present) for 25 students in…
A: C++ Code for above : #include<iostream> using namespace std; int main(){ //2D matrix…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- you will write a c++ program that prompts the user to input elements for two 2x2 matrices. Your program should store the elements of each matrix in a 2D array, then, display the product reciprocal of the two matrices. Note: You must use a nested for loop to process the elements of the matrices.you will write a c++ program to input 5 elements (of type int) from the user and store them in an array. Your program should then reverse the array and display it. For instance, if the user enters 1 2 3 4 5 as the five elements of the array, your program should reverse it and display: 5 4 3 2 1 Note: You must use a for loop to process the array.Question 4Write a C++ program that will allow the teachers to do the following:Capture the student performance record in a sentinel-controlled loop and store the results in three parallel arrays. The information to be stored in the three arrays is the student’s full name, continuous assessment mark, and final mark. If the lecturer types the word ‘Done’ instead of a full name, the loop should immediately stop even before capturing any marks.Search the array for the student’s full name and then display the full record of the student, or the notification that student does not exist. You should also allow the teachers to search for the best or worst performer in the Final Mark column. When the mark is found, let it be displayed with all the student’s details.Make this program a menu driven system with the following options: Capture Marks, Find a Student, Find the Best Performer, Find the Worst Performer
- Write a C++ program that simulates online shopping. Declare a variable cart to be an empty Array. The program should have a loop that continues as long as the user wants to shop. Each time through the loop read in the name, price, and quantity of the item the user wants to add to the cart. After adding an item to the cart, the cart contents should be printed. After the loop print a "Please pay ...” message with the total price of the items in the cart.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)Create a program using C++ that satisfies the following requirements: SAMPLE ATTACHED Develop a function called "randomPairsGenerator" that generates and displays pairs of random numbers, with a maximum of 5 pairs per line. Within this function, use a loop to create 20 pairs of random numbers:1) The first number in each pair should be within the range of 1 to 50, inclusive.2) The second number in each pair should be within the range of 51 to 100, inclusive. For each pair, print the two numbers side by side, separated by a space. Separate each pair with a comma. After every 5 pairs, start a new line. After all 20 pairs have been generated, display the total count of pairs in which the sum of the two numbers is divisible by 7.
- Write a C program that uses arrays and functions to implement a calculator for twooperands. Your calculator must have five principal operations, addition ( ), subtraction ( ),division ( ), multiplication ( ), and power ( ). In the beginning of the program, show the menuof operators to the user. When the user selects one of the operators, your program gets the valuesfor operand 1 and operand 2 from the user and saves them into an array. Then pass the array to thesuitable function to calculate the result. The operating functions must return the value to the mainprogram. The calculation stops when the user press “x”. Use a global variable to save the result oflast operation. Anytime that the user types “M”, the program shows the result of last operation.hint: Each mathematic operation must be a separate function. Your main program calls those functions.For this project the program should be made in C++ Write a menu driven program that reads an array of 10 integer from standard keyboard (user) utilizing a loop and outputs the following depending on user's choice Choice 1 - Prints the elements of array Choice 2 - Prints the minimum value of the array Choice 3 - Prints the maximum value of the array Choice 4 - Prints the product of all the numbers utilizing a loop. Choice 5 - Prints the sum of all the numbers utilizing a loop Choice 6- Print the elements of array in a reverse order When the program is done, your program should ask the user if they would like to enter another set of 10 numbers and the program should repeat itself. Input validation: Your program should only accepts integers.3.Write a C program that will ask the user to enter 50 positive integer. If the user enters an invalid input, the code repeats the command of asking the user for a positive integer until the input is correct. The 50 positive integers must be stored in a two(2) dimensional array. The program prints out the sum of all even numbers stored form the array.
- Help writing a program in c++ that asks a user for a number (variable num) and then takes that number input to print out the nth term of a sequence? The sequence begins with 1 and then every number after is a prime factor of 3, 4, or 6. This needs to be done without using vectors or arrays. . . . For example: Sequence is : 1, 3, 4, 6, 8, 9, 12, 16, 18, 20, ... (cont.) User input (num) is : 6 Output : 12 (6th term) . . Please add comments explaining the code for better understanding if possible, thank you!!27. In C programming . make a program that lists 10 numbers from the user into an array, create a moving_average function that when its in a loop it makes a length 3 moving average array. make sure it prints the inputted array and then the moving average array. make a flowchart with itWrite a C++ console application to find the summation of two matrices. First, take the row and column numbers of two matrices. If the number of rows of first matrix is same to the number of rows of second matrix (same condition for column), we can add them. So, your program check this condition before taking the values of matrices. Declare two dimensional (2D) arrays to put the values of each matrix and add them in another 2D array. Sample Input: Enter the rows and columns of first matrix: 3 4 Enter the rows and columns of second matrix: 2 4 Output Rows and Columns are not same. Enter the rows and columns of first matrix: 2 3 Enter the rows and columns of second matrix: 2 3 Enter first matrix: 2 5 6 3 7 9 Enter Second Matrix 5 10 12 11 7 19 The summation of two matrices is 7 15 18 14 14 28