Which of the data types has the size that is variable? a) int b) struct c) float d) double
Q: #include main() { int const a = 5; %3D a++; printf (%d,a); }
A: The const keyword is used to create constant variable in a program whose value cannot be changed…
Q: Exercise #4: Write a program that finds the area of a triangle given the base and the height of a…
A: Below I have provided the answer based on C++ Programming. Refer to the comments for a better…
Q: e-find o/p of program? #include using namespace std; int main() { const int SIZE-4; float a[SIZEJ =…
A: The output is below. Since the array size is 4, the last values are garbage.
Q: What will the following program display? #include using namespace std; int main() { int unus, duo,…
A: GIVEN: What will the following program display? #include using namespace std; int main() { int unus,…
Q: #include void main() { int i,x; cout> x;
A: Given :
Q: Which is correct with respect to the size of the data types? ans. double > char >int char>int> float…
A: Option C Char<int<double
Q: 15. Overloaded Hospital Write a program that computes and displays the charges for a patient's…
A: Required:
Q: GIVEN (Code): #include using namespace std; void display even(int numbers[], int length){ //Write…
A: #include <iostream>using namespace std;//function that takes an array and displaying even…
Q: Function strlen() takes a string as an argument and returns the number of characters in the string,…
A: Strlen finds the length of string .
Q: Part C: Assuming variable starts with the value 10, what will the following code fragment prints…
A: This question is checking the performance of the increment operator. Normaly when value++ or ++value…
Q: 4. What is the output of the following code? int test func (int value) value = 10*value; cout <<…
A: The answer is...
Q: Subscripted variable is any type such as (A) Int (B) Float (C) Int, float or char (D) Char
A: Variables are used to store information to be referenced and manipulated in a computer program.
Q: Question 15 What is the type of error in the following program 1 #include 2 using namespace std; 3\…
A: ERRORS AND THEIR TYPES: Following are the lines that have errors in the program code: float…
Q: Q2: complete the function that returns the area of a circle with radius r, note, use math.pi for pi.…
A: Given: To complete the python code.
Q: int function(int num1, int num2) { if (num2 == 0) return 1; if (num2 % 2 == 0) return function(num1…
A: the question tells us to trace the execution of the program. the program basically is recursive…
Q: (c) What are the values of the variables incr, de cr, and total after the following code fragment is…
A:
Q: With the statement, int a=1; With the statement, while(a<=5){ int x=1; a++; while(x<20) { printfl"%d…
A: GIVEN:
Q: void func(int&, int& b, float& ) { cout > a; // enter e cout > b; // enter 1
A: Please find the answer below :
Q: #include int main() { float a =3e-1,b=2e-2; printf("a=%f b=%f",a,b); return 0; } note : what is e…
A: e work as scientific notation for example. Significand Exponent Scientic notation float/fixed…
Q: What is the output of the following code segment?double vall = -9;int val2 = 7;cout<<floor…
A: #include <iostream>#include<math.h>using namespace std; int main(){ double vall =…
Q: 7/Program 4.2 #include #include int main (){ int nilai1; nilail = 4; printf("%d+%d=%d", nilail,…
A: Dear Student 1. First your program will not compile because you did not declare nilai2 variable. if…
Q: Given the following code: long int data[] - {5, 7, 9, 1}; long int ptr - nullptr; Write a statement…
A: 2
Q: Assume num1 has been declared as an int, and ch has been declared as a char. Each of the following…
A: Given data: An int num1 and char ch.
Q: def f(x: float) -> int: return int(x) def g(x: str) -> float: return float(x) y = f(g("3.14"))…
A: Answer: Option 3 - y's inferred data type is int Explanation: The given equation is y=f(g("3.14"))…
Q: What is the value of the variable named len after the code that follows is executed?int[][] nums = {…
A: What is the value of the variable named len after the code that follows is executed?int[][] nums = {…
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: GIVEN: The following declaration, program, and program segment has errors. Locate as many as you…
Q: What does the following code segment output? Assume that a variable is declared.
A: Note: In while() loop there is No updating of variable (count) . therefore, loop will continue to…
Q: Which of the following are considered to be primitive data types? (A short B long (© char D array E)…
A: Primitive data types: A primitive type is a data type where the values that it can represent have a…
Q: If you build and run the code shown below. The value of b is .. ........ #include #include int…
A: Find your answer below
Q: Given the table below, declare the following variables with the corresponding data types and…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: int main (void) float a,b, m; printf("Enter the minor A exam score:"); //input the minor A exam…
A: Code explained below
Q: What will the following program segment display? char dog[] = "Fido";cout << strlen(dog)…
A: ExplanationThe strlen function is a predefined function of string class library.It accepts a…
Q: The following variables have been initialized for you: int a; float f; double d; You have to…
A: Below program does casting of variables for different data types It declare variables a, d and f…
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: The value of a in below code is } ;int a=3 ;float b=3.0 ;a+= (a==b)? b:-b ;cout << a {
A: Here, one C++ code snippet is given. Find the output of the code: int a=3; float b=3.0;…
Q: This is for Python version 3.8.5 - this is a 2 part question; I cannot submit separate as it gets…
A: Pseudocode: Open file. While True. Read the name. Write the name in a file. If the name is empty,…
Q: Using the following statements, what value is displayed? *include #include using namespace std;…
A: The program is written in the C++ programming language.
Q: change normal body temperature to 36.5–37.5 °C #include using namespace std; int main() { float…
A: Given, Change the code so that normal body temperature is 36.5–37.5 °C
Q: Identify the correct variable in the following: a. _abc b. float c. 2abc d. int
A: The correct option is given in step 2.
Q: Which data type would be used to store a whole number that you plan to add to another number?
A: Data types are defined for each variable which are declared. Data type defines the type of value a…
Q: Show what the program segment would display on the screen. int x = 2;…
A: Please find the answer below :
Q: #include using namespace std; (14) float calcArea (float); float PI 3.14159; int main() { float a,…
A: answer along with output and code screenshot
Q: Exercises A) Create an application in C# to collect all the following marks out of 100 and then…
A: Input: Scores of 6 components in the given order Output: individual marks, final marks, average…
Q: What is the output? #include using namespace std; const double LB PER KG = 2.2; double KgsTOLbs…
A: output will be : 22
Q: What is the error in the code below? finished = False while finished != False: value =…
A: finished = Falsevalue=0 #value variable should be declare herewhile finished != False: #while should…
Q: tinclude int main() { int length = 20; width = 15, area; length * width - area; cout << "The area…
A: The fixed code is shown below: #include <iostream> using namespace std;int main() { int…
Q: #include #include using namespace std; // PLACE YOUR NAME HERE const int MAXNAME = 20;…
A: Hi. please find the answer below. Step-by-step explanation#include <fstream>#include…
Q: #include woid main(void) I printf("Enter a word... "); char a [100]; scanf("%s", a); printf("You…
A: Yes, since the maximum size of string is 100 if entered string size is more than 100 then it will…
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: Lets see the solution.
Q: #include #include using namespace std; int main() { float sp_Radius, sp_sa, sp_Volume; cout >…
A: main.cpp //Header files#include "SphereCalc.h"#include <iostream>using namespace std; //Main…
None
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- What does function sqrt do? Which header file must be included to use the function sqrt? (3)Hi I need help please its simple I want to overload the << operator to display the date in a Date object in full name. For example: 05/20/1999 should display as May 20, 1999 The display shall not update the Date object. I also dont know why the function wont accept 08 and 09 as values of month. my Date.h file contains:Code two functions to fill an array with the names of every World Series winning team from 1903 to 2020, then output each World Series winner and the number of times the team won the championship. The input file is attached, along with a main function and screen print. Please note team names that include two words, such as Red Sox, have an underscore in place of the space. This enables you to use the extraction operator with a single string variable. My program is not working can you help me figure out who to make it run? It needs to contain these specific things Code a function to fill an empty array Fill an array from an input file Search the array for specific elements Output specific array elements as part of a string Use a for loop to step through an array Use a for loop to count occurrences in an array Use a conditional statement within a for loop used to process an array Use input stream objects Use string objects I attached the world series winners list and a preview of…
- Code two functions to fill an array with the names of every World Series winning team from 1903 to 2020, then output each World Series winner and the number of times the team won the championship. The input file is attached, along with a main function and screen print. Please note team names that include two words, such as Red Sox, have an underscore in place of the space. This enables you to use the extraction operator with a single string variable. My program is not working can you help me figure out who to make it run? I attached the world series winners list and a preview of how the program should look #include <iostream>#include <fstream>#include<string>using namespace std;void fill (string teams[], int size);void findWinner (string teams[], int size); int main () { const int SIZE = 118;int lastIndex;string team[SIZE]; fill (team, SIZE);findWinner (team, SIZE); return 0;} fstream fin ("WorldSeriesWinners.txt", ios::in); void fill (string teams[], int size){int…Which of the following c data types can store a value in the least amount of memoryWhich of the following statement(s) are true for the above code? Group of answer choices the code allocates space for a local variable and a global array the code allocates space for a local variable and a local array The code utilizes the index register the code utilizes the stack pointer the code uses 5 different addressing modes
- Identify the number of syntax and/or logical error found in the code fragment below. (Assume all headers are included) int main(){ // Assume the file has one number per line fstrem f("file.text", ios:out); int n; for(int line = 1; line <= 10; line++) { f >> n; cout << line << ". " << n << endl; } return 0;}can you help me with this code: create a function called validate_password that takes a password and validates it based on the following rules. A password should be: 1. at least 8-character long 2. include at least one number 3. inlude an uppercase letter 4. include a special characterWhich of the following 'C' type is not a primitive data structure? A. int B. float C. char D. none of these
- MUST BE IN C AND UTILIZE USER DEFINED FUNCTION. THANK YOU UDF should take an argument, which needs to be an array, and return the average to the mainfunction. The average should be displayed by a printf() within the main (). Create a script that will find the average of {-100, 97, 83, 21, -50, 20, 101, 30}, {12, 21, 57, 28, 108,30}, {10,20,30,40, 50, 60, 70, 90, 100, -110, -120, -130,-140}, or ANY SET OF NUMBERS![THE USER SHOULD BE PROMPTED TO TYPE IN THE SIZE OF ARRAY. THEN, EACH FOLLOWING NUMBERTHAT USER TYPES IN SHOULD BE STORED IN THIS ARRAY. Whole computation must be done by accessingelements in the array.)#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.#include <iostream> using namespace std; int main(){ int arr1[10][10],arr2[10][10]; int result[10][10]; int row,column; int i,j; cout<<"--------matrix calculator--------\n\n"; //ask user to enter the number of row and column cout<<"Enter the number of rows : "; cin>>row; cout<<"Enter the number of columns : "; cin>>column; // asking user to enter the data on matrix cout<<"\nEnter the data for 1st matrix : \n"; for (i=0; i<row; i++) { for (j=0; j<column; j++) { cout<<"Data "<<i<<" : "<<j<<" --> "; cin>>arr1[i][j]; } } cout<<"\nEnter the data for second matrix : \n"; for (i=0; i<row; i++) { for (j=0; j<column; j++) { cout<<"Data "<<i<<" : "<<j<<" --> ";…