What is the output of the following code segment? int x 9; %3D cout << X+3B
Q: Now, modify it to do the following: modify the while loop to utilize tolower() or toupper().
A: Hi There, Please find your solution below, I hope you would find my solution useful and helpful. I…
Q: QI B// find the error and type and then bulid ST ? #include "iostream" void main() { const…
A: let us see the answer:-
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: >A Click
A: #include<iostream> using namespace std; void xFunction(int i) { int…
Q: What will the following program display? a <--- 3 b <--- 3 MOD 5 DISPLAY ( A=5)
A: The value of variable a is 3. The value of variable b is also 3 as when 3 MOD 5 is done the result…
Q: Please fill in the blanks for C /* Print full name*/ #include #include __1__…
A: For the scan_name function: Since isDone variable is of the boolean type (1)->bool Also…
Q: char x='B'; cout<<x<<x-1; а. В97 O b. B90 O C. B65 Od. Ba
A: answer is
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: include int main() { int M; printf("Enter the number of chairs you want to…
A: As your question , i run the code i got two issue in the given code:…
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: What is the final value of x when the following code is run? int x; for(x =1; x<20; x+=2) {}
A: Introduction of the for loop: A for loop is a control flow statement in which initialization,…
Q: I/ what is the output of the following code segment: int a, b, c, d; a = 7; b = 6; C(++b a--); cout…
A: Note:- While evaluation in ++b incremented value of b is taken as it is pre increment operator.…
Q: Modify the while loop to utilize tolower() or toupper(). Add default values to the to_celsius() and…
A: #include <iostream>#include <cmath>#include <cctype> // contains tolower function…
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: Write a C program that will search a value in the array.
A: Logic: Accept number of elements. Array declaration of size n. Accept array elements.…
Q: I have a problem with this code can please fix it and explain it for me: //header files…
A: I have given an answer in step 2.
Q: What is the final value of total?
A: I answered this in step2
Q: - What will be the value of M as a result of the following operations? int M; M=33/5; cout<<M; 06,5…
A: We will run this code in a proper C++ program. Then we will get the output.
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: <?php /* NOTE: To see your output in the console, follow your output with a new line "\n" Write…
A: - We need to get the first value of the array passed as parameter in PHP.
Q: Program Input: Two values one for the age and the other for the number of monthly subscriptions.…
A: Sample Output Screenshot:
Q: #include using namespace std; void myfunction(int num2, int num1); lint main() { myfunction (5,2);…
A: C++ is an object oriented programming language.
Q: /*Modify this code to change the functions double AreaOfCircle(double radius=1); double…
A: #include <iostream> using namespace std; void PrintMenu(); double Area(double v=0); double…
Q: Which is correct with respect to the size of the data types? a) char > int float c) char < int <…
A: Question. Which is correct with respect to the size of the data types? a) char > int < float…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A:
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: thedW.d What will the following code display? void showDub (int); 5. int main () int x = 2; cout « x…
A: Step 1:- Given:- void showDub(int);int main(){ int x=2; cout<<x<<endl;…
Q: Modify the following code with the comment include #include #include #include #include int…
A: Algorithm for Bank Withdrawal Program:1. Declare a 2x2 array 'arr' representing account balances.2.…
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: What is the value of the variable count after the function has been called 2 times? void myPrint(…
A: To solve this problem, first of all you need to know what is static variable. Let’s start the…
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: Which is correct with respect to the size of the data types? a) char > int float c) char < int <…
A: THe answer is as follows:-
Q: #include #include using namespace std; // declare functions void display_menu(); void…
A: Source Code : #include <iostream>#include <cmath>#include <cctype> // including…
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: /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: nteger variable numYards is read from input. Type cast numYards to a double. Ex: If the input is…
A: The below code will read an integer from the user input and type cast the variable to a double.…
Q: Create two more functions (options #3 and #4 in your menu) by taking the to_celsius() and…
A: C++ program for the above two problems :
Q: void Q1_3() { cout=0; ctr--, intP--) { cout<<"ASCII code of character "<< *intP <<" is equal to…
A: A C++ code is provided to us, and its output will be the ASCII value of the input character. I've…
Q: ow, modify it to do the following: Add two more functions to handle another type of…
A: Here we write simple function using function overloading:…
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: Given the following code segment: for (rows = 0 ; rows <199; rows ++) { for (space = 0; space < num;…
A: Here's a concise summary:Mice Statement: cout << "*";Elephant Statement: cout << " ";Big…
Q: o complete please below.
A: The code is below:
Q: The last part of this code I need the "cans" to be a whole number. I don't know how to change it…
A: We have a program in C++ language and we have an output where Cans needed value is float and we need…
Step by step
Solved in 2 steps with 1 images
- 2%19 l. O d P O 11:0Y Write a C++ program that declares an array alphabet of 4 rows and 6 columns of type char, :Then Set the content of the components of the (1 :array to be as the following namma hsarej # a baq a & dibri Convert the content of the components of (2 the array (using while loop) to be as the :following * •NAMMA H S A REJ # A BAQA & DIBR Count the vowel letters in the array (using for (3 loop and switch structure) Print the array alphabet (using do-while (4 loop) II >Write a function that asks you to enter 15 numbers. The function must sort these numbers in descending order and calculate which number is most often found in the array. In c++//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",…
- void Q1_1() { } const int SIZE = 22; char value[] = ('c', 'e', 'E', 'p', '1', 'u', 's', 'P', 'L', ‘U', 'S'}; //ASCII code of A to Z is 65 to 90 cout<Hello I'm working on C++. I'm not really sure how to add arrays and what to add in void getGrades. Program Requirements: Use two arrays of doubles for the grades. Use a global constant for the max size of the arrays Use a void function called GetGrades that accepts a single argument (one array) and prompts the user for grades to enter. Use a boolean function called GradesAreSame that accepts two arguments (both arrays) as constant parameters. It should return true if both arrays are the same and false if the arrays are different.- What does the program write on the screen with the following code? cout<< (7-6)*6-7/4B#include<stdio.h> #include<math.h> int main() { char cod; int gal; float cost; printf("Data Codes:"); printf(" \n H-Home \n C-Commercial \n I-Industrial "); printf("\nInput data code: "); scanf("%c", &cod); printf("\nInput number of water (in gallons) used: "); scanf("%d", &gal); if (cod=='H'|| cod=='h') { cost = 250+(0.002*gal); printf("\nTOTAL COST IS %.2f", cost); } else if (cod=='C'||cod=='c') { if (gal<=4000000) { printf("\nTOTAL COST IS 5000.00"); }…#include <iostream> #include <cmath> using namespace std; // declare functions void display_menu(); void convert_temp(); double to_celsius(double fahrenheit); double to_fahrenheit(double celsius); int main() { cout << "Convert Temperatures\n\n"; display_menu(); char again = 'y'; while (again == 'y') { convert_temp(); cout << "Convert another temperature? (y/n): "; cin >> again; cout << endl; } cout << "Bye!\n"; } // define functions void display_menu() { cout << "MENU\n" << "1. Fahrenheit to Celsius\n" << "2. Celsius to Fahrenheit\n\n"; } void convert_temp() { int option; cout << "Enter a menu option: "; cin >> option; double f = 0.0; double c = 0.0; switch (option) { case 1: cout << "Enter degrees Fahrenheit: "; cin >> f; c =…#include <iostream> using namespace std; int rectArea (int len, int wid) { return len * wid; } int main () { int length, width; cin >> length >> width; cout << "The area of a " << length << " by " << width << " rectangle is " << /*add code to call the reacArea function */ << "." << endl; return 0; }Which is correct with respect to the size of the data types?a) char > int < floatb) int < char > floatc) char < int < floatd) char < int < doubleC++ I am lost, can you help me find my way please Finding values in vectors. Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 2, 1, 2} and matchValue is 2 , then numMatches should be 3.Your code will be tested with the following values:* matchValue: 2, userValues: {2, 2, 1, 2} (as in the example program above)* matchValue: 0, userValues: {0, 0, 0, 0}* matchValue: 50, userValues: {10, 20, 30, 40} #include <iostream>#include <vector>using namespace std; int main() { const int NUM_VALS = 4; int matchValue; unsigned int i; int numMatches = -99; // Assign numMatches with 0 before your for loop vector<int> userValues(NUM_VALS); cin >> matchValue; for (i = 0; i < userValues.size(); ++i) { cin >> userValues.at(i); } cin >> numMatches; numMatches = userVals.at(0); for (i = 0; i < userVals.size(); ++i) { if…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; }SEE MORE QUESTIONS