3- How many the number of errors in the following sub_program? Hincludeciostream.h> void main() intnum, sum - 1; for (int i = 1, i <= 10, i ++ ) cout<<"enter your number: “; cin>>num; if ( num> 0) sum = sum + num; cout<<"the sum is: << sum;} A) 3 B) 4 C) 5 D) 7 E) None of the above
Q: 3. Write a program to count the number of occurrences of any two vowels in succession in a line of…
A: Actually, program is an executable software that runs on a computer.
Q: QI B// find the error and type and then bulid ST ? #include "iostream" void main() { const…
A: let us see the answer:-
Q: Exercise 2 Write a program that asks the user to enter their student ID and course code (like…
A: Python code for given question is given below.
Q: #include using namespace std; int main() { string c_name ; string car_n; int n, member_n ,…
A: In your program code after input the service number from the user, you need to assign the charges…
Q: 9.15 REQUIRED LAB 9C: Output values below an amount Write a program that first gets a list of…
A: Code: # user input as a stringdata=input('Data list : ') # split integer values to store in…
Q: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: given data Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9…
Q: nt fact(int x); BIUS AV Slides Drawing Editi Aa AA %3D roid main() Font Paragraph int result;…
A: According to the Question below the Solution: Output:
Q: #include #include using namespace std; int main() { long USD, maxUSD; // Amount in USD double…
A: The following code explains :
Q: 4.6 While repetition #include using namespace std; int main() { int x, count = 0; float sum =…
A: The above program will print the sum and count for the number of integers . and at the end will…
Q: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: Program plan: Declare variables table_count and Prompt for the tableNumber, time, and persons…
Q: //Please Fix this program #include using namespace std; class student { int snum; char sname[20];…
A: We have a C++ program and we need to fix the issues in this program.
Q: #include <stdio.h>#include <stdlib.h> //declaring variables globally to calculate…
A: Test cases: Test cases are the conditions or variables which must be tested to determine whether…
Q: Suppose the value entered for the following program is 123321 Write the steps of implementation for…
A: Find the answer given as below :
Q: Write a program that lets the user enter the loan amount and loan period in number of years and…
A: Please find the answer below :
Q: c++ int * board; int rows; int columns; cout > columns >> rows; cout << endl; board= new…
A: Arrays are basically of 2 types:1. Static arrays.2. Dynamic arrays. Static arrays:- Array in…
Q: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: Given that we have Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m.,…
Q: n C++, using STL algorithms, containers, or iterators, use the text file shoes.txt, where you want…
A: code #include<bits/stdc++.h> using namespace std; int main(){ string shoes; char…
Q: In C++, using any STL algorithms, iterators, or containers show all items from movies.txt.…
A: Solution: The STL(Standard Template Library) is a set of C++ template class to give common data…
Q: a. A program that accepts data for one auctioned item. Display data for an auction only if the…
A: *As per the company norms and guidelines we are providing first three sub parts of the given…
Q: printMultTable(int, int);
A: //Explanation for the printMultTable(int,int) ->Here int printMultTable(int,int) is a function…
Q: what is wrong with this programming? #include #include using namespace std; int main() { string…
A: #include <iostream>#include<bits/stdc++.h>using namespace std;int main(){string…
Q: // Cornwall.cpp - This program computes hotel guest rates.// Input: None// Output: Hotel guest…
A: Actually, c++ is a powerful general purpose language. It is a high level language.
Q: Problem 2. (Keygen Program) Write a program called keygen.py that accepts lo (int) and hi (int) as…
A: It is defined as a small program used to generate serials number for software. To use it you should…
Q: #include int main(){ int query_no, flag=0; scanf("%d",&query_no); while(query_no>0)…
A: I give the given code in C along with output and code screenshot
Q: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: Actually, program is an executable software that runs on a computer.
Q: Compute: z = V[x] – y 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int…
A: In the above program, we have to compute the value of z.Here We have used setprecision which is used…
Q: #include #include Collapse 3 4 void Loop(int n) { int i = n; Exercise 6.1 5- 6 7 while (i > 1)…
A: Value of n and i in sequence of execution: - n i 10 10 10 5 10 6 10 3 10 4 10 2
Q: In Cpp, Write a program that: Defines an enum named Scoops. The enum Scoops will have 3 data…
A: Algorithm: Start Define an enum named Scoops with data values single,Double,tripple Define…
Q: Write a complete program including the above code that outputs the concatenation of string1 and…
A: Consider the following code: char string1[25] ="Total Eclipse "; char string2[11] = "of the Sun";…
Q: 4.26 Sum of squares Get a number (n) from the user, and then compute the sum of the squares of the…
A:
Q: uld write a .py program that rolls two dices using random library 10 times and shows the results as…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: #include void main( ) {int m,n; for(m-1;m<4;++m) {for(n=m;n<8;++n) if(m<n) cout<<"*"<<"\t"; else…
A: Option B i.e. syntax error is correct. As in the end we miss one bracket and in the second line use…
Q: What is wrong with the next programming? #include #include using namespace std; int main(){…
A: According to the question below the Solution: Error:
Q: Please change this program to #include #include #include using namespace std; int main() { char…
A: I have provided correct code with proper output:
Q: Modify the swap_string function in this task6.c to swap two strings. task6.c Swapping string Only…
A: Above function will not work because function is changing only local pointer variables so changes…
Q: complete magic Square #include using namespace std; /*int f( int x, int y, int* p, int* q ) { if…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: dify the sample code to prompt the user for a name. Have the program search the existing list for…
A: We need to define a function called search() that accepts a list and name ,search through the list…
Q: Complete the Funnyville High School registration program where user is prompted for her full name…
A: Program to generate emailId and temporary password given a students' full name for funnyville high…
Q: Correct the code by using the global variable to move the calculations such as (downPayment =…
A: I am considering that all the other code is correct only the thing you needed is the adding code for…
Q: In this challenge you should repeat a specific given char x times. Create a function that takes a…
A: In this challenge you should repeat a specific given char x times. Create a function that takes a…
Q: Modify the sample code to prompt the user for a name. Have the program search the existing list for…
A: Lets see the solution.
Q: Use following main function to test your program. (have to use this main function) int main() { cout…
A: Program Approach:- 1. Include header file 2. Create the class whose name is RatNum 3. Create two…
Q: int cal_media() { cout>name; cout>marks1>>marks2; totalmarks = marks1 + marks2; } Question 4: On…
A: sample output
Q: Finding Errors. Identifying the line/s containing errors that can cause the program not to run.…
A: The solution to the given problem is below.
Q: In this challenge you should repeat a specific given char x times. Create a function that takes a…
A: In this problem we need to design the JAVA Script program. Input - two argument Output - string…
Q: void swap C, { int tmp = v2; v2 = v1; v1 = tmp; int main() { int i = 10; int j cout << "Before…
A: Reference arguments : The memory location of a variable is represented by the reference variable.…
Q: . Create a flowchart for he C++ program below: include sing namespace std; nt main() int menucode,…
A: Firstly , initialization statement and data is stored, int menu code, nooforder; string name;…
Q: | Screen Output #include #include #define MAX 3 typedef struct { char part[20]; int quantity;…
A: #include <stdio.h>#include<stdlib.h>#define MAX 3 typedef struct{ char part[20];…
Q: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: please see the next step for solution
Q: bläi 6 This code segment read f, k. Using a define sub procedure (SU) to determine the value of S of…
A: Given Incomplete program Below is the solution for the same
Step by step
Solved in 3 steps with 1 images
- #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…
- #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…Static Variable: a variable whose lifetime is the lifetime of the program (static int x;) Dynamic Variable: It is a pointer to a variable (int *x;) Is this comparison true?In Python, grades_dict = {'Wally': [87,96,70], 'Eva': [100,87,90], 'Sam': [94,77,90], 'Katie': [100,81,82], 'Bob': [83, 65, 85]} write your own describe function that produces thesame 8 statistical results, for each one of the columns, that the built-in describe() function does.Note 1: Use the sample standard deviation formula (that is, the denominator is: N-1)Note 2: Your algorithm should work for any number of columns not just for 5Note 3: You can use the np.percentile() for the 25% and 75% percentile as well as the sort()built-in functions
- In Python, grades_dict = {'Wally': [87,96,70], 'Eva': [100,87,90], 'Sam': [94,77,90], 'Katie': [100,81,82], 'Bob': [83,65,85]} Write your own describe function that produces the same 8 statistical results, for each one of the columns, that the built-in describe() function does. Note 1: Use the sample standard deviation formula (that is, the denominator is: N-1) Note 2: Your algorithm should work for any number of columns not just for 5 Note 3: You can use the np.percentile() for the 25% and 75% percentile as well as the sort() built-in functions#include <stdio.h>#include <stdlib.h> //declaring variables globally to calculate coinsint cent50 = 0;int cent20 = 0;int cent10 = 0;int cent05 = 0; //calculate change//pass change variable by addressvoid calculateChange(int* change) {//calculate change only if change is positiveif(*change > 0) {if(*change >= 50) {*change -= 50;cent50++;}else if(*change >= 20) {*change -= 20;cent20++;}else if(*change >= 10) {*change -= 10;cent10++;}else if(*change >= 05) {*change -= 05;cent05++;}//call calculateChange recursively calculateChange(change);}} // function to display the cents valuesvoid printChange() { if(cent50)printf("\n50 Cents : %d coins", cent50);if(cent20)printf("\n20 Cents : %d coins", cent20);if(cent10)printf("\n10 Cents : %d coins", cent10);if(cent05)printf("\n05 Cents : %d coins", cent05);//reset all cent variables with 0cent50 = 0;cent20 = 0;cent10 = 0;cent05 = 0; } //take change input from user//change variable passed addressvoid TakeChange(int*…Match the C-function on the left to the Intel assemble function on the right. W: cmpl $4 movl %edi , %edi jmp .L4(,%rdi,8) %edi .L3: movl $17, %eax ret .15: movl $3, %eax int A ( int x , int y) { int a ; if ( x == 0 ) else i f ( x == 1 ) a = 3 ; else i f ( x == 2 ) a = 2 0 ; else i f ( x == 3 ) a = 2 ; else i f ( x == 4 ) a = 1 ; ret .L6: a = 17; movl $20, %eax ret .L7: movl $2, %eax ret else a = 0; .L8: return a ; movl $1, %eax .L2: ret . section .rodata . L4: .quad .L3 .quad .L5 .quad .L6 .quad .L7 .quad .L8 X: testl %edi, %edi je cmpl je cmpl je стр1 je cmpl .L16 $1, %edi .L17 $2, %edi .L18 $3, %edi int B (int x, int y) { int a; switch (x) { .L19 $4, %edi %al movzbl %al, %eax case 0: a = 17; break; sete break; case 1: a = 3; case 2: a = 20; break; case 3: a = 2; break; case 4: a = 1; a = 0; } return a; ret .L16: break; movl $17, %eax ret .L17: movl $3, %eax } ret .L18: movl $20, %eax ret .L19: movl ret $2, %eax
- You can dereference a smart pointer with the * operator. True FalseUsing the following header, create a recursive function that shows an integer value backwards on the console using the syntax:reverseDisplay(value) is defined as follows:For example, the reverseDisplay(12345) function shows the number 54321. Create a test application that asks the user to input a number and then shows the inverse of that integer.The pointer variable is defined with: & operator % operator * operator. None of the answers are correct.