What part of the program has a BUG?
Q: 1 #include 2 3 int main() 4{ float y; 7 scanf("%f",&y); 8. 9. switch(y) { 10 11 case 1.1: 12 13 14…
A: The solution to the given problem is below.
Q: I ned help programming this C++ program: Write a C++ console application that calculates and…
A: C++ Code: #include <iostream>using namespace std; float calculateCharges(int hours) { //…
Q: #include #include void LineFunc(void); void main() { int a, b; printf("Enter a :"); scanf_s("%d",…
A: The program after compilations gives an error that is So the error in this has occurred due to…
Q: Write a C program that repeatedly asks the user to enter real numbers from the keyboard then it…
A: Ask for option to quit after entering each and every number
Q: In Python, grades_dict = {'Wally': [87,96,70], 'Eva': [100,87,90],…
A: Answer:
Q: #include #include #pragma warning(disable : 4996) // compiler directive for Visual Studio only…
A: Start a pointer p at the first element of the 2D array of characters 'strings' Use a for loop to…
Q: //Program 4.6 #include 1 2 3 #include 4 int main (){ char c1, с2, с3, с4; cl=65; c2='A'; c3=0x41;…
A: In this code we get error.
Q: #include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of…
A: Add the statement “i+1” in the print statement: printf("salesman %d ",i+1); Add another array to…
Q: Now, modify it to do the following: Modify the while loop to utilize tolower() or toupper(). Add…
A: So for first we will use tolower. tolower(A) changes A to a. So even if we enter Y or N, it will be…
Q: need flowchart for this: #include #include char…
A: Below is the flowchart:
Q: How to fix this zeros?? Here's the code! #include struct student //Defining structure { int id;…
A: PROGRAM CODE AS PER GIVEN BY YOU: #include<stdio.h>struct student //Defining structure{int…
Q: please correct this code i didnt get the mistake #include #define NROWS 8 #define NCOLS 8…
A: Correct Source Code of Above Code :- #include<stdio.h>#define NROWS 8#define NCOLS 8#define…
Q: From 1-100 #include Rewrite code given below and correct all errors, the code s from 1-100 after…
A: This is a C program that uses a for loop to print the numbers from 1 to 100. The program starts by…
Q: #include using namespace std; int main() int length, width, area; area - length • width; length -…
A:
Q: Input: #include using namespace std; int main() { int x = -1; unsigned int y = 2; if(x…
A: Given, We have to provide the output for the given code: Code is given in the C++ programming…
Q: Write a C# program that asks the user to enter the coefficients of a second order equation a, b, and…
A: In this question we have to write a C# program that ask user to enter the coefficient of a second…
Q: Write a C program that repeatedly asks the user to enter real numbers from the keyboard then it…
A: use atof function which converts string to float.
Q: #include using namespace std; void times(int& prod, int mpr, int mcand) { prod = 0; while (mpr…
A: Actually, program is a executable software that runs a computer
Q: #include using namespace std; double average(int sum_of_grades,int num_grades) { return…
A: Algorithm: CalculateLetterGrade1. Include the necessary header file for input/output…
Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's…
A:
Q: #include void main( ) { = 1; for (int i = 1, i >num; if ( num> 0 ) sum = sum + num; cout<<“the sum…
A: EXPLANATION --> Space is missing between int and num. Closing braces is missing of main…
What part of the
#include<conio.h>
#include<stdio.h>
main()
{
(1) int no1,no2;
printf(“Input 1st Number: ”);
scanf(“%i”,&no1);
printf(“\nInput 2nd Number: ”);
(2) scanf(“%f”,&no2);
(3) printf(“\nThe First number is %i and the Second number is %i”,no1,no2);
getch();
return 0;
}
Step by step
Solved in 2 steps
- #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…
- In C++be recor #include #include minutes #include limit on int func(int, int, int, int); main(){ srand(time(NULL)); int a, b, c, fNum; printf("Choose three different numbers between 0-39:"); scanf ("%d%d%d", &a, &b, &c); fNum = func (a, b, c, 25); printf("\nThe result: %d", fNum); } int func (int ul, int u2, int u3, int iter){ srand (time (NULL)); int n1=0, i=0, count=0; for (;i#include <stdio.h>#include <stdlib.h> int cent50 = 0;int cent20 = 0;int cent10 = 0;int cent05 = 0; //Function definitionvoid 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);}} //Define the functionvoid 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); cent50 = 0;cent20 = 0;cent10 = 0;cent05 = 0; } //Function's definitionint TakeChange() { int change;printf("\nEnter the amount : ");scanf("%d", &change);return change; }//main functionint main() {//call the functionint change = TakeChange(); //use while-loop to repeatedly ask for input to the userwhile(change != -1){if((change %…#include <stdio.h>#include <stdlib.h> int cent50 = 0;int cent20 = 0;int cent10 = 0;int cent05 = 0; //Function definitionvoid 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);}} //Define the functionvoid 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);cent50 = 0;cent20 = 0;cent10 = 0;cent05 = 0; } //Function's definitionint TakeChange() { int change;printf("\nEnter the amount : ");scanf("%d", &change);return change; }//main functionint main() {//call the functionint change = TakeChange(); //use while-loop to repeatedly ask for input to the userwhile(change != -1){if((change %…#include <stdio.h>#include <stdlib.h> int cent50 = 0;int cent20 = 0;int cent10 = 0;int cent05 = 0; //Function definitionvoid 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);}} //Define the functionvoid 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);cent50 = 0;cent20 = 0;cent10 = 0;cent05 = 0; } //Function's definitionint TakeChange() { int change;printf("\nEnter the amount : ");scanf("%d", &change);return change; }//main functionint main() {//call the functionint change = TakeChange(); //use while-loop to repeatedly ask for input to the userwhile(change != -1){if((change %…#include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of salesman(max 20): ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n salesman %d sales: ");scanf("%d", &s[i]);}for(i=0; i<d; i++){for(r=i+1; j<d; r++){if(s[i] > s[r]){p= s[i];s[i] = s[r];s[j] = p;}}}printf("\nsalesman lowest to highest: ");for(i=0; i<d; i++){printf("%d\t", s[i]);}for(i=0;i<m;i++){printf("\n highest sales: %d ",lg);if(lg<=s[i])lg=s[i];break;}getch();} >>> the upper part output should be like this enter number of salesman (max 20): 5 salesman 1 500 salesman 2 300 salesman 3 1000 salesman 4 200 salesman 5 1000 in the lower part the lowest to highest the output should become like this salesman 4 200 salesman 2 300 salesman 1 500 salesman 3 1000 salesman 5 1000 highest total sales : 2000Needs to be done in C# language. Problem Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.C - Right Facing Angle#include <stdio.h> int main(){ int M; printf("Enter the number of chairs you want to enter:\n"); scanf("%d", &M); double price[M]; double sum = 0.0; int i=0; while(i < M) { printf("Enter price of chair #%d: ",(i+1)); scanf("%lf", &price[i]); if(price[i] < 1003) { price[i] = price[i] - price[i] * 0.10; sum = sum + price[i]; } else if(price[i] >= 1003 && price[i] <= 2006) price[i] = price[i] - price[i] * 0.15; else if(price[i] > 2006) price[i] = price[i] - price[i] * 0.20; printf("Price of chair #%d after discount is %.3lf\n", (i+1), price[i]); i++; } printf("\n\nTotal price after discount of all chairs which got a discount of 10%% is "); printf("%.3lf", sum); int N = 2; printf("\n\nN is equal to the sum of My EUI ID(1+1) = 2"); double p[N]; printf("\nEnter price of %d desks: ",…SEE MORE QUESTIONS