6. infave = Given the following code segment, what is the output? int x = 1, y = 1, z = 1; %3D Y - y + z; x = x + y: cout <« "result = " << (x < y ? y: x) <« endl;
Q: QI B// find the error and type and then bulid ST ? #include "iostream" void main() { const…
A: let us see the answer:-
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: char x='B'; cout<<x<<x-1; а. В97 O b. B90 O C. B65 Od. Ba
A: answer is
Q: #include using namespace std; void Square(int radius){ int result=radius*radius;…
A: function declaration - Tells the compiler about a function's name, return type, and parameters.…
Q: convert this into #include using namespace std; int main() { int A,B; cout>A>>B; if (A>B)…
A: #include <stdio.h>using namespace std;int main(){ int A, B; printf("Input the values…
Q: what is the output of the following program? #include<iostream,h void
A: Actual Parameters: Actual arguements are the arguments that are passed to the function defintion. In…
Q: ude using namespace std; int main () { int x, number1, number2; cout>number1; cout>number2;…
A: First declare 3 integer variables X, number1, number2. Read number1, number2. Here we are using…
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: Given: int num = 0, y = 0, count; for (count=1; count <= 4; count++) { y = y + count; num = num + y;…
A: In a given block of C++ code initial num=0,y=0 First iteration of for-loop i.e count = 1 y = y +…
Q: My code #include using namespace std; int main () { float…
A: The following changes can be done to make the program more readable: Include spaces between the…
Q: #include #include using namespace std; main () int a, b, c, d, e, sum1=1, sum2=2; cout >a; cout >…
A: Take the values from user. Read the values. Find the sum Print the sum
Q: #include using namespace std; int main() { int N,Prime,i=1,n; cout>"%d",&N; do { Prime=0; n=1; do {…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: #include using namespace std; int main() { int specialNum; cin » specialNum; if (/put your answer…
A: specialNum == 0 || specialNum == -99 || specialNum == 44 This Expression should be filled to…
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: Char ch = 'F'; cout << static_cast(ch - ' A ' + ' a ') <<endl; what would the following code…
A: Static cast is compiled time type cast conversion technique in CPP. Syntax:- static_cast<data…
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: 2 Calculate Big O DO NOT COPY FROM OTHER WEBSITES
A: In this question, we have to tell the time complexity of the given program. Here, the while loop is…
Q: #include using namespace std; int main() { int x, y, z, w, visit; char s; cout>s;…
A: Given: #include <iostream>using namespace std; int main(){ int x, y, z, w, visit;…
Q: When using structures you can enforce invariants by using functions to change your data. Complete…
A:
Q: mployees of a supermarket. The report lists total hours for // each day of one week. // Input:…
A: code : #include <iostream> #include <string> using namespace std; //main function…
Q: #include using namespace std; int main() { double hours, pay, gross, regular, OT, OT1; cout…
A: 1) You program had some issue in if else if statements. It is updated such that First if condition…
Q: int x = 0; for (x=0; x< 5; x = x + 1) { cout << "Hello World"; } cout << x << endl; What is the…
A: The initial value of x is 0 and each time when for loop will be executed then the value of x is…
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: we can access global variable if there is a local variable through EXTERN and scope resolution . The…
Q: // SuperMarket.cpp - This program creates a report that lists weekly hours worked // by employees…
A: #include <vector> #include <iostream> #include <string> struct Day {…
Q: Q: Find the results main () {int A, B;
A: I have provided answer of this question in step-2.
Q: None
A: Coded in C++.
Q: using namespace std; eint div_2(int a){ if(a%2==0){ return 1; return -1; } 4} evoid div_6(int b){ }…
A: Program always start frommain function. main function call div_6(12) and it pass 12 to the function.…
Q: 9-The script in the left side is used to solve the right-side equation.
A: true
Q: Q1: How many total calls to malloc are made during createEmployee (including readEmployee and…
A: Hi there, please find your solution below, I hope you would find my solution useful and helpful,…
Q: // the calling statement is: cout (y)); else return(static_cast(2 * y) - x);
A: Correct option: 30
Q: /below is the code I need help with answering the questions in the image// #include…
A: Q3: Many people put the SSN in a char[9] field (1 kind of encouraged it). Is that big enough to hold…
Q: C++ Programming: How can I get rid of the global variable "char gamePlayer = 'X';
A: The global variable x can be removed by creating a local instance of that variable and passing that…
Q: // P41.cpp - A simple elevator for 4 floors and a basement with a // close door button and 5 keys…
A: #include<iostream> #include<cmath> using namespace std; void close_door(); int…
Q: int input; cout << "enter input " << endl; cin >> input; int…
A: Program: //include the header file #include <iostream> using namespace std; //definition of…
Q: void (double a) cout<<"" a = "; cout<<a<<endl; ... %3D
A: Given:
Q: Predict the output of the following program when the user enters 0, 1, and 2. #inçlude kiostream>…
A: GIVEN:
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: One may want to set a default value for the property member, and therefore when not started would…
Q: #include using namespace std; int main () { int x, y; x = 5; * y = ++x ++X; cout << x << y; x = 5;…
A: The cout is a predefined object of ostream class.
Q: tx=2; t a =(!5== out << x; X
A: In given code, at line int x int x =2; it initializes value 2 to x. x++; post increment x after use…
Q: int number aa.5; if (number> m) { cout << "The number is positive." << endl; } else { cout << "The…
A: Answer the above question are as follows
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: In the current code there is not initialized global employee variable But if there was a global…
Q: #include using namespace std; int main() { int y, x=1, total =0; while (x <= 10) { y=x * x; cout <<…
A:
Q: What will the following program code display?
A: Type casting is the concept when we force compilers to change the data type of values.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- #include <iostream> using namespace std; void times(int& prod, int mpr, int mcand) { prod = 0; while (mpr != 0) { if (mpr % 2 == 1) prod = prod + mcand; mpr /= 2; mcand *= 2; } } int main(){ int product, n, m; cout << "Enter two numbers: "; cin >> n >> m; times(product, n, m); cout << "Product: " << product << endl; return 0; } Convert the product into pep9 assembly language.Determine all the output from the following program as it would appear on the screen. void func1(int); void func2(int = 4, int = 5, int = 2); int func3(int &, int, int); %3D int main() { int x = 0, z = 0, y = 2; func1(y); cout << y << endl; func2(x, y, z); func2(); func3(x, y, z); = Z func1(x); cout << x << " " << y << " " << z << endl; return 0; } void func1(int b) { static int a;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 print the employee data to console void display(struct employees…
- 4. s = 1; do { s++; cout 12) 468 10 148 12Untitled Section This is a segment of program, when it executed with multiple values for n and s the program displays the value of f, choose which output of f values are wrong answers cin>>x>>y; if (x>1) &&(y<5) {f=x+y*9; else f-x-y-11; } cout<#include#include#includeusing namespace std;// outputHtmlTitle// parameters// This function...void outputHtmlTitle(ofstream & fout, string title){fout << "" << endl;fout << "" << endl;fout << "" << endl;fout << "" << endl;fout << title << endl;fout << "" << endl;}void outputHtmlFooter(ofstream & fout){fout << "" << endl;fout << "" << endl;}void outputHtmlList(ostream & fout, string first, string second, string third){fout << "" << endl;fout << "\t" << first << "" << endl;fout << "\t" << second << "" << endl;fout << "\t" << third << "" << endl;fout << "\t" << endl;}void main(int argc, char * *argv){ofstream htmlFile("myIntro.html");string title;cout << "Please enter the title: ";getline(cin, title);outputHtmlTitle(htmlFile, title);string name;string course1, course2, course3;cout…C++#include <iostream>using namespace std; int main(){ int x, y, z, w, visit; char s; cout<<"Details of charges are as follow: "<<endl; cout<<"Software Fault: 4 OMR"<<endl; cout<<"Screen Fault: 6 OMR"<<endl; cout<<"Network/Wi-Fi Fault: 8 OMR"<<endl; cout<<"Internal Hardware Fault: 10 OMR \n"<<endl; cout<<"Please enter your Service Issue: "<<endl<<"x for Software Fault"<<endl<<"y for Screen Fault"<<endl<<"z for Network Fault"<<endl<<"w for Hardware Fault \n"<<endl; cin>>s; if(s==x) cout<<"Software Fault: Price - 4 OMR "<<endl; else if(s==y) cout<<"Screen Fault: Price - 6 OMR"<<endl; else if(s==z) cout<<"Network/Wi-Fi Fault: Price - 8 OMR"<<endl; else if(s==w) cout<<"Internal Hardware Fault: Price - 10 OMR"<<endl; else…//below is the code I need help with answering the questions in the image// #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 employees *e) { printf("%s",…Input: #include <iostream> using namespace std; int main() { int x = -1; unsigned int y = 2; if(x > y) { cout << "x is greater"; } else { cout << "y is greater"; } } Output:#include<iostream> #include <cmath> using namespace std; int main() { float sp_Radius, sp_sa, sp_Volume; cout << "\nPlease Enter the radius of a Sphere = "; cin >> sp_Radius; sp_sa = 4 * M_PI * sp_Radius * sp_Radius; sp_Volume = (4.0/3) * M_PI * sp_Radius * sp_Radius * sp_Radius; cout << "\nThe Surface Area of a Sphere = " << sp_sa; cout << "\nThe Volume of a Sphere = " << sp_Volume; return 0; } C++ use this code and separate the program into three files. The main program containing the main function should be named main.cpp. The function definition file containing a function for the volume calculation and a function for the surface area calculation should be named SphereCalc.cpp. The function declaration file containing function declarations for the functions should be named SphereCalc.h. Make sure you include a Header Guard. Read the Radius from the Keyboard. If a negative number is provided, set the calculated value to zero.Q1 B// find the error and type and then bulid ST? #include "iostream" void main() { const PI=3.14,s=0; int r,h; cout>>"Enter values of r and h' cin>>r,h; v=PI*r*r*h; cout<<<'volume="<Recommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education