Question 6 What is the output of the following code? Assume the input is 10 30 16 25 76 -1 int num=0; int sum; int count=0; cin >> sum; while (count < 3) cin >> num; sum = sum + num; count++; cout << "Sum ="<< sum; Question 7 What is the output of the following code? Assume the input is 25 36 18 16 -1 int num: int sum; cin >> sum: num = sum while (num l= -1) cin >> num: sum = sum + num: cout << "Sum = "<< sum:
Q: /*Question: what is the output after executed the following Program*/ #include using namespace std;…
A: - The question is to know the output of the provided code. - The code is given in c++. - From…
Q: 5c. What will be the output of the following C++ code? #include int main(int argc, char const…
A: Given, Code: #include<stdio.h>int main(int argc, char const *argv[]){char a =…
Q: Examine the following code segment. What will be printed? If there are any errors indicate the…
A: Errors in program: Variable “i” which is used for loop traversing is not declared. This error is…
Q: Consider the following code. NOT_Assigned [5, 0, 2, 4, 6, 3, 1] num = alist = val = 0 for i in…
A: Given code: num=?alist=[5,0,2,4,6,3,1]val=0 for i in range(0,num): val=alist[alist[val]]…
Q: 13) What does the following code do? int value1 = Keyboard.readInt( ); int value2 =…
A: Question 13. What does the following code do? int value1 = Keyboard.readInt( ); int value2 =…
Q: I did not understand why this code output is 2. Please explain to me, thank you. #include using…
A: int main(){ int vals[]={4, 7, 11}; // an array with values 4, 7, 11 int…
Q: Question: If you would type 5 after the text “Input number of rows”, what is the output of the whole…
A: The question has been solved in step2:
Q: You are tasked with programming the following summation: 72 i=1 A co-worker has suggested the…
A: Corrected Code: from math import *x = 5y = [1, 2, 3, 4]prod = 1for i in range(1, len(y)+1):…
Q: Q#05: Write output of the following program and remove error if you find any #include using…
A: There are few errors in the code which have to changed. for (i=1;;) --> for statement should be…
Q: Assume the following declarations and initializations (MIN, MAX, num) are made justbefore each…
A: Note: Comments have been included in the source code itself to have a better understanding of the…
Q: QUESTION 14 Analyze the following code: If (x 10) System.out printin("x is between 10 and 100"). O…
A: We will solve the given problem in Java language.
Q: . Find four errors in the following code that is attempting to add up five numbers. int val, count ,…
A: Errors: There is no code inside while loop. Inorder to perform the required functionality, we need…
Q: Please answer as soon as you can. What will be the output of the following C++ code?…
A: Given, Code: #include <iostream> using namespace std; main() { double a = 21.09399;…
Q: QI: Answer all of the following: 1- If the following lines of code have errors, correct them;…
A: To Do: To write the answers.
Q: Program 1: Write a program which does the following: Takes 2 int data type inputs from the user,…
A: Program 1: Code: import java.util.Scanner;public class Main{ public static void main(String[] args)…
Q: 3. Count Even N(from codeChum, modified) 1 #include #include"positive.h" int main(void) { int n =…
A: I give the code in C as per your requirement and also provide the output and code screenshot
Q: 3. Trace the given code and write the output. #include using namespace std; int main() int resp…
A: The above code output and explanation is given in step 2:-
Q: What will be the contents of sum? in c # include int main(void) {…
A: Introduction of the Program: The C program takes a variable count that starts from 1 and incremented…
Q: 6. Suppose the user entered x Required Output. 5, fill in the blank line with the correct C code to…
A: Here we need to know working of switch case in c language before solving this code. If we need to…
Q: #include using namespace std; int main ( ) { static double i; i =…
A: The output is coded in C++.
Q: 6.29 LAB: Max and min numbers Write a program whose inputs are three integers, and whose outputs are…
A: Answer: step 1: take three inputs step 2 : define two functions one for finding largest among three…
Q: What does the following code output? int x = 7, y = 10; X -= 32; y *= 4; cout « "y = " « y « " and x…
A: In the C++ program, the code that is in the main() function only has provided; so, for the whole…
Q: Write a statement or a set of statements to accomplish each of the following tasks:a) Sum the odd…
A: As per our guidelines, we are supposed to answer only 1st three parts. Kindly repost the remaining…
Q: 16. Consider the following code: ot her = True 1 - int (input (OMumber: )) if other and x > 0: print…
A: Answer: Code: other = Truex = int(input("Number: "))#taking user input#condition checking to print…
Q: Question 10 The exact output produced after executing the following C++ code is int x=10, y=16,…
A: Code: #include <iostream> using namespace std; int main(){ int x=10, y=16, z=12 ;cout…
Q: Kindly use your NAME, SURNAME, & DATE as a variable in your answer to following questions: Create…
A: Below is the required C program: - Approach: - Include the header files. Create the union…
Q: What is the ouput f the following code #include void fun (int *ptr) { --pt; } int main() {…
A: Given: What is the ouput f the following code #include <stdio.h> void fun (int *ptr) {--pt; }…
Q: For the following switch statement; a. What is output by the following code segment if month has…
A: Output: JuneJulyAugustSeptemberOctoberNovemberDecemberError
Q: /*Question: what is the output after executed the following Program*/ #include using namespace std;…
A: We have to find the output of the given program: #include <iostream>using namespace std;int…
Q: Use Python Library Tkinter for This Question! a) Write a function named “ hexToBinary) " that…
A: EXPLANATION - A program is created . Then function hexToBinary is created . In function ask user…
Q: 6. Analyze the following code. int x = 0; if (x > 0); { System.out.println("x"); } a. The value of…
A: 6). (c) The symbol x is always printed. Here, the the x is always greater and you can see in the…
Q: QUESTION 2 What will be the output of the following code? A. 1 B. Error C. 1 3 5…
A: The above question is solved in step 2:-
Q: 1. What is the output of the following code segment? n = 1; while (n <= 5) cout << n << ' '; n++;
A: Given program (with open while loop) is written with comments below as complete program for…
Q: What the output from executes this program? #include "iostream" using namespace std; int main() {…
A: Please find the answer below :
Q: Question 21 Give the output of following code for num in range (6): a += (num**2) print (a, end=',")…
A: Given: Give the output of the code.
Q: Please create a code that solves for matrix addition and matrix scalar multiplication. The code for…
A: Answer: I have done code in python as also I have attached code
Q: Type two statements. The first reads user input into person_name. The second reads user input into…
A: HI THEREI AM ADDING ANSWER IN PYTHON BELOWPLEASE GO THROUGH ITTHANK YOU
Q: Correct and detailed answer will be Upvoted else downvoted. Thank you! What will be the output of…
A: Question. What will be the output of the following C++ code? #include <iostream>using…
Q: can you make a flow chart of this: #include int main(){ int num1, num2;…
A: #include <stdio.h> int main(){ int num1, num2; for(num1 = 1; num1 <= 10;…
Q: c) Identify three problems from the following program code: //Accumulate all the enter values int…
A: Following are the problems regarding to this code: /Accumulate all the enter valuesint…
Q: Analyze the following code segments and find the output
A: #include <iostream> using namespace std; int main(){ int data [] = {16, 20, 57, 40, 127};…
Q: 3.12 LAB: Input and formatted output: House real estate summary Sites like Zillow get input about…
A: Coded using Python 3.
Q: 3. After execution of the following code, what is stored in valueNum? All variables are using data…
A: The correct option is option b which is the largest value of num1,num2, and num3. The value stored…
Q: Write a complete program to compute the grade of students based on their coursework and final marks.…
A: The required C++ code for given problem is: #include<iostream>#include<iomanip>#define…
Q: Run the following C program. What is the value of variable “b” at the end of the program?
A: In fn1, a is the parameter passed to function a = a / 2; //divide a by 2 a = a + 5; //add 5…
Q: What is the output of the following program? #include using namespace std; void…
A: Question. What is the output of the following program? Answer. Code: #include <iostream>…
Q: Examine the following code segment. What will be printed? If there are any errors indicate the…
A: Identify the errors in the program: (i) Syntax error: Variable "i" is not declared. (ii)Syntax…
Q: Statistics are often calculated with varying amounts of input data. Write a program that takes any…
A: A required C program is as follows, #include <stdio.h> int main() { //Declare and…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- (Data processing) Your professor has asked you to write a C++ program that determines grades at the end of the semester. For each student, identified by an integer number between 1 and 60, four exam grades must be kept, and two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: The first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade gets a weight of 0.3, and the fourth grade gets a weight of 0.2. That is, the final grade is computed as follows: 0.2grade1+0.3grade2+0.3grade3+0.2grade4 Using this information, construct a 60-by-7 two-dimensional array, in which the first column is used for the student number, the next four columns for the grades, and the last two columns for the computed final grades. The program’s output should be a display of the data in the completed array. For testing purposes, the professor has provided the following data:It is required to implement a MATLAB program By using "user define function" that used to: • Read (100) diagnosis data shown in the table below from the key board. • Display all Patient's data who have a "High Risk "condition only "High Risk" are patient who have an age greater than or equal to 75 If there are no high risk patients the program should terminated with an appropriate message Diagnosis Data Sample No. Patient ID Name Ag Height (cm) Weight(kg) e 1 905792 K.M. Liam 50 166 90 126987 A.H. Noah 60 170 105 100 913376 L.S.Benjami 80 160 85Computer Science This is an introductory exercise to the manipulation of random variables with Python as a language for scientific computing and numerical computation. You have: f(x) = Ae-0.1x)° 4 x*, 0int p =5 , q =6; void foo ( int b , int c ) { b = 2 * c ; p = p + c ; c = 1 + p ; q = q * 2; print ( b + c ); } main () { foo (p , q ); print p , q ; } Explain and print the output of the above code when the parameters to the foo function are passed by value. Explain and print the output of the above code when the parameters to the foo function are passed by reference. Explain and print the output of the above code when the parameters to the foo function are passed by value result. Explain and print the output of the above code when the parameters to the foo function are passed by name.The system to be developed for Williams and Son needs to produce the following slip for acustomer once the sale has been concluded.Please note: For the purpose of this assignment, assume that a customer will only purchase oneunit of each item.Q.2.1 Write the pseudocode that will produce a slip similar to the one illustrated atthe beginning of the question. Your solution should satisfy the followingrequirements: The solution must illustrate the use of good programming practices; The solution must make use of a loop; The loop must make use of a sentinel value.(22)Q.2.2 The mainline logic of almost every procedural program consists of three partsnamely housekeeping tasks, detail loop tasks and end-of-job tasks. By makinguse of flowcharts, show how these parts can be implemented in your solutionfor Question 2.1.(23)Q.2.3 All of your solutions should be structured. Explainwhy your solution can beconsidered a structured solution.Code the function multiplier(). /***** *** //The multiplier function takes 2 integer // parameters n1 and n2 and displays the result // of n1 times n2 //*** *******Executive Training School offers typing classes. Each final exam evaluates a student's typing speed and the number of typing errors made. Develop the logic for a program that produces a summary table of each examination's results. Each row represents the number of students whose typing speed falls within the following ranges of words per minute: 0-19, 20-39, 40-69, and 70 or more. Each column represents the number of students who made different numbers of typing errors -0 through 6 or more. (I need pseudocode)Analyze the following program fragment: int x; int d = 4; switch (d) { case 4: x = 4; case 0: x = 0; case 2: x = 2; The program has a compile error because case must be ordered from smallest to largestes. The program has a compile error because the break statements are missing.. The programs compiles and runs fine. The program has a compile error because the required default case is missing.Problem Statement: Consider a permutation of numbers from 1 to N written on a paper. Let’s denote the product of its element as ‘prod’ and the sum of its elements as ‘sum’. Given a positive integer N, your task is to determine whether ‘prod’ is divisible by ‘sum’ or not. Input Format: First input will be an integer T. It depicts a number of test cases. Followed by the value for each test case. Each test case will contain an integer N (1<= N <=10^9). It is nothing but the length of the permutation. Output Format: For each test case, print “YEAH” if ‘prod’ is divisible by ‘sum’, otherwise print “NAH”..Consider the following segment of code:procedure Mvar x: integer;procedure A (c: integer)var a, b: integer;procedure Bvar b, c, d: integer;begin {B}….a := c – d;….end B;begin {A}….x := b + c;….B()….end A;begin {M}….A(3)….end M;Assuming the definition of M is at static nesting level 0. Draw the runtime stack that will be ineffect at the execution of “a := c – d;”. Show the static and dynamic links, and the currentpositions of the EP and SP pointers.What is the static distance to x’s environment of definition and the offset within the environmentwhen “a := c – d;” is executed?Question 9 Electrical resistors are said to be connected "in series" if the same current passes through each and "in parallel" if the same voltage is applied across each. If in series, they are equivalent to a single resistor whose resistance is given by + R₂ R = R₁ + R₂ + R3 + If in parallel, their equivalent resistance is given by 1 1 1 1 1 = + + + + R₁. R R₁ R₁ R₂ Write an M- le that prompts the user for the type of connection (series or parallel) and the number of resistors n and then computes the equivalent resistance.CODE IN C++ Language: Given two sets of inputs: a time (two inputs: the first is the hour which is an integer of 1-12, the second whether the time of the day is am denoted by 'a' or pm denoted by 'p'); and, a number n referring to how many hours is to be added which is an integer of 1-11, find the resulting time after we add the inputted time with the number of hours n inputted. Input The first line is two inputs: the first being the hour (1-12) and the second being am or pm ('a' or 'p'), The second line is any integer from 1 to 11 1 p 7 Output: The time in hours and whether am or pm. 8 pmSEE MORE QUESTIONS