XLSX is the extension for an excel document.
Answer:
a variable of type "double" is more suitable for finding average because average could be any number with decimal places. we can't use a variable of type "integer" because it will omit the value after the decimal and will not produce satisfactory results.
Explanation:
an example of C++ code is given to find the average of two numbers a and b
#include <iostream>;
using namespace std;
int main() {
double a = 2.334;
double b = 34;
double average = (a + b) / 2;
cout << average;
return 0;
}
A function that returns Pascal's Triangle with n rows:
//import necessary headers
public class Pascal_Triangle {
// calculate factorial
static int factorial(int n)
{
int fact = 1;
int i;
for(i=1; i<n; i++)
{
fact*=i;
}
return i;
}
// Actual code to display the //pascal triangle
static void display(int n)
{
int i;
int line;
for(line=1;line<=n;line++)
{
for(i=0;i<=line;i++)
{
System.out.print((factorial(line)/factorial(line-i) * factorial(i)) + " ");
}
System.out.println();
}
}
// To read user input
public static void main(String[] args){
BufferedReader breader=new BufferedReader(new InputStreamReader(System.in));
int n;
System.out.println("Enter the size for creating Pascal triangle");
try {
n = Integer.parseInt(breader.readLine());
}
catch(Exception e){
System.out.println("Please enter a valid Input");
return;
}
System.out.println("The Pascal's Triangle is");
display(n);
}
}
Answer:
in memory
Explanation:
A database refers to a collection of data that is organized and stored in a computer system.
Flash memory is a non-volatile memory chip that helps to transfer data from a personal computer (PC) to a digital device.
A flat file comprises a single table of data.
Becca is working on a program that will store data such that the program will need quick access to data and data persistence is not important.
Therefore,
data should be stored in memory.