What is the output of the following code: #include using namespace std; int main(){ const int LUCKY = 7; cout <« LUCKY * 3 << endl; cin.ignore(); return e; }
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: 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: C++ Functions provide a means to modularize applications Write a function called "Calculate" takes…
A: double squareArea(double side) { double lArea; lArea = side * side; return lArea; }
Q: nclude ing namespace std; ol Facto(int* pSquared, int* pCubed, int n); t main() int number,…
A: Given code contains the functions calling and called. Those contains the methods squared and cubed…
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: What is the output of given code: #include using namespace std; int add(int a,int b){ return (a+b);
A: Given: A function add(int a,int b) which returns the sum of both numbers. Main function that calls…
Q: 1) Define a global variable Emps that is an array of pointers to employee structs. 2) Change your…
A: According to the question , we have to solve 5 parts in the questions but we will discuss first…
Q: typedef struct Complex { double a; double b; }COMP_t, *COMP; //Given the following structure…
A: It is defined as a powerful general-purpose programming language. It can be used to develop software…
Q: What is the output of given code: #include using namespace std; int add(int a,int b){ return (a+b);…
A: Execution starts from main() int a=5, b=3; value will be intialized to a is 5 and b is 3…
Q: C++. Can you please explain the function call and how it works in this specific example.
A: This C++ program has been explained by using step-by-step comments in the Cpp program main.cpp that…
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: #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: QUESTION 23 Given int *ptr, x[6]={11, 238, 4, -70, 9, -53); What the following statement does?…
A: The given code: *(x+3)=12
Q: c++, print the output
A: Since the question only mentioned the output, I'm providing the output for given code: y: 16x : 81x:…
Q: This is the C code I have so far #include #include struct employees { char…
A: Initialize a global array of pointers to employee structs (Emps) with a maximum capacity of 10…
Q: 1) Define a global variable Emps that is an array of pointers to employee structs. 2) Change your…
A: The solution to the given problem is below. ***According to Bartleby policy we are allowed to…
Q: #include <iostream using namespace st int main() int s-4; int d-s++3; cout<<d; return 0;
A: Given Code: #include <iostream>using namespace std; int main(){ int s = 4; int d = s++;…
Q: This expands the previous homework's C code to enable handling multiple employees. You will do this…
A: Program Approach:- 1. Include header file 2. Create the structure whose name is employee 3. Data…
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 #include #include #include #include using namespace std; class A { public:…
A: In this question we have to understand about the code why it is descending and not ascending in…
Q: #include void main() { 19liqm00 ++ tesoronoto char charots = 'A'; gizeb mis100 for (int first = 1;…
A: Program Approach: Step 1: In this program nested loop used. Step 2: Initialize charots variable…
Q: A pedometer treats walking 1 step as walking 2.5 feet. Define a function named FeetToSteps that…
A: 1. Include necessary header files: iostream and iomanip.2. Declare a function named FeetToSteps that…
Q: QUESTION 20 Given int numbers[]={10, 11, 12, 13}; what each line of the following code does? int…
A: Arrayname acts as a pointer to starting element of the array So ptr has the address of starting…
Q: Predict the Output #include <iostream> using namespace std; int main(){cout <<…
A: Given: Predict the Output #include <iostream> using namespace std; int main(){cout <<…
Q: You are working for a computer hardware store and you want to write a program that handles their…
A: Develop a C++ Program for Hardware Store Price ListWrite a C++ program to manage a hardware store's…
Q: 9. Continue example 8. Declare a variable called staff2 of type SEmployee. Assign by individual…
A: Algorithm: Start Define a structure sEmployee with id,name,title,salary as its members Create a…
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: For the following code #include #include int powerof(int base, int pow); int _tmain(int argc,…
A: powerof is a function that takes two parameters base and pow
Q: code the following program and observe how it works then developed a program that returns the…
A: The required Cpp program to find smallest of 3 numbers is provided by making use of the if-else…
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: Answer: The "function header" is a portion of the function definition. It denotes, Function's…
Q: #include #include using namespace std; class Fraction { public: int numerator; int…
A: Output of the given Program: The product of 9/8 and 2/3 is 18/24 The quotient of 9/8 and 2/3 is…
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: What is the output of the code below? #include int main () { int nums ] {20, 15, 10, 5}: int *x =…
A: Pointer: Pointer are point to the address of a variable. *pointerVariable gives the value of the…
Q: Convert the follwoing code into a object-oriented programming (OOP) application using secure and…
A: NOTE: - Any modification to variables being declared or logic of the program is not done. The input…
Q: In C++ struct gameType { string title; int numPlayers; bool online; }; gameType…
A: 1) C++ code snippet in question Creates a structure gameType with string type title integer type…
Q: What will be the output of given code.
A: In the given code a char variable ch is initialised with value 'A'. Then in output &ch is…
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: C PROGRAMr Trace the values of the variables and write output of the following: #include #include…
A: Trace:myStruct array is declared with 5 elements(name:myArray)Tracing for loop, which initializes…
Q: " docs.g #include using namespace sto int main() { char str[20]; cin>>str; cout<<str; return 0; } //…
A: Code: #include<iostream>using namespace std;int main(){ char str [20];cin>>str;//…
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: What is the output of the following code: int multiply(int &a, int &b); int d=3 main () {int…
A: Output is 2 3 6 8 4 Option b.2 3 6 8 4 is the answer
Q: Complete function RollSpecific Number() that has three parameters: a GVDie struct object, an integer…
A: The answer is given in the below step
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: Question 1 is already done need help with the others though This is the C code I have so far…
A: Coded using C language.
Please find the answer below :
Step by step
Solved in 2 steps with 1 images
- C++Find error in the code below. 12/10 should come as 1.2 but it's showing 1.Find the output of the following code. #include using namespace std: void fun1(int&, int ); void fun2[int,int&); int main() { int c1=5, c2=4, c3=3; fun2(c1,c2): cout << c1 <« "" << c2 << "" << c3 << endl: fun2(c3, c1); cout << c1 <« "" << c2 << "" << c3 << endl: fun1(c3, c1): cout <« c3 << endl; return 0: void fun1(int& x, int y) { X-: y++; int a=10: cout<This assignment is not graded, I just need to understand how to do it. Please help, thank you! Language: C++ Given: Main.cpp #include #include "Shape.h" using namespace std; void main() { /////// Untouchable Block #1 ////////// Shape* shape; /////// End of Untouchable Block #1 ////////// /////// Untouchable Block #2 ////////// if (shape == nullptr) { cout << "What shape is this?! Good bye!"; return; } cout << "The perimeter of your " << shape->getShapeName() << ": " << shape->getPerimeter() << endl; cout << "The area of your " << shape->getShapeName() << ": " << shape->getArea() << endl; /////// End of Untouchable Block #2 //////////} Shape.cpp string Shape::getShapeName() { switch (mShapeType) { case ShapeType::CIRCLE: return "circle"; case ShapeType::SQUARE: return "square"; case ShapeType::RECTANGLE: return "rectangle"; case…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…In C++Find the output = for( int a = 5; a >0; a -- ) { cout << "value of a =" << a << endl; } *c++complete and change #include <iostream>using namespace std; int sumbyrow(int* m, int ncol, int row){int total = 0;for (int i = 0 i < ncol; i++) {total += m[row * ncol + i];}return total; } int sumBCol(int* m, int nrow, int ncol, int col){int total = 0;for (int j = 0; < j nrow; j++) {total += m[j * ncol + col]; }return total;}int sumBYLeftDiag(int* m, int ncol){int total = 0;for (int i = 0, j = ncol - 1; i < ncol && j >= 0; i++, j--) {total += m[i * ncol + j];}return total;}bool hasDuplicates(int* m, int row) {int flatArray[row * row];int k = 0for (int i = 0; i < row; i++) {for (int j = 0; j < row; j++) {flatArray[k++] = m[i * row + j]; }}for (int i = 0; i < (row * row); i++) {for (int j = i + 1; j < (row * row); j++) {if (flatArray[i] == flatArray[j])return true; }}return flase;} bool isMagicMatrix(int* m, int nrow, int ncol) { if (hasDuplicate(m, nrow), int ncol{return false; }if (sumByleftDiag(m, nrow) != sumByRightDiag(m, nrow)) {return…#include <iostream> #include<string.h> //user-defined functions question! using namespace std; struct Books { char title[50]; char author[50]; char subject[100]; int book_id; }; int main() { double array1[5]= {13.768,4.0,88.7689,9.12,}; struct Books Book1; strcpy( Book1.title, "C++ Programming"); strcpy( Book1.author, "D.S Malik"); strcpy( Book1.subject, "C++ basics"); Book1.book_id = 6495407; ////Block#1////// int x=4; for (x; x>=0; x--){ cout<<array1[x]<<endl; //////////////////////////////// } cout<<"///////////////////////"<<endl; ////end of Block#1////// ////Block#2////// int sum=0, i=0; for (i; i<5; i++){ cout<<static_cast<int>(array1[i])<<" "; sum= sum+array1[i]; cout<<sum<<endl; } cout<< "final value of sum="<<" "<<sum<<endl; cout<< "the average value ="<<" " <<sum/5 <<endl; cout<<"//////////////////////"<<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…How exactly may hackers steal your identity, and what steps can you take to protect yourself from this happening?using the given code: #include <iostream>using namespace std;int main(){int first = 16;int second = 8;if ((first / second == 2) || (second / first == 3)){second = 10;first = 20;}else if ((first % second == 2 || second % first == 1)){second = 15;first = 5;}else{first = -10;second = -20;}cout << first << " " << second << endl;return 0;} what is the output if a. first = 16 second = 5 b. first = 26 second = 8?What is the output of the following code #include using namespace std; int fun(int a, int b = 1, int c=2) { retum (a +b + c); } int main() { cout << fun(12, ,2); retum 0; } Syntax error 3 14 15