What is the output of the following code? int num = 17; //Line 1double gpa = 3.85; //Line 2bool done; //Line 3done = (num == static_cast<int>(2 * gpa + 9.3)); //Line 4cout << "The value of done is: " << done << endl; //Line 5
Q: below is the code I need help with answering the questions in the image//
A: Here is the explanation about the scope of the variables:
Q: #include using namespace std; class Box { Public: int length, width, sum, sub, div; Box…
A: The given program is written in the c++ programming language. It can be executed in any one of the…
Q: What will the following code output? int *MyPtr, MyNums[ ]= {-1, 0, 3, 4): MyPtr = MyNums; cout<<…
A: Given:
Q: 1. Write a readEmployee function that takes a pointer to an employee struct and fills in the…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int…
Q: Please Explain this code Step by Step (How Code Works). #include #include #include char…
A: Program is given and need to explain how it is work.
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: please. Correct and detail answer will upvoted else downvote. There are one feline, k mice, and…
A: Here have to determine about c++ code for problem of save more mice statment.
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: #include<iostream>#include<string>class Bicycle{friend std::ostream&…
A: The objective of the question is to implement the decrement operator (--) for the Bicycle class in…
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: please provide flow chart this code //Header Files #include using namespace std;…
A:
Q: only. Do not copy. Correct code will upvoted else downvote. Monocarp is playing a PC game.…
A: Here have to determine about c++ code for computer game problem.
Q: cout<<“Number of the students whose scores less than the average “ <<RESULT(score, size); The…
A: The function RESULT is of return type int. Its two parameters are the array of scores and the size…
Q: #include #include using namespace std; // A function for genrating random number between range…
A: Program: #include<stdio.h> #include<stdlib.h> // A function for generating random number…
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
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: I need to add a call to the PrintLine function of this code:
A: The loop has to be replaced with something other and that is nothing but recursion when the length…
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Here I have created a function named readEmployee(). In this function, I have taken input from the…
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: Write the_code for the function printRoster, it should print out the contacts in a format similar to…
A: 1. Run loop for each pair in roster i. print the key and end line. ii. run loop for…
Q: include #include using namespace std; int main() { double weight, distance; double…
A: According to the Question below the solution: Output:
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Memory Layout of C Programs A typical memory representation of a C program consists of the…
Q: 17. Given the following C code, what is the value of scores[5]? int scores[] =…
A: The objective of the question is to determine the value of the 6th element in the array 'scores'. In…
Q: Please Explain this code: #include #include using namespace std; int main() { int size =…
A: C ++ code to find standard deviation and mean is explained with output
Q: need flowchart for this: #include #include char…
A: Below is the flowchart:
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: Trace through what values are stored in each variable as the code executes and what values will be…
A: Answer: num1: 2 num2: 5 num3: 3 output: 3
Q: Hello i keep getting this error?? im not user where i went wrong? it just keep added more? thank you
A: #include <stdio.h> # include <stdlib.h> int input(); void multiples(); void coins();…
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: This program calculates the package rates from weight of the package and distance the package will…
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: What is the value of the variable ss after the following code is executed? int x[ 7 ] =…
A: In the given program, an array of size 7 is defined which contains 6 elements. Then, a variable ss…
Q: In your program for HW4- Telephone Service Simulation, when is_valid_areacode() is being executed,…
A: Below are the answers for given questions:
Q: Q1) Write a program that Asks for a natural number (Assume that number is n) • Draws the following…
A: sample output
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: 2.20 LAB: Hypotenuse Given two numbers that represent the lengths of a right triangle's legs (sides…
A: Introduction: The name "Hypotenuse" in mathematics derives from the Greek word hypoteinousa, which…
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: 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: /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: /*Line 1:*/ doublevalues[6] = {10, 20, 30, 40, 50, 60}; /*Line 2:*/ double* yalptr= values; /*Line…
A: NOTE: - There is error on line 1 the way of declaring and initializing an array is wrong.…
Q: //Test isEqual function cout << endl << "Testing isEqual function"; cout << endl <<…
A: The C++ program is given below:
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: Here we have given the answer differentiating global and local variables in c. and how they can be…
Q: Q2: If the employee's name is Joe Smith, how much total memory is allocated for the structure and…
A: As per the guidelines we have given answer for the first three question that are Q2, Q3 and Q4. you…
Q: C++ Given code is #pragma once #include #include "ourvector.h" using namespace std; ourvector…
A: Answer: I have complete function as in given question.
Q: For the following code #include #include int powerof(int base, int pow); int _tmain(int argc,…
A: Answer :- The pow() function is used to find the power of a given number. It returns x raised to the…
What is the output of the following code?
int num = 17; //Line 1
double gpa = 3.85; //Line 2
bool done; //Line 3
done = (num == static_cast<int>(2 * gpa + 9.3)); //Line 4
cout << "The value of done is: " << done << endl; //Line 5
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- #include <iostream>#include<iomanip> using namespace std; int main(){ double weight, distance; double rate; cout<<fixed<<setprecision(2); //set precision cout<<"Enter the weight of package: "; cin>>weight; cout<<"Enter the distance to travelled: "; cin>>distance; if((weight > 0 && weight < 21) && (distance > 9 && distance < 2001)){ if(weight <= 2){ rate = (14.85 / 500) * distance; }else if(weight > 2 && weight <= 6){ rate = (20.30 / 500 ) * distance; }else if(weight > 6 && weight <= 10){ rate = (31.80 / 500 ) * distance; }else if(weight > 10 && weight <= 21){ rate = (53.00 / 500 ) * distance; } cout<<"\nCharges for "<< weight <<" kg to travelled…>> IN C PROGRAMMING LANGUAGE ONLY << COPY OF DEFAULT CODE, ADD SOLUTION INTO CODE IN C #include <stdio.h>#include <stdlib.h>#include <string.h> #include "GVDie.h" int RollSpecificNumber(GVDie die, int num, int goal) {/* Type your code here. */} int main() {GVDie die = InitGVDie(); // Create a GVDie variabledie = SetSeed(15, die); // Set the GVDie variable with seed value 15int num;int goal;int rolls; scanf("%d", &num);scanf("%d", &goal);rolls = RollSpecificNumber(die, num, goal); // Should return the number of rolls to reach total.printf("It took %d rolls to get a \"%d\" %d times.\n", rolls, num, goal); return 0;}C++ complete magic Square #include <iostream> using namespace std; /*int f( int x, int y, int* p, int* q ){if ( y == 0 ){p = 0, q = 0;return 404; // status: Error 404}*p = x * y; // product*q = x / y; // quotient return 200; // status: OK 200} int main(){int p, q;int status = f(10, 2, &p, &q);if ( status == 404 ){cout << "[ERR] / by zero!" << endl;return 0;}cout << p << endl;cout << q << endl; return 0;}*/ /*struct F_Return{int p;int q;int status;}; F_Return f( int x, int y ){F_Return r;if ( y == 0 ){r.p = 0, r.q = 0;r.status = 404;return r;}r.p = x * y;r.q = x / y;r.status = 200;return r;} int main(){F_Return r = f(10, 0);if ( r.status == 404 ){cout << "[ERR] / by zero" << endl;return 0;}cout << r.p << endl;cout << r.q << endl;return 0;}*/ int sumByRow(int *m, int nrow, int ncol, int row){ int total = 0;for ( int j = 0; j < ncol; j++ ){total += m[row * ncol + j]; //m[row][j];}return total; } /*…
- //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",…//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",…//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…
- //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…4) x=(b=3,b+2); Z=pow(x.b); cout<< Z;//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…
- cout << setw(20) << this->words[i].getWord() << "\t" << this->words[i].getFrequency() << endl; This code keeps giving me errors "class word have no member getfrequency"//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",…//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",…