What is the output of the following code snippet? int main() { } int i 5; char* name = "Philip Roger"; = cout <
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A:
Q: This expands the previous work to enable handling multiple employees. You will do this by…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int…
Q: 22. What will be the output of the given code? #include using namespace std; int main() { } int a;…
A: In the given program: The main method is defined to perform the operations. Inside the main method,…
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Clarification:-Here I have made the capacity named readEmployee(), inside the capacity I have taken…
Q: Given the following code and output: int a[] = {10, 20, 30, 40}; cout << a << endl; Example Output…
A: Please find the answer to the above question below:
Q: #include #include struct employees { char name[20]; int ssn[9]; int yearBorn, salary;…
A: Code is implemented in dev C++ :- There are 2 errors:- 1) To run this line struct employees *emp =…
Q: Find the error in the following code and explain how to fix it:
A: The error in the code is in the line : ptr=m; Because ptr is a pointer variable and we cannot assign…
Q: #include using namespace std; void add_3 (int &a){ a = a + 3; int main () { int a = 10; add_3 (a);…
A: Given Program: What type of parameter passing is this Program. #include <iostream> using…
Q: 4. pointers What does the following C code print? char * sn = "123456789"; char * sa = "abcdefghij";…
A: Pointers: Pointers are used to hold the address of the variable. The value from the address is…
Q: (a) #include using namespace std; int main() { } for (int i = 0; i <=30; cout << i*2 << endl; }…
A: In the given code: The loop will start from i=0 For i = 0 it will print 0*2 = 0 Now i has to be…
Q: #include #include typedef struct Car_struct { char type [20]; int year; } Car; int main (void) {…
A: Result: truck Explanation : In the above program, we create a structure which contains two variables…
Q: c
A: Error: The variable i is not declared. Nature: The variable i is used in for loop but never been…
Q: #include using namespace std; int main() { int enteredAge; cin >> enteredAge; while (enteredAge…
A: We are given a C++ code, where output is displayed based on the age entered by the user.The…
Q: The last part of this code I need the gallon round to the nearest number, but it still shows wrong…
A: You should change the round function to ceil() function. Code: #include <iostream>#include…
Q: /I need help debugging the C code below the image is what I was following for directions while doing…
A: The Above Code is Debug Success full:
Q: Write a function called deleteRepeats that has a partially filled array of characters as a formal…
A: To delete repeated characters from a character array.
Q: 45. Will the given code will run without any error or not? #include using namespace std; void…
A: In the given Question we have to determine whether the code will run without any error or not.
Q: #include using namespace std; int main ( ) { static double i; i =…
A: The output is coded in C++.
Q: #include using namespace std; void FindNumber (int number, int lowVal, int highval) { int midVal;…
A: The code snippet given is:- #include <iostream> using namespace std; void FindNumber(int…
Q: ) Rewrite the Circle Class previously defined in lectures, to overload all ecessary operators (+ , -…
A: Given code working :- #include <iostream> #include "Class_Circle.h" using namespace std;…
Q: Complete the code: #include using namespace std; void main() { // Fill in the code to declare…
A: The following are steps need to be taken for the given program: Defining the function prototype of…
Q: 22. What will be the output of the given code? #include using namespace std; int main() { } int a;…
A: Find the output of the given C++ program. About the given program: In the given program, two integer…
Q: Question 1 is already done need help with the others though This is the C code I have so far…
A: As per our guidelines, we are supposed to answer only 1st three parts. Kindly repost the remaining…
Q: This expands the previous work to enable handling multiple employees. You will do this by…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int…
Q: Use the code provided to you to do the following: 1) Write code that implements the function…
A: PROGRAM CODE: #include<iostream>using namespace std; class BankAccount{ private:…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Question 1 is already done need help with the others though This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to…//I need help debugging the C code below the image is what I was following for directions while doing the code// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct…Finish the following code: void Divide (int dividend, int divisor, bool& error, float& result) // Set error to indicate if divisor is zero. // If no error, set result to dividend / divisor. { using namespace std; // For debugging cout << "Function Divide entered." << endl; cout << "Dividend = " << dividend << endl; cout << "Divisor = " << divisor << endl; //** // Rest of code goes here. //** // For debugging if (error) cout << "Error = true "; else cout << "Error = false "; cout << "and Result = " << result << endl; cout << "Function Divide terminated." << endl; }
- Question 1 is already done need help with the others though This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to…Question 1 is already done need help with the others though This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to…Using this starter code: #include <stdio.h> //function prototypesvoid PrintLine(int length, char theChar);void PrintRectangle(int width, int height, char theChar);void PrintTriangle(int baseLength, char theChar);void PrintInvertedTriangle(int height, char theChar); int main(void) { char choice; int a, b; char character; //asking for user input printf("Which shape (L-line, T-triangle, R-rectangle, I-inverted triangle): \n"); scanf(" %c", &choice); printf("Which character: \n"); scanf(" %c", &character); switch (choice){ //if user input is for a triangle case 'T': case 't': printf("Enter an integer base length between 3 and 25: \n"); scanf("%d", &a); if (a >= 3 && a <= 25) PrintTriangle(a, character); else printf("Length not in range."); break; //if user input is for a rectangle case 'R': case 'r': printf("Enter an integer width and height between 2 and 25: \n");…