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
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.Programming Language: C++ Please use the resources included and provide notes for understanding. Thanks in advance. 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 with the number of times the team won the championship as well as the years they won them. The input file is attached, along with the main function and screenprint. 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. The following resources are included: Here is main. #include <iostream>#include <fstream>#include<string> using namespace std; // Add function declarations and documentation here 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…. Array passed as an argument to a function is interpreted as
- ix) Define a function named arrayCount that takes an array and a number as the parameters and the function should return the count of number in the array. Python# dates and times with lubridateinstall.packages("nycflights13") library(tidyverse)library(lubridate)library(nycflights13) Qustion: Create a function called date_quarter that accepts any vector of dates as its input and then returns the corresponding quarter for each date Examples: “2019-01-01” should return “Q1” “2011-05-23” should return “Q2” “1978-09-30” should return “Q3” Etc. Use the flight's data set from the nycflights13 package to test your function by creating a new column called quarter using mutate()TRUE OR FALSE, C++ When passing an array to a function, you must include & in front of the array name. When passing an array to a function, you must include & in front of the array name. It is possible to have a 2-dimensional array where each row has a different number of columns. The * is called the address of operator.
- Assignment: Write four different functions: a) void SelectionSort(Data *A, int N), where A is the array and N is number of data in the array. Data is the datatype, which you can declare first as a global declaration, by using typedef int Data; This helps by changing the datatype of the data to be sorted easily. b) int Min(Data *A, int start, int N); // this will retun the index min, for the smallest data from the data set A[start] to A[N-1] c) void InsertionSort(Data A, int N): d) void PrintArray(Data * A, int N); // when called this function will display all the data in the array A Also, write the driver function (i.e. the main), main should do the following: i) Declare the array dynamically, so that memory can be used efficiently. To declare an array dynamically, the following steps may be used: • Declare a pointer of type Data Data * A; • Declare number of data N, and read a value for N • Allocate memory A = new Data [N] ii) Prompt the user to enter N number of data, and store those…c++ program Q2 Write a C++ program to store values in a two-dimensional array i.e., 3x4 and then write a function that displays the elements of the array. You should take input in the main function and then pass the array to a “PrintArray” function. The function will print the array on the display.C++ Create a function that will read the following .txt file contents and put them into an array: "apple", "avocado", "apricot","banana", "blackberry", "blueberry", "boysenberry","cherry", "cantaloupe", "cranberry", "coconut", "cucumber", "currant","date", "durian", "dragonfruit","elderberry",
- II. Directions: Select and underline the letter that corresponds to your answer. I. Directions, Write TRUE if the statement is correct, otherwise, write FALSE. Write your answer on the space provided for. 1. Which of the following statements best describes "arrays"? a. These are data types that can accommodate more than one data. b. Set of clearly defined rules that are applied in order to solve problems. c. These are data structure that can store more than one data of the same type. d. The process of coding a program using a specific programming language. 1. Arrays are data structures that contains more than one data of the same type. 2. The first element in an array is found at index 1. 2. Using the declaration given below: int x[] = {12, 13, 14, 15, 16, 17, 18, 19 }; What does x[2] refer to? a. 12 3. Sometimes an index is called a subscript. |ь. 14 С. 13 |d. 15 4. Consider the code below: 3. Using the code below: int[] num= {2, 3, 4, 5}; Console. WritelLine(num[4]); An…01 (B):- By using array named STD. Write a program in C++ LANGUAGE to calculate student appreciation based on the following criteria's. When the average in the range from 50 to 59 → print ACCEPT When the average in the range from 60 to 69 → print MEDIUM When the average in the range from 70 to 79 → print GOOD When the average in the range from 80 to 89 → print VERY GOOD When the average in the range from 90 to 99 → print EXCELLENT Otherwise print FAILC++ Rainfall Statistics Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: Function getData: This function reads and stores data in the two- dimensional array. The program should verify that the user entered a number and that the high number is higher than the low number for a month. Function averageHigh: This function calculates and returns the aver- age high temperature for the year. Function averageLow: This function calculates and returns the average low temperature for the year. Function indexHighTemp: This function returns the index of the highest high temperature in the array. Function indexLowTemp: This function returns the index of the lowest low temperature in the array. These functions must all have the appropriate parameters. INPUT…